50 #include "ca821x_config.h"
61 #if CASCODA_CA_VER != 8210 && CASCODA_CA_VER != 8211 && CASCODA_CA_VER != 8212
62 #error "UNSUPPORTED CASCODA_CA_VER VERSION (or build incorrectly configured - use cmake)"
90 #if CASCODA_CA_VER >= 8211
91 PCPS_DATA_indication_callback PCPS_DATA_indication;
92 PCPS_DATA_confirm_callback PCPS_DATA_confirm;
95 #if CASCODA_CA_VER >= 8212
96 MLME_POLL_confirm_callback MLME_POLL_confirm;
97 MLME_IE_NOTIFY_indication_callback MLME_IE_NOTIFY_indication;
138 #if CASCODA_CA_VER == 8210
147 #if CASCODA_MAC_BLACKLIST != 0
153 struct MacAddr blacklist[CASCODA_MAC_BLACKLIST];
162 #if CASCODA_CA_VER >= 8212
190 uint8_t HeaderIELength,
191 uint8_t PayloadIELength,
196 uint32_t SchTimestamp,
199 uint8_t *pHeaderIEList,
200 uint8_t *pPayloadIEList,
242 #if CASCODA_CA_VER >= 8212
264 uint32_t SchTimestamp,
303 uint8_t CapabilityInfo,
321 uint16_t AssocShortAddress,
340 uint8_t DisassociateReason,
359 uint8_t PIBAttributeIndex,
360 uint8_t *pPIBAttributeLength,
361 void *pPIBAttributeValue,
378 uint16_t ShortAddress,
379 uint8_t AssociatedMember,
409 uint32_t RxOnDuration,
426 uint32_t ScanChannels,
427 uint8_t ScanDuration,
445 uint8_t PIBAttributeIndex,
446 uint8_t PIBAttributeLength,
447 const void *pPIBAttributeValue,
471 uint8_t LogicalChannel,
473 uint8_t SuperframeOrder,
474 uint8_t PANCoordinator,
475 uint8_t BatteryLifeExtension,
476 uint8_t CoordRealignment,
477 struct SecSpec *pCoordRealignSecurity,
478 struct SecSpec *pBeaconSecurity,
481 #if CASCODA_CA_VER >= 8212
496 uint8_t FrameVersion,
499 #elif CASCODA_CA_VER == 8211
550 uint8_t HWAttributeLength,
551 uint8_t *pHWAttributeValue,
567 uint8_t *HWAttributeLength,
568 uint8_t *pHWAttributeValue,
647 uint8_t TestAttributeLength,
648 void *pTestAttributeValue,
665 uint8_t *TestPacketSequenceNumber,
666 uint8_t *TestPacketLength,
667 void *pTestPacketData,
686 uint8_t *TestLOFDACValue,
687 uint8_t *TestLOAMPValue,
688 uint8_t *TestLOTXCALValue,
Functions to help converting between system types and big/little endian octet representations.
Global error declarations for use across the Cascoda SDK.
Declarations of global, platform independent logging functions that can be enabled or disabled.
Definitions relating to EVBME API messages.
ca_error ca821x_api_downstream(const uint8_t *buf, uint8_t *response, struct ca821x_dev *pDeviceRef)
Function for downstream api interface.
Definition: cascoda_dispatch.c:559
uint8_t ca821x_get_sync_response_id(uint8_t cmdid)
Function to get the command ID for the synchronous response to a sync command.
Definition: ca821x_api.c:73
ca_mac_status TDME_GETSFR_request_sync(uint8_t SFRPage, uint8_t SFRAddress, uint8_t *SFRValue, struct ca821x_dev *pDeviceRef)
TDME_GETSFR_request/confirm according to API Spec.
Definition: ca821x_api.c:956
ca_mac_status MLME_POLL_request_sync(struct FullAddr CoordAddress, uint8_t Interval[2], struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
MLME_POLL_request/confirm according to CA8210 API Spec.
uint8_t TDME_tx_dbm_to_paib(int8_t txpdbm)
Function to convert transmit power in dBm to PA current setting.
Definition: ca821x_api.c:1332
ca_mac_status MLME_ASSOCIATE_request(uint8_t LogicalChannel, struct FullAddr DstAddr, uint8_t CapabilityInfo, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
MLME_ASSOCIATE_request according to API Spec.
Definition: ca821x_api.c:384
ca_mac_status TDME_CheckPIBAttribute(uint8_t PIBAttribute, uint8_t PIBAttributeLength, const void *pPIBAttributeValue)
Checks Attribute Values that are not checked in MAC.
Definition: ca821x_api.c:1228
ca_mac_status MLME_START_request_sync(uint16_t PANId, uint8_t LogicalChannel, uint8_t BeaconOrder, uint8_t SuperframeOrder, uint8_t PANCoordinator, uint8_t BatteryLifeExtension, uint8_t CoordRealignment, struct SecSpec *pCoordRealignSecurity, struct SecSpec *pBeaconSecurity, struct ca821x_dev *pDeviceRef)
MLME_START_request/confirm according to API Spec.
Definition: ca821x_api.c:699
ca_mac_status TDME_GetTxPower(uint8_t *txp, struct ca821x_dev *pDeviceRef)
Returns the tx power for MLME_GET phyTransmitPower.
Definition: ca821x_api.c:1429
ca_mac_status HWME_HAES_request_sync(uint8_t HAESMode, uint8_t *pHAESData, struct ca821x_dev *pDeviceRef)
HWME_HAES_request/confirm according to API Spec.
Definition: ca821x_api.c:903
ca_error ca821x_upstream_dispatch(struct MAC_Message *msg, struct ca821x_dev *pDeviceRef)
Call the relevant callback routine if populated or the generic_dispatch for a received command.
Definition: ca821x_api.c:1724
const char * ca821x_get_version_nodate(void)
Function to get the version string without the compile date.
ca_mac_status TDME_TXPKT_request_sync(uint8_t TestPacketDataType, uint8_t *TestPacketSequenceNumber, uint8_t *TestPacketLength, void *pTestPacketData, struct ca821x_dev *pDeviceRef)
TDME_TXPKT_request/confirm according to API Spec.
Definition: ca821x_api.c:1034
ca_mac_status PCPS_DATA_request(uint8_t PsduHandle, uint8_t TxOpts, uint8_t PsduLength, uint8_t *pPsdu, struct ca821x_dev *pDeviceRef)
PCPS_DATA_request (Send Data) according to API Spec.
ca_mac_status MLME_RX_ENABLE_request_sync(uint8_t DeferPermit, uint32_t RxOnTime, uint32_t RxOnDuration, struct ca821x_dev *pDeviceRef)
MLME_RX_ENABLE_request/confirm according to API Spec.
Definition: ca821x_api.c:582
ca_mac_status MLME_ORPHAN_response(uint8_t *pOrphanAddress, uint16_t ShortAddress, uint8_t AssociatedMember, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
MLME_ORPHAN_response according to API Spec.
Definition: ca821x_api.c:515
const char * ca821x_get_version(void)
Function to get the version string.
ca_mac_status MLME_DISASSOCIATE_request(struct FullAddr DevAddr, uint8_t DisassociateReason, uint8_t TxIndirect, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
MLME_DISASSOCIATE_request according to API Spec.
Definition: ca821x_api.c:446
ca_mac_status MLME_GET_request_sync(uint8_t PIBAttribute, uint8_t PIBAttributeIndex, uint8_t *pPIBAttributeLength, void *pPIBAttributeValue, struct ca821x_dev *pDeviceRef)
MLME_GET_request/confirm according to API Spec.
Definition: ca821x_api.c:476
ca_mac_status MCPS_DATA_request(uint8_t SrcAddrMode, struct FullAddr DstAddr, uint8_t MsduLength, uint8_t *pMsdu, uint8_t MsduHandle, uint8_t TxOptions, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
MCPS_DATA_request (Send Data) according to CA8211 API Spec.
Definition: ca821x_api.c:245
ca_mac_status TDME_SetTxPower(uint8_t txp, struct ca821x_dev *pDeviceRef)
Sets the tx power for MLME_SET phyTransmitPower.
Definition: ca821x_api.c:1393
ca_mac_status TDME_ChannelInit(uint8_t channel, struct ca821x_dev *pDeviceRef)
TDME Channel Register Default Initialisation Macro (Tx)
Definition: ca821x_api.c:1184
ca_mac_status TDME_ChipInit(struct ca821x_dev *pDeviceRef)
TDME Chip Register Default Initialisation Macro.
Definition: ca821x_api.c:1119
int8_t TDME_tx_paib_to_dbm(uint8_t paib)
Function to convert PA current setting to transmit power in dBm.
Definition: ca821x_api.c:1363
ca_mac_status MLME_RESET_request_sync(uint8_t SetDefaultPIB, struct ca821x_dev *pDeviceRef)
MLME_RESET_request/confirm according to API Spec.
Definition: ca821x_api.c:546
union ca821x_api_callback * ca821x_get_callback(uint8_t cmdid, struct ca821x_dev *pDeviceRef)
Function to get a reference to the callback for a certain command ID.
Definition: ca821x_api.c:1580
ca_mac_status TDME_TESTMODE_request_sync(uint8_t TestMode, struct ca821x_dev *pDeviceRef)
TDME_TESTMODE_request/confirm according to API Spec.
Definition: ca821x_api.c:984
ca_mac_status MLME_SET_request_sync(uint8_t PIBAttribute, uint8_t PIBAttributeIndex, uint8_t PIBAttributeLength, const void *pPIBAttributeValue, struct ca821x_dev *pDeviceRef)
MLME_SET_request/confirm according to API Spec.
Definition: ca821x_api.c:650
ca_mac_status MCPS_PURGE_request_sync(uint8_t *MsduHandle, struct ca821x_dev *pDeviceRef)
MCPS_PURGE_request/confirm according to API Spec.
Definition: ca821x_api.c:285
ca_mac_status TDME_LOTLK_request_sync(uint8_t *TestChannel, uint8_t *TestRxTxb, uint8_t *TestLOFDACValue, uint8_t *TestLOAMPValue, uint8_t *TestLOTXCALValue, struct ca821x_dev *pDeviceRef)
TDME_LOTLK_request/confirm according to API Spec.
Definition: ca821x_api.c:1081
ca_mac_status HWME_GET_request_sync(uint8_t HWAttribute, uint8_t *HWAttributeLength, uint8_t *pHWAttributeValue, struct ca821x_dev *pDeviceRef)
HWME_GET_request/confirm according to API Spec.
Definition: ca821x_api.c:872
ca_mac_status TDME_SETSFR_request_sync(uint8_t SFRPage, uint8_t SFRAddress, uint8_t SFRValue, struct ca821x_dev *pDeviceRef)
TDME_SETSFR_request/confirm according to API Spec.
Definition: ca821x_api.c:929
ca_mac_status MLME_SCAN_request(uint8_t ScanType, uint32_t ScanChannels, uint8_t ScanDuration, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
MLME_SCAN_request according to API Spec.
Definition: ca821x_api.c:617
ca_mac_status TDME_SET_request_sync(uint8_t TestAttribute, uint8_t TestAttributeLength, void *pTestAttributeValue, struct ca821x_dev *pDeviceRef)
TDME_SET_request/confirm according to API Spec.
Definition: ca821x_api.c:1006
ca_mac_status MLME_ASSOCIATE_response(uint8_t *pDeviceAddress, uint16_t AssocShortAddress, uint8_t Status, struct SecSpec *pSecurity, struct ca821x_dev *pDeviceRef)
MLME_ASSOCIATE_response according to API Spec.
Definition: ca821x_api.c:415
ca_mac_status HWME_SET_request_sync(uint8_t HWAttribute, uint8_t HWAttributeLength, uint8_t *pHWAttributeValue, struct ca821x_dev *pDeviceRef)
HWME_SET_request/confirm according to API Spec.
Definition: ca821x_api.c:840
ca_error ca821x_api_init(struct ca821x_dev *pDeviceRef)
Initialisation function for initialising a ca821x_dev data structure for use with the API.
Definition: ca821x_api.c:134
ca_error
Cascoda error type.
Definition: ca821x_error.h:51
lqi_mode
Potential values of HWME_LQIMODE.
Definition: hwme_tdme.h:77
enum mac_status ca_mac_status
MAC Status Codes (see 802.15.4 2006 spec table 78)
ca_error(* MLME_SYNC_LOSS_indication_callback)(struct MLME_SYNC_LOSS_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:945
ca_error(* TDME_RXPKT_indication_callback)(struct TDME_RXPKT_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:963
ca_error(* MLME_ASSOCIATE_indication_callback)(struct MLME_ASSOCIATE_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:931
ca_error(* TDME_ERROR_indication_callback)(struct TDME_ERROR_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:967
ca_error(* MCPS_DATA_confirm_callback)(struct MCPS_DATA_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:957
ca_error(* MCPS_DATA_indication_callback)(struct MCPS_DATA_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:955
ca_error(* MLME_COMM_STATUS_indication_callback)(struct MLME_COMM_STATUS_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:943
ca_error(* HWME_WAKEUP_indication_callback)(struct HWME_WAKEUP_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:929
ca_error(* MLME_DISASSOCIATE_indication_callback)(struct MLME_DISASSOCIATE_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:935
ca_error(* TDME_EDDET_indication_callback)(struct TDME_EDDET_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:965
ca_error(* MLME_POLL_indication_callback)(struct MLME_POLL_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:947
ca_error(* MLME_BEACON_NOTIFY_indication_callback)(struct MLME_BEACON_NOTIFY_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:939
ca_error(* MLME_ORPHAN_indication_callback)(struct MLME_ORPHAN_indication_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:941
ca_error(* MLME_SCAN_confirm_callback)(struct MLME_SCAN_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:954
ca_error(* MLME_DISASSOCIATE_confirm_callback)(struct MLME_DISASSOCIATE_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:937
ca_error(* MLME_ASSOCIATE_confirm_callback)(struct MLME_ASSOCIATE_confirm_pset *params, struct ca821x_dev *pDeviceRef)
Definition: mac_messages.h:933
Definitions relating to MLME and MCPS API messages.
uint8_t channel
Channel we are sniffing on.
Definition: sniffer.c:200
Contains full addressing information for a node.
Definition: mac_messages.h:63
SPI Message Format Typedef.
Definition: mac_messages.h:1017
Holds either short or extended address.
Definition: mac_messages.h:83
Security specification to be applied to MAC frames.
Definition: mac_messages.h:90
API user callbacks structure.
Definition: ca821x_api.h:87
MLME_ASSOCIATE_confirm_callback MLME_ASSOCIATE_confirm
Definition: ca821x_api.h:100
TDME_RXPKT_indication_callback TDME_RXPKT_indication
Definition: ca821x_api.h:109
TDME_EDDET_indication_callback TDME_EDDET_indication
Definition: ca821x_api.h:110
MLME_COMM_STATUS_indication_callback MLME_COMM_STATUS_indication
Definition: ca821x_api.h:106
TDME_ERROR_indication_callback TDME_ERROR_indication
Definition: ca821x_api.h:111
MCPS_DATA_indication_callback MCPS_DATA_indication
Definition: ca821x_api.h:88
MLME_DISASSOCIATE_confirm_callback MLME_DISASSOCIATE_confirm
Definition: ca821x_api.h:102
MCPS_DATA_confirm_callback MCPS_DATA_confirm
Definition: ca821x_api.h:89
MLME_SYNC_LOSS_indication_callback MLME_SYNC_LOSS_indication
Definition: ca821x_api.h:107
MLME_ASSOCIATE_indication_callback MLME_ASSOCIATE_indication
Definition: ca821x_api.h:99
HWME_WAKEUP_indication_callback HWME_WAKEUP_indication
Definition: ca821x_api.h:108
MLME_ORPHAN_indication_callback MLME_ORPHAN_indication
Definition: ca821x_api.h:104
MLME_BEACON_NOTIFY_indication_callback MLME_BEACON_NOTIFY_indication
Definition: ca821x_api.h:103
ca_error(* generic_dispatch)(const struct MAC_Message *msg, struct ca821x_dev *pDeviceRef)
Definition: ca821x_api.h:112
MLME_SCAN_confirm_callback MLME_SCAN_confirm
Definition: ca821x_api.h:105
MLME_DISASSOCIATE_indication_callback MLME_DISASSOCIATE_indication
Definition: ca821x_api.h:101
CA-821x Device reference struct.
Definition: ca821x_api.h:123
struct ca821x_api_callbacks callbacks
Callback routines registered by the user, to be called by the api for upstream commands.
Definition: ca821x_api.h:136
void * context
Context pointer for free use by the application.
Definition: ca821x_api.h:129
uint8_t MAC_MPW
Flag to enable workarounds for ca8210 v0.x.
Definition: ca821x_api.h:145
void * exchange_context
Context for free use by the exchange (internal to the cascoda stack)
Definition: ca821x_api.h:133
Union of all compatible callback types.
Definition: mac_messages.h:973