123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336 |
- #ifndef MAC_MLME_ASSOCIATE_H_INCLUDED
- #define MAC_MLME_ASSOCIATE_H_INCLUDED
- #include <stdint.h>
- #include "mac_common.h"
- #include "mac_task_scheduler.h"
- #define ALTERNATE_PAN_COORDINATOR_BIT (0)
- #define DEVICE_TYPE_BIT (1)
- #define POWER_SOURCE_BIT (2)
- #define RECEIVER_ON_WHEN_IDLE_BIT (3)
- #define SECURITY_CAPABILITY_BIT (6)
- #define ALLOCATE_ADDRESS_BIT (7)
- typedef enum
- {
- MAC_ASSOCIATION_SUCCESSFUL = 0,
- MAC_PAN_AT_CAPACITY,
- MAC_PAN_ACCESS_DENIED
- } mac_association_status_t;
- typedef struct
- {
- uint8_t alternate_pan_coordinator : 1;
- uint8_t device_type : 1;
- uint8_t power_source : 1;
- uint8_t rx_on_when_idle : 1;
- uint8_t reserved : 2;
- uint8_t security_capability : 1;
- uint8_t allocate_address : 1;
- } mac_capability_t;
- typedef enum
- {
- MAC_CAP_CANNOT_BE_PAN_COORD = 0,
- MAC_CAP_CAN_BE_PAN_COORD
- } mac_cap_alt_pan_coord_t;
- typedef enum
- {
- MAC_CAP_RFD_DEVICE = 0,
- MAC_CAP_FFD_DEVICE
- } mac_cap_device_type_t;
- typedef enum
- {
- MAC_CAP_BATTERY_POWERED = 0,
- MAC_CAP_MAINS_POWERED
- } mac_cap_power_source_t;
- typedef enum
- {
- MAC_CAP_RX_OFF_WHEN_IDLE = 0,
- MAC_CAP_RX_ON_WHEN_IDLE
- } mac_cap_rx_when_idle_t;
- typedef enum
- {
- MAC_CAP_CANNOT_SECURE = 0,
- MAC_CAP_CAN_SECURE
- } mac_cap_secure_t;
- typedef enum
- {
- MAC_CAP_SHORT_ADDR_NOT_REQ = 0,
- MAC_CAP_SHORT_ADDR_REQ
- } mac_cap_allocate_addr_t;
- #if (CONFIG_ASSOCIATE_REQ_ENABLED == 1)
- typedef struct
- {
- uint16_t assoc_short_address;
- mac_status_t status;
- #if (CONFIG_SECURE == 1)
- uint8_t security_level;
- uint8_t key_id_mode;
- uint64_t key_source;
- uint8_t key_index;
- #endif
- } mlme_associate_conf_t;
- typedef struct
- {
-
- mac_abstract_req_t service;
-
- mlme_associate_conf_t confirm;
-
- uint8_t logical_channel;
-
- #ifdef CONFIG_SUB_GHZ
- uint8_t channel_page;
- #endif
- mac_addr_mode_t coord_addr_mode;
- uint16_t coord_pan_id;
- mac_addr_t coord_address;
- mac_capability_t capability_information;
- #if (CONFIG_SECURE == 1)
- uint8_t security_level;
- uint8_t key_id_mode;
- uint64_t key_source;
- uint8_t key_index;
- #endif
- } mlme_associate_req_t;
- #if (CONFIG_ASSOCIATE_IND_ENABLED == 1)
- typedef struct
- {
- uint64_t device_address;
- uint8_t capability_information;
- #if (CONFIG_SECURE == 1)
- uint8_t security_level;
- uint8_t key_id_mode;
- uint64_t key_source;
- uint8_t key_index;
- #endif
- } mlme_associate_ind_t;
- typedef struct
- {
- uint64_t device_address;
- uint16_t assoc_short_address;
- mac_association_status_t status;
- #if (CONFIG_SECURE == 1)
- uint8_t security_level;
- uint8_t key_id_mode;
- uint64_t key_source;
- uint8_t key_index;
- #endif
- } mlme_associate_resp_t;
- #endif
- typedef void (* mlme_associate_conf_cb_t)(mlme_associate_conf_t *);
- void mlme_associate_req(mlme_associate_req_t * req, mlme_associate_conf_cb_t conf_cb);
- #if (CONFIG_ASSOCIATE_IND_ENABLED == 1)
- extern void mlme_associate_ind(mlme_associate_ind_t * ind);
- void mlme_associate_resp(mlme_associate_resp_t * resp);
- #endif
- #endif
- #endif
|