 |
Demo HCI Implementation for WiMOD-LR Devices
V2.0.3
|
Go to the documentation of this file.
34 #ifndef ARDUINO_WIMODLR_BASE_PLUS_H_
35 #define ARDUINO_WIMODLR_BASE_PLUS_H_
55 #include "utils/WMDefs.h"
74 #ifdef WIMOD_USE_CPP11
81 #define WIMOD_LR_BASE_PLUS_SERIAL_BAUDRATE 115200
83 #define WiMOD_LR_BASE_PLUS_TX_BUFFER_SIZE 100
214 bool copyResultInfos(
TWiMODLRResultCodes* hciResult, UINT8* rspStatus, UINT8 successValue);
229 UINT8 txBuffer[WiMOD_LR_BASE_PLUS_TX_BUFFER_SIZE];
231 UINT8 localStatusRsp;
Implementation for the ServiceAccessPoint DeviceManagement.
Definition: WiMOD_SAP_Generic.h:78
bool GetSystemStatus(TWiMODLR_DevMgmt_SystemStatusPlus *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the bas SystemStatus info from WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:340
bool SetRtcAlarm(const TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets and enables the RTC alarm feature of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:805
bool Ping(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Ping Cmd - Checks serial connetion to WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:190
void RegisterAckRxTimeoutClient(TRadioLinkAckRxTimeoutIndicationCallback cb)
Register a callback function for the Ack Timeout Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:1750
void RegisterCDataRxClient(TRadioLinkCDataRxIndicationCallback cb)
Register a callback function for the RX C-Data Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:1607
bool SetRtc(const UINT32 rtcTime, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current RTC values to WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:426
bool GetHciConfig(TWiMODLR_DevMgmt_HciConfig *hciConfig, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current HCI configuration of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:991
void calcFreqToRegister(uint32_t freq, uint8_t *msb, uint8_t *mid, uint8_t *lsb)
Convert a frequency in Hz to the corresponding low level register values.
Definition: WiMODLR_BASE_PLUS.cpp:1809
bool StopRadioLinkTest(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to stop a running Radio Link Test.
Definition: WiMODLR_BASE_PLUS.cpp:2129
Structure containing the radio (stack) config parameters of the WiMOD (only for LR-BASE)
Definition: WiMOD_SAP_DEVMGMT_PLUS_IDs.h:292
Implementation for the ServiceAccessPoint RadioLinkTest (LR-Base firmware only)
Definition: WiMOD_SAP_RLT.h:95
WiMOD_SAP_RadioLink SapRadioLink
Definition: WiMODLR_BASE_PLUS.h:223
bool GetSensorAppConfig(TWiMODLR_SensorApp_Config *config, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to get the current config of the integrated Sensor App feature of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:2387
void RegisterPowerUpIndicationClient(TDevMgmtPowerUpCallback cb)
Register a callback function for the PowerUp Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:916
void RegisterBtnPressedClient(TRemoteCtrlBtnPressedIndicationCallback cb)
Register a callback function for the RemoteCtrl Btn Pressed Indication.
Definition: WiMODLR_BASE_PLUS.cpp:2638
bool SetRadioConfig(const TWiMODLR_DevMgmt_RadioConfigPlus *radioCfg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current configuration for the radio of the WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:523
bool GetFirmwareInfo(TWiMODLR_DevMgmt_FwInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the basic FirmwareInfo from WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:301
void RegisterAckTxCallback(TRadioLinkAckTxIndicationCallback cb)
Register a callback function for the TX Ack Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:1794
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:235
void(* TRadioLinkUDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:115
UINT8 GetLastResponseStatus(void)
Gets the value of the last status response value of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:1919
bool SetAckData(const TWiMODLR_RadioLink_Msg *txMsg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets additional user payload for the next ack frame to send.
Definition: WiMODLR_BASE_PLUS.cpp:1447
bool GetRtc(UINT32 *rtcTime, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current RTC data info from WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:387
void RegisterSensorAppDataIndClient(TSensorAppSensorDataIndicationCallback cb)
Register a callback function for the SensorAppData Indication.
Definition: WiMODLR_BASE_PLUS.cpp:2479
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RadioLink_IDs.h:160
bool GetDeviceInfo(TWiMODLR_DevMgmt_DevInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the basic DeviceInfo from WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:262
bool ExecuteGenericCmd(TWiMODLR_Generic_CmdInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Generic Execution Function for HCI commands that are currently not implemented.
Definition: WiMODLR_BASE_PLUS.cpp:1979
Basic information about the current firmware of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:220
void(* TRadioLinkAckRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:130
WiMODLRBASE_PLUS(Stream &s)
Constructor.
Definition: WiMODLR_BASE_PLUS.cpp:72
Structure containing information about an acknowledgment transmission.
Definition: WiMOD_SAP_RadioLink_IDs.h:243
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
Structure containing the RTC Alarm config parameters of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:484
TWiMOD_OperationMode
This enum describes the possible operation modes of the WiMOD (only for LR-BASE).
Definition: WiMOD_SAP_DEVMGMT_IDs.h:440
bool SetAesKey(const UINT8 *key, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the security 128bit AES key to use for RF communication.
Definition: WiMODLR_BASE_PLUS.cpp:711
bool GetRadioConfig(TWiMODLR_DevMgmt_RadioConfigPlus *radioCfg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current configuration of the radio of the WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:473
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_SensorApp_IDs.h:121
Basic information about system status of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_PLUS_IDs.h:331
Structure containing the data of an Ack of the SensorApp.
Definition: WiMOD_SAP_SensorApp_IDs.h:164
bool SendUData(const TWiMODLR_RadioLink_Msg *txMsg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to send transmit U-Data to peer module via RF link.
Definition: WiMODLR_BASE_PLUS.cpp:1091
void RegisterRltStatusClient(TRltStatusIndicationCallback cb)
Register a callback function for RLT updates.
Definition: WiMODLR_BASE_PLUS.cpp:2186
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RLT_IDs.h:114
Structure containing SensorApp Data information.
Definition: WiMOD_SAP_SensorApp_IDs.h:137
WiMOD_SAP_DevMgmt_Plus SapDevMgmt
Definition: WiMODLR_BASE_PLUS.h:222
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RLT_IDs.h:102
void(* TRadioLinkRawDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:121
bool SetHciConfig(TWiMODLR_DevMgmt_HciConfig &hciConfig, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets a new HCI configuration of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:1033
void(* TRadioLinkCDataTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:127
void(* TRemoteCtrlBtnPressedIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RemoteCtrl.h:81
WiMOD_SAP_RemoteCtrl SapRemoteCtrl
Definition: WiMODLR_BASE_PLUS.h:227
TRadioCfg_RadioMode
general operation mode of the radio part (only for LR-BASE)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:255
bool convert(TWiMODLR_HCIMessage &RxMsg, TWiMODLR_RadioLink_Msg *radioLinkMsg)
Convert a received low level HCI-Msg to a high-level RadioLink-Msg.
Definition: WiMODLR_BASE_PLUS.cpp:1218
void RegisterSensorAppAckIndClient(TSensorAppAckIndicationCallback cb)
Register a callback function for the SensorAppAckData Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:2435
bool ClearRtcAlarm(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Clears pending RTC Alarms of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:876
bool SetSensorAppConfig(const TWiMODLR_SensorApp_Config *config, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to configure the integrated Sensor App feature of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:2327
void(* TSensorAppAckIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_SensorApp.h:84
bool SetOperationMode(const TWiMOD_OperationMode opMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current operation mode of the WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:645
void(* TRadioLinkCDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:124
void end(void)
De-Setup internal things.
Definition: WiMODLR_BASE_PLUS.cpp:126
Structure containing basic information about the WiMOD device.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:172
TWiMODLRResultCodes GetLastHciResult(void)
Gets the value of the last local HCI TX status.
Definition: WiMODLR_BASE_PLUS.cpp:1874
Implementation for the ServiceAccessPoint RadioLink (LR-Base firmware only)
Definition: WiMOD_SAP_RemoteCtrl.h:96
void RegisterCDataTxClient(TRadioLinkCDataTxIndicationCallback cb)
Register a callback function for the TX C-Data Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:1654
void(* TSensorAppSensorDataIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_SensorApp.h:87
bool GetAesKey(UINT8 *key, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the used security 128bit AES key.
Definition: WiMODLR_BASE_PLUS.cpp:750
Main class representing the interface to the WiMOD running the firmware WiMODLR-BASE_PLUS.
Definition: WiMODLR_BASE_PLUS.h:103
WiMOD_SAP_Generic SapGeneric
Definition: WiMODLR_BASE_PLUS.h:224
~WiMODLRBASE_PLUS(void)
Destructor.
Definition: WiMODLR_BASE_PLUS.cpp:94
bool StartRadioLinkTest(const TWiMODLR_RLT_Parameter *params, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to start the integrated Radio Link Test feature of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:2066
void(* TRadioLinkAckRxTimeoutIndicationCallback)(void)
Definition: WiMOD_SAP_RadioLink.h:133
TWiMODLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
bool Reset(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Reset Cmd - Do a local reboot of the WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:223
uint32_t calcRegisterToFreq(uint8_t msb, uint8_t mid, uint8_t lsb)
Convert a frequency registers to frequency in Hz.
Definition: WiMODLR_BASE_PLUS.cpp:1825
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RemoteCtrl_IDs.h:86
HCI Configuration Parameters.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:519
void RegisterUDataTxClient(TRadioLinkUDataTxIndicationCallback cb)
Register a callback function for the TX U-Data Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:1539
Implementation for the ServiceAccessPoint SensorApp (LR-Base_PLUS firmware only)
Definition: WiMOD_SAP_SensorApp.h:101
void(* TDevMgmtRtcAlarmCallback)(void)
Definition: WiMOD_SAP_DEVMGMT.h:96
void(* TDevMgmtPowerUpCallback)(void)
Definition: WiMOD_SAP_DEVMGMT.h:93
Structure containing information about a U-Data indication (TX only)
Definition: WiMOD_SAP_RadioLink_IDs.h:232
bool SetRadioMode(const TRadioCfg_RadioMode radioMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
SetRadioMode - Set the current radio mode of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:673
bool ResetRadioConfig(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Resets the current configuration to defaults.
Definition: WiMODLR_BASE_PLUS.cpp:563
bool SendCData(const TWiMODLR_RadioLink_Msg *txMsg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to send transmit C-Data to peer module via RF link.
Definition: WiMODLR_BASE_PLUS.cpp:1153
WiMOD_SAP_SensorApp SapSensor
Definition: WiMODLR_BASE_PLUS.h:226
void begin(void)
Setup internal things.
Definition: WiMODLR_BASE_PLUS.cpp:117
void RegisterRtcAlarmIndicationClient(TDevMgmtRtcAlarmCallback cb)
Register a callback function for the RTC Alarm Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:952
bool GetOperationMode(TWiMOD_OperationMode *opMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current operation mode of the WiMOD module.
Definition: WiMODLR_BASE_PLUS.cpp:604
Implementation for the ServiceAccessPoint DeviceManagement.
Definition: WiMOD_SAP_DEVMGMT_PLUS.h:54
void RegisterAckRxClient(TRadioLinkAckRxIndicationCallback cb)
Register a callback function for the RX Ack (+data) Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:1702
bool GetRtcAlarm(TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets information about the RTC alarm feature of the WiMOD.
Definition: WiMODLR_BASE_PLUS.cpp:847
Structure containing information about a C-Data indication (TX only)
Definition: WiMOD_SAP_RadioLink_IDs.h:221
Implementation for the ServiceAccessPoint RadioLink (LR-Base firmware only)
Definition: WiMOD_SAP_RadioLink.h:151
void(* TRadioLinkAckTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:136
WiMOD_SAP_RLT SapRLT
Definition: WiMODLR_BASE_PLUS.h:225
void(* TRltStatusIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RLT.h:80
void(* TRadioLinkUDataTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:118
void RegisterUDataRxClient(TRadioLinkUDataRxIndicationCallback cb)
Register a callback function for the RX U-Data Indication - optional -.
Definition: WiMODLR_BASE_PLUS.cpp:1496