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

WiMOD_SAP_RLT.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
31 //------------------------------------------------------------------------------
32
33
34 #ifndef ARDUINO_SAP_WIMOD_SAP_RLT_H_
35 #define ARDUINO_SAP_WIMOD_SAP_RLT_H_
36
37 //------------------------------------------------------------------------------
38 //
39 // Section Includes Files
40 //
41 //------------------------------------------------------------------------------
42
43 #include "WiMOD_SAP_RLT_IDs.h"
44 #include "../HCI/WiMODLRHCI.h"
45
46 /*
47 * C++11 supports a better way for function pointers / function objects
48 * But C++11 mode is not supported by all platforms.
49 */
50 #ifdef WIMOD_USE_CPP11
51 #include <functional>
52 #endif
53 //------------------------------------------------------------------------------
54 //
55 // Section defines
56 //
57 //------------------------------------------------------------------------------
58
61
62
63
64 //-----------------------------------------------------------------------------
65 //
66 // types for callback functions
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)> TRltStatusIndicationCallback;
75
76 #else
77 /* pre C++11 function callback definitions */
78
80 typedef void (*TRltStatusIndicationCallback)(TWiMODLR_HCIMessage& rxMsg);
81
82 #endif
83
84
85 //------------------------------------------------------------------------------
86 //
87 // Section class
88 //
89 //------------------------------------------------------------------------------
90
91
95 class WiMOD_SAP_RLT {
96 public:
97 WiMOD_SAP_RLT(TWiMODLRHCI* hci, UINT8* buffer, UINT16 bufferSize);
98 virtual ~WiMOD_SAP_RLT(void);
99
100 virtual TWiMODLRResultCodes StartRadioLinkTest(const TWiMODLR_RLT_Parameter* params, UINT8* statusRsp);
101 virtual TWiMODLRResultCodes StopRadioLinkTest(UINT8* statusRsp);
102
103 virtual bool convert(TWiMODLR_HCIMessage& RxMsg, TWiMODLR_RLT_Status* statusData);
104
105 virtual void RegisterStatusIndClient(TRltStatusIndicationCallback cb);
106
107 virtual void DispatchRLTMessage(TWiMODLR_HCIMessage& rxMsg);
108
109 protected:
111 UINT8* txPayload;
112 UINT16 txPayloadSize;
114
115 private:
117
118 TWiMODLRHCI* HciParser;
119
120 TRltStatusIndicationCallback StatusIndCallback;
122 };
123
124
125
126
127
128
129 #endif /* ARDUINO_SAP_WIMOD_SAP_RLT_H_ */
WiMOD_SAP_RLT
Implementation for the ServiceAccessPoint RadioLinkTest (LR-Base firmware only)
Definition: WiMOD_SAP_RLT.h:95
WiMOD_SAP_RLT::StartRadioLinkTest
virtual TWiMODLRResultCodes StartRadioLinkTest(const TWiMODLR_RLT_Parameter *params, UINT8 *statusRsp)
Starts the integrated Radio Link Test mode/feature.
Definition: WiMOD_SAP_RLT.cpp:98
TWiMODLR_RLT_Status::LocalSNR
UINT8 LocalSNR
Definition: WiMOD_SAP_RLT_IDs.h:123
TWiMODLR_RLT_Parameter::DestGroupAddress
UINT8 DestGroupAddress
Definition: WiMOD_SAP_RLT_IDs.h:104
TWiMODLRHCI
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:235
WiMOD_SAP_RLT::convert
virtual bool convert(TWiMODLR_HCIMessage &RxMsg, TWiMODLR_RLT_Status *statusData)
Convert a received low level HCI-Msg to a high-level SensorAckData structure.
Definition: WiMOD_SAP_RLT.cpp:191
WiMODLR_RESULT_TRANMIT_ERROR
@ WiMODLR_RESULT_TRANMIT_ERROR
Definition: WiMODLRHCI.h:154
TWiMODLR_RLT_Status::PeerRSSI
UINT16 PeerRSSI
Definition: WiMOD_SAP_RLT_IDs.h:122
TWiMODLR_HCIMessage
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
TWiMODLR_RLT_Status::PeerSNR
UINT8 PeerSNR
Definition: WiMOD_SAP_RLT_IDs.h:124
WiMODLR_RESULT_OK
@ WiMODLR_RESULT_OK
Definition: WiMODLRHCI.h:151
WiMOD_SAP_RLT_IDs.h
WiMOD_SAP_RLT::WiMOD_SAP_RLT
WiMOD_SAP_RLT(TWiMODLRHCI *hci, UINT8 *buffer, UINT16 bufferSize)
Constructor.
Definition: WiMOD_SAP_RLT.cpp:60
TWiMODLR_RLT_Status::LocalRSSI
UINT16 LocalRSSI
Definition: WiMOD_SAP_RLT_IDs.h:121
TWiMODLR_RLT_Status
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RLT_IDs.h:114
TWiMODLR_RLT_Parameter
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RLT_IDs.h:102
TWiMODLR_HCIMessage::Length
UINT16 Length
Definition: WiMODLRHCI.h:123
TWiMODLR_HCIMessage::MsgID
UINT8 MsgID
Definition: WiMODLRHCI.h:129
TWiMODLR_RLT_Status::LocalRxCounter
UINT16 LocalRxCounter
Definition: WiMOD_SAP_RLT_IDs.h:118
TWiMODLR_HCIMessage::Payload
UINT8 Payload[WIMODLR_HCI_MSG_PAYLOAD_SIZE]
Definition: WiMODLRHCI.h:132
WiMOD_SAP_RLT::~WiMOD_SAP_RLT
virtual ~WiMOD_SAP_RLT(void)
Destructor.
Definition: WiMOD_SAP_RLT.cpp:75
TWiMODLR_RLT_Parameter::PacketSize
UINT8 PacketSize
Definition: WiMOD_SAP_RLT_IDs.h:106
WiMOD_SAP_RLT.h
TWiMODLR_RLT_Parameter::DestDevAddress
UINT16 DestDevAddress
Definition: WiMOD_SAP_RLT_IDs.h:105
TWiMODLR_RLT_Parameter::TestMode
TRLT_TestMode TestMode
Definition: WiMOD_SAP_RLT_IDs.h:108
TWiMODLRResultCodes
TWiMODLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
WiMOD_SAP_RLT::StopRadioLinkTest
virtual TWiMODLRResultCodes StopRadioLinkTest(UINT8 *statusRsp)
Stops the integrated Radio Link Test mode/feature.
Definition: WiMOD_SAP_RLT.cpp:143
TWiMODLR_RLT_Status::LocalTxCounter
UINT16 LocalTxCounter
Definition: WiMOD_SAP_RLT_IDs.h:117
WiMOD_SAP_RLT::RegisterStatusIndClient
virtual void RegisterStatusIndClient(TRltStatusIndicationCallback cb)
Register a callback function for the event "RLT Status Indication".
Definition: WiMOD_SAP_RLT.cpp:172
TWiMODLR_RLT_Status::PeerTxCounter
UINT16 PeerTxCounter
Definition: WiMOD_SAP_RLT_IDs.h:119
TWiMODLR_RLT_Status::PeerRxCounter
UINT16 PeerRxCounter
Definition: WiMOD_SAP_RLT_IDs.h:120
RLT_SAP_ID
#define RLT_SAP_ID
Definition: WiMOD_SAP_RLT_IDs.h:52
TWiMODLR_RLT_Parameter::NumPackets
UINT16 NumPackets
Definition: WiMOD_SAP_RLT_IDs.h:107
TWiMODLR_RLT_Status::TestStatus
UINT8 TestStatus
Definition: WiMOD_SAP_RLT_IDs.h:116
TRltStatusIndicationCallback
void(* TRltStatusIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RLT.h:80