Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
ca821x_api.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, Cascoda Ltd.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. Neither the name of the copyright holder nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
43 #ifndef CA821X_API_H
44 #define CA821X_API_H
45 
46 #include <stdbool.h>
47 #include <stddef.h>
48 #include <stdint.h>
49 
50 #include "ca821x_config.h"
51 #include "ca821x_endian.h"
52 #include "ca821x_error.h"
53 #include "ca821x_log.h"
54 #include "evbme_messages.h"
55 #include "mac_messages.h"
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
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)"
63 #endif
64 
65 struct ca821x_dev;
66 
67 /******************************************************************************/
68 /****** External function pointers ******/
69 /******************************************************************************/
70 
71 /***************************************************************************/
87 {
90 #if CASCODA_CA_VER >= 8211
91  PCPS_DATA_indication_callback PCPS_DATA_indication;
92  PCPS_DATA_confirm_callback PCPS_DATA_confirm;
93  MLME_POLL_indication_callback MLME_POLL_indication;
94 #endif // CASCODA_CA_VER >= 8211
95 #if CASCODA_CA_VER >= 8212
96  MLME_POLL_confirm_callback MLME_POLL_confirm;
97  MLME_IE_NOTIFY_indication_callback MLME_IE_NOTIFY_indication;
98 #endif // CASCODA_CA_VER >= 8212
112  ca_error (*generic_dispatch)(const struct MAC_Message *msg, struct ca821x_dev *pDeviceRef);
113 };
114 
123 {
129  void *context;
134 
137 
138 #if CASCODA_CA_VER == 8210
139  uint8_t extaddr[8];
140  uint16_t shortaddr;
141  uint8_t lqi_mode;
142 #endif // CASCODA_CA_VER == 8210
143 
144  //MAC Workarounds for V1.1 and MPW silicon (V0.x)
145  uint8_t MAC_MPW;
147 #if CASCODA_MAC_BLACKLIST != 0
153  struct MacAddr blacklist[CASCODA_MAC_BLACKLIST];
154 
155 #endif
156 };
157 
158 /******************************************************************************/
159 /****** MAC MCPS/MLME Downlink ******/
160 /******************************************************************************/
161 
162 #if CASCODA_CA_VER >= 8212
163 /******************************************************************************/
164 /***************************************************************************/
188 ca_mac_status MCPS_DATA_request(uint8_t SrcAddrMode,
189  struct FullAddr DstAddr,
190  uint8_t HeaderIELength,
191  uint8_t PayloadIELength,
192  uint8_t MsduLength,
193  uint8_t *pMsdu,
194  uint8_t MsduHandle,
195  uint8_t *pTxOptions,
196  uint32_t SchTimestamp,
197  uint16_t SchPeriod,
198  uint8_t TxChannel,
199  uint8_t *pHeaderIEList,
200  uint8_t *pPayloadIEList,
201  struct SecSpec *pSecurity,
202  struct ca821x_dev *pDeviceRef);
203 #else
204 /******************************************************************************/
205 /***************************************************************************/
220 ca_mac_status MCPS_DATA_request(uint8_t SrcAddrMode,
221  struct FullAddr DstAddr,
222  uint8_t MsduLength,
223  uint8_t *pMsdu,
224  uint8_t MsduHandle,
225  uint8_t TxOptions,
226  struct SecSpec *pSecurity,
227  struct ca821x_dev *pDeviceRef);
228 #endif // CASCODA_CA_VER >= 8212
229 
230 /******************************************************************************/
231 /***************************************************************************/
240 ca_mac_status MCPS_PURGE_request_sync(uint8_t *MsduHandle, struct ca821x_dev *pDeviceRef);
241 
242 #if CASCODA_CA_VER >= 8212
243 /******************************************************************************/
244 /***************************************************************************/
260 ca_mac_status PCPS_DATA_request(uint8_t PsduHandle,
261  uint8_t TxOpts,
262  uint8_t PsduLength,
263  uint8_t *pPsdu,
264  uint32_t SchTimestamp,
265  uint16_t SchPeriod,
266  struct ca821x_dev *pDeviceRef);
267 #else
268 /******************************************************************************/
269 /***************************************************************************/
281 ca_mac_status PCPS_DATA_request(uint8_t PsduHandle,
282  uint8_t TxOpts,
283  uint8_t PsduLength,
284  uint8_t *pPsdu,
285  struct ca821x_dev *pDeviceRef);
286 #endif // CASCODA_CA_VER >= 8212
287 
288 /******************************************************************************/
289 /***************************************************************************/
301 ca_mac_status MLME_ASSOCIATE_request(uint8_t LogicalChannel,
302  struct FullAddr DstAddr,
303  uint8_t CapabilityInfo,
304  struct SecSpec *pSecurity,
305  struct ca821x_dev *pDeviceRef);
306 
307 /******************************************************************************/
308 /***************************************************************************/
320 ca_mac_status MLME_ASSOCIATE_response(uint8_t *pDeviceAddress,
321  uint16_t AssocShortAddress,
322  uint8_t Status,
323  struct SecSpec *pSecurity,
324  struct ca821x_dev *pDeviceRef);
325 
326 /******************************************************************************/
327 /***************************************************************************/
340  uint8_t DisassociateReason,
341  uint8_t TxIndirect,
342  struct SecSpec *pSecurity,
343  struct ca821x_dev *pDeviceRef);
344 
345 /******************************************************************************/
346 /***************************************************************************/
358 ca_mac_status MLME_GET_request_sync(uint8_t PIBAttribute,
359  uint8_t PIBAttributeIndex,
360  uint8_t *pPIBAttributeLength,
361  void *pPIBAttributeValue,
362  struct ca821x_dev *pDeviceRef);
363 
364 /******************************************************************************/
365 /***************************************************************************/
377 ca_mac_status MLME_ORPHAN_response(uint8_t *pOrphanAddress,
378  uint16_t ShortAddress,
379  uint8_t AssociatedMember,
380  struct SecSpec *pSecurity,
381  struct ca821x_dev *pDeviceRef);
382 
383 /******************************************************************************/
384 /***************************************************************************/
393 ca_mac_status MLME_RESET_request_sync(uint8_t SetDefaultPIB, struct ca821x_dev *pDeviceRef);
394 
395 /******************************************************************************/
396 /***************************************************************************/
407 ca_mac_status MLME_RX_ENABLE_request_sync(uint8_t DeferPermit,
408  uint32_t RxOnTime,
409  uint32_t RxOnDuration,
410  struct ca821x_dev *pDeviceRef);
411 
412 /******************************************************************************/
413 /***************************************************************************/
425 ca_mac_status MLME_SCAN_request(uint8_t ScanType,
426  uint32_t ScanChannels,
427  uint8_t ScanDuration,
428  struct SecSpec *pSecurity,
429  struct ca821x_dev *pDeviceRef);
430 
431 /******************************************************************************/
432 /***************************************************************************/
444 ca_mac_status MLME_SET_request_sync(uint8_t PIBAttribute,
445  uint8_t PIBAttributeIndex,
446  uint8_t PIBAttributeLength,
447  const void *pPIBAttributeValue,
448  struct ca821x_dev *pDeviceRef);
449 
450 /******************************************************************************/
451 /***************************************************************************/
471  uint8_t LogicalChannel,
472  uint8_t BeaconOrder,
473  uint8_t SuperframeOrder,
474  uint8_t PANCoordinator,
475  uint8_t BatteryLifeExtension,
476  uint8_t CoordRealignment,
477  struct SecSpec *pCoordRealignSecurity,
478  struct SecSpec *pBeaconSecurity,
479  struct ca821x_dev *pDeviceRef);
480 
481 #if CASCODA_CA_VER >= 8212
482 /******************************************************************************/
483 /***************************************************************************/
495 ca_mac_status MLME_POLL_request(struct FullAddr CoordAddress,
496  uint8_t FrameVersion,
497  struct SecSpec *pSecurity,
498  struct ca821x_dev *pDeviceRef);
499 #elif CASCODA_CA_VER == 8211
500 /******************************************************************************/
501 /***************************************************************************/
511 ca_mac_status MLME_POLL_request_sync(struct FullAddr CoordAddress,
512  struct SecSpec *pSecurity,
513  struct ca821x_dev *pDeviceRef);
514 #else
515 /******************************************************************************/
516 /***************************************************************************/
528  uint8_t Interval[2],
529  struct SecSpec *pSecurity,
530  struct ca821x_dev *pDeviceRef);
531 #endif // CASCODA_CA_VER >= 8212
532 
533 /******************************************************************************/
534 /****** HWME Downlink ******/
535 /******************************************************************************/
536 
537 /******************************************************************************/
538 /***************************************************************************/
549 ca_mac_status HWME_SET_request_sync(uint8_t HWAttribute,
550  uint8_t HWAttributeLength,
551  uint8_t *pHWAttributeValue,
552  struct ca821x_dev *pDeviceRef);
553 
554 /******************************************************************************/
555 /***************************************************************************/
566 ca_mac_status HWME_GET_request_sync(uint8_t HWAttribute,
567  uint8_t *HWAttributeLength,
568  uint8_t *pHWAttributeValue,
569  struct ca821x_dev *pDeviceRef);
570 
571 /******************************************************************************/
572 /***************************************************************************/
582 ca_mac_status HWME_HAES_request_sync(uint8_t HAESMode, uint8_t *pHAESData, struct ca821x_dev *pDeviceRef);
583 
584 /******************************************************************************/
585 /****** TDME Downlink ******/
586 /******************************************************************************/
587 
588 /******************************************************************************/
589 /***************************************************************************/
601  uint8_t SFRAddress,
602  uint8_t SFRValue,
603  struct ca821x_dev *pDeviceRef);
604 
605 /******************************************************************************/
606 /***************************************************************************/
618  uint8_t SFRAddress,
619  uint8_t *SFRValue,
620  struct ca821x_dev *pDeviceRef);
621 
622 /******************************************************************************/
623 /***************************************************************************/
632 ca_mac_status TDME_TESTMODE_request_sync(uint8_t TestMode, struct ca821x_dev *pDeviceRef);
633 
634 /******************************************************************************/
635 /***************************************************************************/
646 ca_mac_status TDME_SET_request_sync(uint8_t TestAttribute,
647  uint8_t TestAttributeLength,
648  void *pTestAttributeValue,
649  struct ca821x_dev *pDeviceRef);
650 
651 /******************************************************************************/
652 /***************************************************************************/
664 ca_mac_status TDME_TXPKT_request_sync(uint8_t TestPacketDataType,
665  uint8_t *TestPacketSequenceNumber,
666  uint8_t *TestPacketLength,
667  void *pTestPacketData,
668  struct ca821x_dev *pDeviceRef);
669 
670 /******************************************************************************/
671 /***************************************************************************/
684 ca_mac_status TDME_LOTLK_request_sync(uint8_t *TestChannel,
685  uint8_t *TestRxTxb,
686  uint8_t *TestLOFDACValue,
687  uint8_t *TestLOAMPValue,
688  uint8_t *TestLOTXCALValue,
689  struct ca821x_dev *pDeviceRef);
690 
691 /******************************************************************************/
692 /****** TDME Register Default Initialisation and Checking Functions ******/
693 /******************************************************************************/
694 
695 /******************************************************************************/
696 /***************************************************************************/
704 ca_mac_status TDME_ChipInit(struct ca821x_dev *pDeviceRef);
705 
706 /******************************************************************************/
707 /***************************************************************************/
716 ca_mac_status TDME_ChannelInit(uint8_t channel, struct ca821x_dev *pDeviceRef);
717 
718 /******************************************************************************/
719 /***************************************************************************/
729 ca_mac_status TDME_CheckPIBAttribute(uint8_t PIBAttribute, uint8_t PIBAttributeLength, const void *pPIBAttributeValue);
730 
731 /******************************************************************************/
732 /***************************************************************************/
745 ca_mac_status TDME_SetTxPower(uint8_t txp, struct ca821x_dev *pDeviceRef);
746 
747 /******************************************************************************/
748 /***************************************************************************/
761 ca_mac_status TDME_GetTxPower(uint8_t *txp, struct ca821x_dev *pDeviceRef);
762 
763 /******************************************************************************/
764 /***************************************************************************/
771 uint8_t TDME_tx_dbm_to_paib(int8_t txpdbm);
772 
773 /******************************************************************************/
774 /***************************************************************************/
781 int8_t TDME_tx_paib_to_dbm(uint8_t paib);
782 
783 /******************************************************************************/
784 /****** API meta functions ******/
785 /******************************************************************************/
786 
787 /******************************************************************************/
788 /***************************************************************************/
800 ca_error ca821x_api_init(struct ca821x_dev *pDeviceRef);
801 
802 /******************************************************************************/
803 /***************************************************************************/
813 union ca821x_api_callback *ca821x_get_callback(uint8_t cmdid, struct ca821x_dev *pDeviceRef);
814 
815 /******************************************************************************/
816 /***************************************************************************/
826 uint8_t ca821x_get_sync_response_id(uint8_t cmdid);
827 
828 /***************************************************************************/
838 const char *ca821x_get_version(void);
839 
840 /***************************************************************************/
850 const char *ca821x_get_version_nodate(void);
851 
852 /******************************************************************************/
853 /***************************************************************************/
865 ca_error ca821x_upstream_dispatch(struct MAC_Message *msg, struct ca821x_dev *pDeviceRef);
866 
867 /******************************************************************************/
868 /***************************************************************************/
883 ca_error ca821x_api_downstream(const uint8_t *buf, uint8_t *response, struct ca821x_dev *pDeviceRef);
884 
885 #ifdef __cplusplus
886 }
887 #endif
888 
893 #endif // CA821X_API_H
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