 |
Demo HCI Implementation for WiMOD-LR Devices
V2.0.3
|
Go to the documentation of this file.
44 #ifndef WIMODLR_BASE_H_
45 #define WIMODLR_BASE_H_
58 #include "utils/WMDefs.h"
66 #include "SAP/WiMOD_SAP_HWTest.h"
73 #ifdef WIMOD_USE_CPP11
80 #define WIMOD_LR_BASE_SERIAL_BAUDRATE 115200
82 #define WiMOD_LR_BASE_TX_BUFFER_SIZE 100
89 #ifdef WIMOD_USE_CPP11
205 bool copyResultInfos(
TWiMODLRResultCodes* hciResult, UINT8* rspStatus, UINT8 successValue);
216 UINT8 txBuffer[WiMOD_LR_BASE_TX_BUFFER_SIZE];
218 UINT8 localStatusRsp;
Implementation for the ServiceAccessPoint DeviceManagement.
Definition: WiMOD_SAP_Generic.h:78
bool Reset(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Reset Cmd - Do a local reboot of the WiMOD module.
Definition: WiMODLR_BASE.cpp:220
void(* TDataLinkSendUdataIndClient)(UINT8 status)
Definition: WiMODLR_BASE.h:105
bool SetRadioConfig(const TWiMODLR_DevMgmt_RadioConfig *radioCfg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current configuration for the radio of the WiMOD module.
Definition: WiMODLR_BASE.cpp:521
bool GetRadioConfig(TWiMODLR_DevMgmt_RadioConfig *radioCfg, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current configuration of the radio of the WiMOD module.
Definition: WiMODLR_BASE.cpp:471
UINT8 GetLastResponseStatus(void)
Gets the value of the last status response value of the WiMOD.
Definition: WiMODLR_BASE.cpp:1838
~WiMODLRBASE(void)
Destructor.
Definition: WiMODLR_BASE.cpp:88
bool Ping(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Ping Cmd - Checks serial connetion to WiMOD module.
Definition: WiMODLR_BASE.cpp:187
Implementation for the ServiceAccessPoint DeviceManagement.
Definition: WiMOD_SAP_DEVMGMT.h:109
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:235
void(* TRadioLinkUDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:115
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.cpp:796
void RegisterUDataTxClient(TRadioLinkUDataTxIndicationCallback cb)
Register a callback function for the TX U-Data Indication - optional -.
Definition: WiMODLR_BASE.cpp:1460
WiMODLRBASE(Stream &s)
Constructor.
Definition: WiMODLR_BASE.cpp:69
void RegisterCDataTxClient(TRadioLinkCDataTxIndicationCallback cb)
Register a callback function for the TX C-Data Indication - optional -.
Definition: WiMODLR_BASE.cpp:1575
WiMOD_SAP_DevMgmt SapDevMgmt
Definition: WiMODLR_BASE.h:210
bool SetRtc(const UINT32 rtcTime, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current RTC values to WiMOD module.
Definition: WiMODLR_BASE.cpp:425
void RegisterUDataRxClient(TRadioLinkUDataRxIndicationCallback cb)
Register a callback function for the RX U-Data Indication - optional -.
Definition: WiMODLR_BASE.cpp:1418
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.cpp:259
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
void RegisterRtcAlarmIndicationClient(TDevMgmtRtcAlarmCallback cb)
Register a callback function for the RTC Alarm Indication - optional -.
Definition: WiMODLR_BASE.cpp:947
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
bool SetRadioMode(const TRadioCfg_RadioMode radioMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
SetRadioMode - Set the current radio mode of the WiMOD.
Definition: WiMODLR_BASE.cpp:583
bool GetOperationMode(TWiMOD_OperationMode *opMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current operation mode of the WiMOD module.
Definition: WiMODLR_BASE.cpp:625
void RegisterPowerUpIndicationClient(TDevMgmtPowerUpCallback cb)
Register a callback function for the PowerUp Indication - optional -.
Definition: WiMODLR_BASE.cpp:910
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 convert(TWiMODLR_HCIMessage &RxMsg, TWiMODLR_RadioLink_Msg *radioLinkMsg)
Convert a received low level HCI-Msg to a high-level RadioLink-Msg.
Definition: WiMODLR_BASE.cpp:1129
Main class representing the interface to the WiMOD running the firmware WiMODLR-BASE.
Definition: WiMODLR_BASE.h:122
void(* TDataLinkRxUDataIndClient)(UINT8 *data, UINT16 length)
Definition: WiMODLR_BASE.h:102
void(* TRadioLinkRawDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:121
WiMOD_SAP_RadioLink SapRadioLink
Definition: WiMODLR_BASE.h:211
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.cpp:1002
void(* TRadioLinkCDataTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:127
void end(void)
De-Setup internal things.
Definition: WiMODLR_BASE.cpp:122
TRadioCfg_RadioMode
general operation mode of the radio part (only for LR-BASE)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:255
void RegisterAckRxTimeoutClient(TRadioLinkAckRxTimeoutIndicationCallback cb)
Register a callback function for the Ack Timeout Indication - optional -.
Definition: WiMODLR_BASE.cpp:1671
bool GetRtc(UINT32 *rtcTime, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current RTC data info from WiMOD module.
Definition: WiMODLR_BASE.cpp:386
bool GetFirmwareInfo(TWiMODLR_DevMgmt_FwInfo *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the basic FirmwareInfo from WiMOD module.
Definition: WiMODLR_BASE.cpp:298
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.cpp:703
bool GetAesKey(UINT8 *key, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the used security 128bit AES key.
Definition: WiMODLR_BASE.cpp:742
void(* TRadioLinkCDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:124
bool GetSystemStatus(TWiMODLR_DevMgmt_SystemStatus *info, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the bas SystemStatus info from WiMOD module.
Definition: WiMODLR_BASE.cpp:339
Structure containing basic information about the WiMOD device.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:172
uint32_t calcRegisterToFreq(uint8_t msb, uint8_t mid, uint8_t lsb)
Convert a frequency registers to frequency in Hz.
Definition: WiMODLR_BASE.cpp:1747
void RegisterCDataRxClient(TRadioLinkCDataRxIndicationCallback cb)
Register a callback function for the RX C-Data Indication - optional -.
Definition: WiMODLR_BASE.cpp:1528
void RegisterAckRxClient(TRadioLinkAckRxIndicationCallback cb)
Register a callback function for the RX Ack (+data) Indication - optional -.
Definition: WiMODLR_BASE.cpp:1623
void begin(void)
Setup internal things.
Definition: WiMODLR_BASE.cpp:111
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.cpp:1368
WiMOD_SAP_Generic SapGeneric
Definition: WiMODLR_BASE.h:212
bool ClearRtcAlarm(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Clears pending RTC Alarms of the WiMOD.
Definition: WiMODLR_BASE.cpp:868
void(* TRadioLinkAckRxTimeoutIndicationCallback)(void)
Definition: WiMOD_SAP_RadioLink.h:133
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.cpp:1731
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.cpp:1064
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.cpp:1898
TWiMODLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
bool SetOperationMode(const TWiMOD_OperationMode opMode, TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current operation mode of the WiMOD module.
Definition: WiMODLR_BASE.cpp:666
bool ResetRadioConfig(TWiMODLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Resets the current configuration to defaults.
Definition: WiMODLR_BASE.cpp:556
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
Structure containing the radio (stack) config parameters of the WiMOD (only for LR-BASE)
Definition: WiMOD_SAP_DEVMGMT_IDs.h:406
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.cpp:839
Basic information about system status of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:234
TWiMODLRResultCodes GetLastHciResult(void)
Gets the value of the last local HCI TX status.
Definition: WiMODLR_BASE.cpp:1793
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
void RegisterAckTxCallback(TRadioLinkAckTxIndicationCallback cb)
Register a callback function for the TX Ack Indication - optional -.
Definition: WiMODLR_BASE.cpp:1715
void(* TRadioLinkUDataTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:118