File tree Expand file tree Collapse file tree 2 files changed +65
-3
lines changed Expand file tree Collapse file tree 2 files changed +65
-3
lines changed Original file line number Diff line number Diff line change 1- // TODO
1+ #include < CommonDataPages/TX/ANTPLUS_ManufacturersInformationMsg.h>
2+ #include < CommonDataPages/ANTPLUS_CommonDataPagePrivateDefines.h>
3+ #include < CommonDataPages/ANTPLUS_CommonDataPageDefines.h>
4+ #include < ANTPLUS_PrivateDefines.h>
5+
6+ // TODO Magic numbers
7+ ManufacturersInformationMsg::ManufacturersInformationMsg () : BaseDataPageMsg() {
8+ setDataBuffer (_buffer);
9+ _buffer[0 ] = 80 ;
10+ _buffer[1 ] = 0xFF ;
11+ _buffer[2 ] = 0xFF ;
12+ }
13+
14+ uint8_t ManufacturersInformationMsg::getHWRevision () {
15+ return _buffer[3 ];
16+ }
17+
18+ uint16_t ManufacturersInformationMsg::getManufacturerId () {
19+ uint16_t temp = _buffer[4 ];
20+ temp |= _buffer[5 ] << 8 ;
21+ return temp;
22+ }
23+
24+ uint16_t ManufacturersInformationMsg::getModelNumber () {
25+ uint16_t temp = _buffer[6 ];
26+ temp |= _buffer[7 ] << 8 ;
27+ return temp;
28+ }
29+
30+ void ManufacturersInformationMsg::setHWRevision (uint8_t revision) {
31+ _buffer[3 ] = revision;
32+ }
33+
34+ void ManufacturersInformationMsg::setManufacturerId (uint16_t id) {
35+ _buffer[4 ] = id & 0xFF ;
36+ _buffer[5 ] = (id >> 8 ) & 0xFF ;
37+ }
38+
39+ void ManufacturersInformationMsg::setModelNumber (uint16_t modelNumber) {
40+ _buffer[6 ] = modelNumber & 0xFF ;
41+ _buffer[7 ] = (modelNumber >> 8 ) & 0xFF ;
42+ }
Original file line number Diff line number Diff line change 1- // Common Page 80
2- // TODO
1+ #ifndef ANTPLUS_MANUFACTURERSINFORMATIONMSG_h
2+ #define ANTPLUS_MANUFACTURERSINFORMATIONMSG_h
3+
4+ #include < BaseClasses/ANTPLUS_BaseDataPageMsg.h>
5+
6+ #include " ANT.h"
7+
8+ // Common page 80
9+
10+ class ManufacturersInformationMsg : public BaseDataPageMsg <BroadcastDataMsg> {
11+ public:
12+ ManufacturersInformationMsg ();
13+ uint8_t getHWRevision ();
14+ uint16_t getManufacturerId ();
15+ uint16_t getModelNumber ();
16+ void setHWRevision (uint8_t revision);
17+ void setManufacturerId (uint16_t id);
18+ void setModelNumber (uint16_t modelNumber);
19+ private:
20+ uint8_t _buffer[MESSAGE_SIZE];
21+ };
22+
23+ #endif // ANTPLUS_MANUFACTURERSINFORMATIONMSG_h
You can’t perform that action at this time.
0 commit comments