44 #ifndef WIMODLR_BASE_H_ 45 #define WIMODLR_BASE_H_ 53 #include "utils/WMDefs.h" 54 #include "utils/ComSLIP.h" 60 #include "SAP/WiMOD_SAP_HWTest.h" 62 #include "utils/FreqCalc.h" 68 #ifdef WIMOD_USE_CPP11 75 #define WIMOD_LR_BASE_SERIAL_BAUDRATE 115200 77 #define WiMOD_LR_BASE_TX_BUFFER_SIZE 100 84 #ifdef WIMOD_USE_CPP11 200 UINT8 txBuffer[WiMOD_LR_BASE_TX_BUFFER_SIZE];
202 UINT8 localStatusRsp;
bool GetDeviceInfo(TWiMODLR_DevMgmt_DevInfo *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the basic DeviceInfo from WiMOD module.
Definition: WiMODLR_BASE.cpp:259
Basic information about system status of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:208
bool GetSystemStatus(TWiMODLR_DevMgmt_SystemStatus *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the bas SystemStatus info from WiMOD module.
Definition: WiMODLR_BASE.cpp:339
Declarations for the RadioLink SericeAccessPoint.
Structure containing information about a C-Data indication (TX only)
Definition: WiMOD_SAP_RadioLink_IDs.h:179
bool GetFirmwareInfo(TWiMODLR_DevMgmt_FwInfo *info, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the basic FirmwareInfo from WiMOD module.
Definition: WiMODLR_BASE.cpp:298
void(* TRadioLinkAckRxTimeoutIndicationCallback)(void)
Definition: WiMOD_SAP_RadioLink.h:133
void RegisterAckTxCallback(TRadioLinkAckTxIndicationCallback cb)
Register a callback function for the TX Ack Indication - optional -.
Definition: WiMODLR_BASE.cpp:1610
void(* TRadioLinkCDataTxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:127
TWiMDLRResultCodes
Result codes for the local serial communication itself.
Definition: WiMODLRHCI.h:149
void(* TDevMgmtRtcAlarmCallback)(void)
Definition: WiMOD_SAP_DEVMGMT.h:96
bool Reset(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Reset Cmd - Do a local reboot of the WiMOD module.
Definition: WiMODLR_BASE.cpp:220
void RegisterRtcAlarmIndicationClient(TDevMgmtRtcAlarmCallback cb)
Register a callback function for the RTC Alarm Indication - optional -.
Definition: WiMODLR_BASE.cpp:918
void end(void)
De-Setup internal things.
Definition: WiMODLR_BASE.cpp:122
bool SetRtc(const UINT32 rtcTime, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current RTC values to WiMOD module.
Definition: WiMODLR_BASE.cpp:425
basic low level HCI message structure used for all serial messages to/from WiMOD
Definition: WiMODLRHCI.h:120
void RegisterCDataTxClient(TRadioLinkCDataTxIndicationCallback cb)
Register a callback function for the TX C-Data Indication - optional -.
Definition: WiMODLR_BASE.cpp:1470
Declarations for the DeviceManagement SericeAccessPoint.
Internal helper class for processing SLIP frames.
Definition: WiMODLRHCI.h:229
void RegisterAckRxClient(TRadioLinkAckRxIndicationCallback cb)
Register a callback function for the RX Ack (+data) Indication - optional -.
Definition: WiMODLR_BASE.cpp:1518
Common low level HCI message processing base.
WiMOD_SAP_RadioLink SapRadioLink
Definition: WiMODLR_BASE.h:196
TWiMOD_OperationMode
This enum describes the possible operation modes of the WiMOD (only for LR-BASE). ...
Definition: WiMOD_SAP_DEVMGMT_IDs.h:410
void(* TRadioLinkUDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:115
void begin(void)
Setup internal things.
Definition: WiMODLR_BASE.cpp:111
Implementation for the ServiceAccessPoint DeviceManagement.
Definition: WiMOD_SAP_DEVMGMT.h:109
bool GetRtcAlarm(TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets information about the RTC alarm feature of the WiMOD.
Definition: WiMODLR_BASE.cpp:810
bool SetAesKey(const UINT8 *key, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the security 128bit AES key to use for RF communication.
Definition: WiMODLR_BASE.cpp:674
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:1100
Structure containing information about an acknowledgment transmission.
Definition: WiMOD_SAP_RadioLink_IDs.h:189
Structure containing a general RadioLink HCI message.
Definition: WiMOD_SAP_RadioLink_IDs.h:148
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:1626
Structure containing the radio (stack) config parameters of the WiMOD (only for LR-BASE) ...
Definition: WiMOD_SAP_DEVMGMT_IDs.h:376
WiMOD_SAP_DevMgmt SapDevMgmt
Definition: WiMODLR_BASE.h:195
bool GetAesKey(UINT8 *key, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the used security 128bit AES key.
Definition: WiMODLR_BASE.cpp:713
Main class representing the interface to the WiMOD running the firmware WiMODLR-BASE.
Definition: WiMODLR_BASE.h:117
bool SendCData(const TWiMODLR_RadioLink_Msg *txMsg, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to send transmit C-Data to peer module via RF link.
Definition: WiMODLR_BASE.cpp:1035
Structure containing the RTC Alarm config parameters of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:452
Basic information about the current firmware of the WiMOD.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:194
~WiMODLRBASE(void)
Destructor.
Definition: WiMODLR_BASE.cpp:88
bool SetOperationMode(const TWiMOD_OperationMode opMode, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current operation mode of the WiMOD module.
Definition: WiMODLR_BASE.cpp:637
void RegisterPowerUpIndicationClient(TDevMgmtPowerUpCallback cb)
Register a callback function for the PowerUp Indication - optional -.
Definition: WiMODLR_BASE.cpp:881
uint32_t calcRegisterToFreq(uint8_t msb, uint8_t mid, uint8_t lsb)
Convert a frequency registers to frequency in Hz.
Definition: WiMODLR_BASE.cpp:1642
void(* TDataLinkSendUdataIndClient)(UINT8 status)
Definition: WiMODLR_BASE.h:100
bool ResetRadioConfig(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Resets the current configuration to defaults.
Definition: WiMODLR_BASE.cpp:556
bool copyResultInfos(TWiMDLRResultCodes *hciResult, UINT8 *rspStatus, UINT8 successValue)
Definition: WiMODLR_BASE.cpp:1816
bool GetRtc(UINT32 *rtcTime, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current RTC data info from WiMOD module.
Definition: WiMODLR_BASE.cpp:386
Implementation for the ServiceAccessPoint RadioLink (LR-Base firmware only)
Definition: WiMOD_SAP_RadioLink.h:151
bool SendUData(const TWiMODLR_RadioLink_Msg *txMsg, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Tries to send transmit U-Data to peer module via RF link.
Definition: WiMODLR_BASE.cpp:973
void(* TRadioLinkUDataTxIndicationCallback)(void)
Definition: WiMOD_SAP_RadioLink.h:118
bool SetRtcAlarm(const TWiMODLR_DevMgmt_RtcAlarm *rtcAlarm, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets and enables the RTC alarm feature of the WiMOD.
Definition: WiMODLR_BASE.cpp:767
void RegisterCDataRxClient(TRadioLinkCDataRxIndicationCallback cb)
Register a callback function for the RX C-Data Indication - optional -.
Definition: WiMODLR_BASE.cpp:1423
bool ClearRtcAlarm(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Clears pending RTC Alarms of the WiMOD.
Definition: WiMODLR_BASE.cpp:839
WiMODLRBASE(Stream &s)
Constructor.
Definition: WiMODLR_BASE.cpp:70
bool GetRadioConfig(TWiMODLR_DevMgmt_RadioConfig *radioCfg, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current configuration of the radio of the WiMOD module.
Definition: WiMODLR_BASE.cpp:471
TWiMDLRResultCodes GetLastHciResult(void)
Gets the value of the last local HCI TX status.
Definition: WiMODLR_BASE.cpp:1688
void(* TRadioLinkRawDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:121
UINT8 GetLastResponseStatus(void)
Gets the value of the last status response value of the WiMOD.
Definition: WiMODLR_BASE.cpp:1733
void RegisterUDataRxClient(TRadioLinkUDataRxIndicationCallback cb)
Register a callback function for the RX U-Data Indication - optional -.
Definition: WiMODLR_BASE.cpp:1317
bool SetAckData(const TWiMODLR_RadioLink_Msg *txMsg, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets additional user payload for the next ack frame to send.
Definition: WiMODLR_BASE.cpp:1267
void(* TRadioLinkAckTxIndicationCallback)(void)
Definition: WiMOD_SAP_RadioLink.h:136
void(* TDataLinkRxUDataIndClient)(UINT8 *data, UINT16 length)
Definition: WiMODLR_BASE.h:97
void RegisterAckRxTimeoutClient(TRadioLinkAckRxTimeoutIndicationCallback cb)
Register a callback function for the Ack Timeout Indication - optional -.
Definition: WiMODLR_BASE.cpp:1566
Structure containing basic information about the WiMOD device.
Definition: WiMOD_SAP_DEVMGMT_IDs.h:156
void(* TRadioLinkAckRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:130
bool GetOperationMode(TWiMOD_OperationMode *opMode, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Gets the current operation mode of the WiMOD module.
Definition: WiMODLR_BASE.cpp:596
void(* TDevMgmtPowerUpCallback)(void)
Definition: WiMOD_SAP_DEVMGMT.h:93
void(* TRadioLinkCDataRxIndicationCallback)(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMOD_SAP_RadioLink.h:124
virtual void ProcessUnexpectedRxMessage(TWiMODLR_HCIMessage &rxMsg)
Definition: WiMODLR_BASE.cpp:1773
void RegisterUDataTxClient(TRadioLinkUDataTxIndicationCallback cb)
Register a callback function for the TX U-Data Indication - optional -.
Definition: WiMODLR_BASE.cpp:1359
bool SetRadioConfig(const TWiMODLR_DevMgmt_RadioConfig *radioCfg, TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Sets the current configuration for the radio of the WiMOD module.
Definition: WiMODLR_BASE.cpp:521
bool Ping(TWiMDLRResultCodes *hciResult=NULL, UINT8 *rspStatus=NULL)
Ping Cmd - Checks serial connetion to WiMOD module.
Definition: WiMODLR_BASE.cpp:187