| Demo HCI Implementation for WiMOD-LR Devices V2.0.3

WiMOD_SAP_RemoteCtrl.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
31 //------------------------------------------------------------------------------
32
33
34 #ifndef ARDUINO_SAP_WIMOD_SAP_REMOTECTRL_H_
35 #define ARDUINO_SAP_WIMOD_SAP_REMOTECTRL_H_
36
37 //------------------------------------------------------------------------------
38 //
39 // Section Includes Files
40 //
41 //------------------------------------------------------------------------------
42
43
44 #include "WiMOD_SAP_RemoteCtrl_IDs.h"
45 #include "../HCI/WiMODLRHCI.h"
46
47
48 /*
49 * C++11 supports a better way for function pointers / function objects
50 * But C++11 mode is not supported by all platforms.
51 */
52 #ifdef WIMOD_USE_CPP11
53 #include <functional>
54 #endif
55
56 //------------------------------------------------------------------------------
57 //
58 // Section defines
59 //
60 //------------------------------------------------------------------------------
61
62 //-----------------------------------------------------------------------------
63 //
64 // types for callback functions
65 //
66 //-----------------------------------------------------------------------------
67
68
69 // C++11 check
70 #ifdef WIMOD_USE_CPP11
71 /* C++11 function callback definitions */
72
74 typedef std::function<void (TWiMODLR_HCIMessage& rxMsg)> TRemoteCtrlBtnPressedIndicationCallback;
75
76
77 #else
78 /* pre C++11 function callback definitions */
79
81 typedef void (*TRemoteCtrlBtnPressedIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
82
83 #endif
84
85
86 //------------------------------------------------------------------------------
87 //
88 // Section class
89 //
90 //------------------------------------------------------------------------------
91
92
96 class WiMOD_SAP_RemoteCtrl {
97 public:
98 WiMOD_SAP_RemoteCtrl(TWiMODLRHCI* hci, UINT8* buffer, UINT16 bufferSize);
99 virtual ~WiMOD_SAP_RemoteCtrl();
100
101 virtual bool convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLR_RemoteCtrl_BtnPressed* btnInfo);
102
103 virtual void RegisterBtnPressedClient(TRemoteCtrlBtnPressedIndicationCallback cb);
104
105 virtual void DispatcRemoteCtlMessage(TWiMODLR_HCIMessage& rxMsg);
106
107 protected:
109 UINT8* txPayload;
110 UINT16 txPayloadSize;
112
113 private:
115 TWiMODLRHCI* HciParser;
116
117
118 TRemoteCtrlBtnPressedIndicationCallback BtnPressedIndCallback;
120 };
121
122 #endif /* ARDUINO_SAP_WIMOD_SAP_REMOTECTRL_H_ */
TWiMODLR_RemoteCtrl_BtnPressed::SourceDeviceAddress
UINT16 SourceDeviceAddress
Definition: WiMOD_SAP_RemoteCtrl_IDs.h:95
TWiMODLRHCI
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:235
TWiMODLR_HCIMessage
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
TWiMODLR_HCIMessage::Length
UINT16 Length
Definition: WiMODLRHCI.h:123
TWiMODLR_HCIMessage::MsgID
UINT8 MsgID
Definition: WiMODLRHCI.h:129
WiMOD_SAP_RemoteCtrl::RegisterBtnPressedClient
virtual void RegisterBtnPressedClient(TRemoteCtrlBtnPressedIndicationCallback cb)
Register a callback function for the event "Button Pressed Indication".
Definition: WiMOD_SAP_RemoteCtrl.cpp:123
TRemoteCtrlBtnPressedIndicationCallback
void(* TRemoteCtrlBtnPressedIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RemoteCtrl.h:81
TWiMODLR_HCIMessage::Payload
UINT8 Payload[WIMODLR_HCI_MSG_PAYLOAD_SIZE]
Definition: WiMODLRHCI.h:132
TWiMODLR_RemoteCtrl_BtnPressed::SourceGroupAddress
UINT8 SourceGroupAddress
Definition: WiMOD_SAP_RemoteCtrl_IDs.h:94
WiMOD_SAP_RemoteCtrl
Implementation for the ServiceAccessPoint RadioLink (LR-Base firmware only)
Definition: WiMOD_SAP_RemoteCtrl.h:96
TWiMODLR_RemoteCtrl_BtnPressed::ButtonBitmap
UINT8 ButtonBitmap
Definition: WiMOD_SAP_RemoteCtrl_IDs.h:97
TWiMODLR_RemoteCtrl_BtnPressed::DestinationGroupAddress
UINT8 DestinationGroupAddress
Definition: WiMOD_SAP_RemoteCtrl_IDs.h:91
WiMOD_SAP_RemoteCtrl::WiMOD_SAP_RemoteCtrl
WiMOD_SAP_RemoteCtrl(TWiMODLRHCI *hci, UINT8 *buffer, UINT16 bufferSize)
Constructor.
Definition: WiMOD_SAP_RemoteCtrl.cpp:61
WiMOD_SAP_RemoteCtrl.h
TWiMODLR_RemoteCtrl_BtnPressed
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RemoteCtrl_IDs.h:86
WiMOD_SAP_RemoteCtrl_IDs.h
WiMOD_SAP_RemoteCtrl::convert
virtual bool convert(TWiMODLR_HCIMessage &RxMsg, TWiMODLR_RemoteCtrl_BtnPressed *btnInfo)
Convert a received low level HCI-Msg to a high-level Rx Data structure.
Definition: WiMOD_SAP_RemoteCtrl.cpp:90
TWiMODLR_RemoteCtrl_BtnPressed::DestinationDeviceAddress
UINT16 DestinationDeviceAddress
Definition: WiMOD_SAP_RemoteCtrl_IDs.h:92