demo_hr_transmitter.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. This software is subject to the license described in the License.txt file
  3. included with this software distribution. You may not use this file except
  4. in compliance with this license.
  5. Copyright (c) Dynastream Innovations Inc. 2016
  6. All rights reserved.
  7. */
  8. #ifndef _DEMO_H_
  9. #define _DEMO_H_
  10. #include "types.h"
  11. #include "dsi_framer_ant.hpp"
  12. #include "dsi_thread.h"
  13. #include "dsi_serial_generic.hpp"
  14. BOOL bCaughtSig = FALSE;
  15. class Demo {
  16. public:
  17. Demo();
  18. virtual ~Demo();
  19. BOOL GetUserInfo();
  20. BOOL Init(UCHAR ucDeviceNumberUSB_);
  21. void Start();
  22. void HeartBeat();
  23. void Close();
  24. private:
  25. BOOL InitANT();
  26. //Starts the Message thread.
  27. static DSI_THREAD_RETURN RunMessageThread(void *pvParameter_);
  28. //Listens for a response from the module
  29. void MessageThread();
  30. //Decodes the received message
  31. void ProcessMessage(ANT_MESSAGE stMessage, USHORT usSize_);
  32. //check if we've had a a ctrl-c,
  33. static BOOL CtrlHandler( DWORD fdwCtrlType );
  34. BOOL bBroadcasting;
  35. BOOL bMyDone;
  36. BOOL bDone;
  37. BOOL bPrintAllMessages;
  38. UCHAR ucChannelType;
  39. INT siDeviceNumberANT;
  40. DSISerialGeneric* pclSerialObject;
  41. DSIFramerANT* pclMessageObject;
  42. DSI_THREAD_ID uiDSIThread;
  43. DSI_CONDITION_VAR condTestDone;
  44. DSI_MUTEX mutexTestDone;
  45. //variables to hold HRM data
  46. USHORT usHeartBeatEventTime;
  47. UCHAR ucHeartBeatCount;
  48. UCHAR ucHeartRate;
  49. ULONGLONG ullTimeSinceStart;
  50. ULONGLONG ullStartupTime;
  51. UCHAR aucTransmitBuffer[ANT_STANDARD_DATA_PAYLOAD_SIZE];
  52. // UCHAR pucData[USER_DATA_LENGTH]; //data to transfer in a burst
  53. };
  54. #endif //TEST_H