2
2
#define ANTPLUS_BASEMASTERPROFILE_h
3
3
4
4
#include < BaseClasses/ANTPLUS_BaseProfile.h>
5
+ #include < BaseClasses/ANTPLUS_BaseDataPageMsg.h>
5
6
6
7
class BaseMasterProfile : public BaseProfile {
7
8
public:
8
9
BaseMasterProfile (uint16_t deviceNumber, uint8_t transmissionType);
9
10
/* *
10
11
* start profile transmission sequence
11
12
*/
12
- virtual void begin ();
13
+ virtual void begin () override ;
13
14
protected:
14
15
/* *
15
16
* Used to catch EVENT_TX and continue transmission pattern
16
17
* Also handles EVENT_TRANSFER_TX_COMPLETED for acknowledgement
17
18
*/
18
- virtual void onChannelEventResponse (ChannelEventResponse& msg);
19
+ virtual void onChannelEventResponse (ChannelEventResponse& msg) override ;
19
20
/* *
20
21
* This function, when called, will transmit the next message in the broadcast pattern
21
22
*/
22
23
virtual void transmitNextDataPage () = 0;
23
24
/* *
24
25
* Checks for RequestDataPage messages and handles them accordingly
25
26
*/
26
- virtual void onAcknowledgedData (AcknowledgedData& msg);
27
+ virtual void onAcknowledgedData (AcknowledgedData& msg) override ;
27
28
/* *
28
29
* Checks with subclass to see if request is valid
29
30
*/
@@ -40,11 +41,16 @@ class BaseMasterProfile : public BaseProfile {
40
41
* returns true if the request is meant to be sent as a acknowledged message
41
42
*/
42
43
bool isRequestedPageAcknowledged ();
44
+ /* *
45
+ * Handles ack msg conversions for requests, all transmissions that are part of the broadcast pattern should be through this.
46
+ */
47
+ void transmitMsg (BaseDataPageMsg<BroadcastDataMsg> &msg);
48
+ void transmitMsg (BaseDataPageMsg<AcknowledgedDataMsg> &msg);
43
49
private:
44
50
void handleRequestDataPage (AcknowledgedData& msg);
45
- uint8_t _requestedPage;
51
+ uint8_t _requestedPage = 0 ;
46
52
uint8_t _requestedCount = 0 ;
47
- bool _isRequestAcknowledged;
53
+ bool _isRequestAcknowledged = false ;
48
54
bool _requestAcked = true ;
49
55
};
50
56
0 commit comments