takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mlme.h Source File

mlme.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2013-2018, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 /** \file mlme.h
00019  * \brief MLME API
00020  */
00021 
00022 #ifndef MLME_H_
00023 #define MLME_H_
00024 
00025 #include <stdbool.h>
00026 #include "mac_common_defines.h"
00027 #include "net_interface.h"
00028 
00029 /**
00030  * @brief struct mlme_pan_descriptor_t PAN descriptor
00031  *
00032  * See IEEE standard 802.15.4-2006 (table 55) for more details
00033  */
00034 typedef struct mlme_pan_descriptor_s {
00035     unsigned CoordAddrMode:2;   /**<Coordinator address mode MAC_ADDR_MODE_16_BIT or MAC_ADDR_MODE_64_BIT */
00036     uint16_t CoordPANId;        /**<PAN-id */
00037     uint8_t CoordAddress[8];    /**< Coordinator based CoordAddrMode */
00038     uint8_t LogicalChannel;     /**< Pan's Logical channel */
00039     uint8_t ChannelPage;        /**< Channel Page*/
00040     uint8_t SuperframeSpec[2];  /**< Superframe specification */
00041     bool GTSPermit:1;           /**< true = GTS enabled false = disabled  */
00042     uint8_t LinkQuality;        /**< Link quality based on received packet to Coordinator 0-0xff  */
00043     uint32_t Timestamp;         /**< Time stamp for received packet  */
00044     uint8_t SecurityFailure;    /**< Indicates payload security failure  */
00045     mlme_security_t Key;        /**< PAN beacon used security AUX header  */
00046 } mlme_pan_descriptor_t;
00047 
00048 /**
00049  * @brief struct mlme_command_type_t Command type enumeration
00050  *
00051  * See IEEE standard 802.15.4-2006 (table 82) for more details
00052  */
00053 typedef enum {
00054     ASSOCIATION_REQUEST = 1,            /**<Assocation request (Not supported)*/
00055     ASSOCIATION_RESPONSE = 2,           /**<Assocation response (Not supported)*/
00056     DISASSOCIATION_NOTIFICATION = 3,    /**<Disasocation Notification (Not supported)*/
00057     DATA_REQUEST = 4,                   /**<Data Request */
00058     PAN_ID_CONFLICT_NOTIFICATION = 5,   /**<Pan ID conflict notification (Not supported)*/
00059     ORPHAN_NOTIFICATION = 6,            /**<Orphan Notification (Not supported)*/
00060     BEACON_REQUEST = 7,                 /**<Beacon request */
00061     COORDINATOR_REALIGNMENT = 8,        /**<Coordinator Realignment (Not supported)*/
00062     GTS_REQUEST = 9                     /**<GTS request (Not supported)*/
00063     //Reserved
00064 } mlme_command_type_t;
00065 
00066 /**
00067  * @brief enum mlme_loss_reason_t loss reason enumeration
00068  *
00069  * See IEEE standard 802.15.4-2006 (table 75) for more details
00070  */
00071 typedef enum {
00072     PAN_ID_CONFLICT,    /**<Pan id conflict (Not supported)*/
00073     REALIGNMENT,        /**<Cordinator Realignment(Not supported)*/
00074     BEACON_LOST         /**<FHSS indicate by this when it loose synch to coordinator*/
00075 } mlme_loss_reason_t;
00076 
00077 /**
00078  * @brief struct mlme_key_usage_descriptor_t Key usage descriptor
00079  *
00080  * See IEEE standard 802.15.4-2006 (table 90) for more details
00081  */
00082 typedef struct mlme_key_usage_descriptor_s {
00083     unsigned FrameType:3; /**<0 = Beacon Frame, 1 = Data Frame or 3 Command Frame */
00084     unsigned CommandFrameIdentifier:4; /**< Set this part only when FrameType is 3 */
00085 } mlme_key_usage_descriptor_t;
00086 
00087 /**
00088  * @brief struct mlme_key_device_descriptor_t Key usage descriptor
00089  *
00090  * See IEEE standard 802.15.4-2006 (table 91) for more details
00091  */
00092 typedef struct mlme_key_device_descriptor_s {
00093     uint8_t DeviceDescriptorHandle; /**< User defined unique ID to key User */
00094     bool UniqueDevice:1;            /**< true = Key description is for Key Pair Key usage only, False = group key  */
00095     bool Blacklisted:1;             /**< true = Description is black listed, False = valid to use */
00096 } mlme_key_device_descriptor_t;
00097 
00098 /**
00099  * @brief enum mlme_security_type_t Security type enumeration
00100  *
00101  * See IEEE standard 802.15.4-2006 (table 95) for more details
00102  */
00103 typedef enum {
00104     SEC_NONE = 0,       /**< No payload encode and authentication */
00105     SEC_MIC32 = 1,      /**< No payload encode with 32-bit MIC authentication */
00106     SEC_MIC64 = 2,      /**< No payload encode with 64-bit MIC authentication */
00107     SEC_MIC128 = 3,     /**< No payload encode with 128-bit MIC authentication */
00108     SEC_ENC = 4,        /**< Payload encode enabled and without authentication */
00109     SEC_ENC_MIC32 = 5,  /**< Payload encode enabled with 32-bit MIC authentication */
00110     SEC_ENC_MIC64 = 6,  /**< Payload encode enabled with 64-bit MIC authentication */
00111     SEC_ENC_MIC128 = 7  /**< Payload encode enabled with 128-bit MIC authentication */
00112 } mlme_security_type_t;
00113 
00114 /**
00115  * @brief struct mlme_security_level_descriptor_t Security level descriptor
00116  *
00117  * See IEEE standard 802.15.4-2006 (table 92) for more details
00118  */
00119 typedef struct mlme_security_level_descriptor_s {
00120     unsigned FrameType:3; /**<0 = Beacon Frame, 1 = Data Frame or 3 Command Frame */
00121     unsigned CommandFrameIdentifier:4; /**< Set this part only when FrameType is 3 */
00122     unsigned SecurityMinimum:3; /**< Define Minimum acceptable security level for RX */
00123     bool DeviceOverrideSecurityMinimum:1; /**< Set false */
00124 } mlme_security_level_descriptor_t;
00125 
00126 /**
00127  * @brief struct mlme_device_descriptor_t Device descriptor
00128  *
00129  * See IEEE standard 802.15.4-2006 (table 93) for more details
00130  */
00131 typedef struct mlme_device_descriptor_s {
00132     uint16_t PANId;         /**< Pan-id */
00133     uint16_t ShortAddress;  /**< Device 16-bit short address 0xffff means not defined */
00134     uint8_t ExtAddress[8];  /**< Device Extended 64-bit address */
00135     uint32_t FrameCounter;  /**< Security Frame counter */
00136     bool Exempt:1;          /**< Set false */
00137 } mlme_device_descriptor_t;
00138 
00139 /**
00140  * @brief struct mlme_key_id_lookup_descriptor_t Key id lookup descriptor
00141  *
00142  * See IEEE standard 802.15.4-2006 (table 94) for more details
00143  */
00144 typedef struct mlme_key_id_lookup_descriptor_s {
00145     uint8_t LookupData[9];      /**< Key Lookup data */
00146     unsigned LookupDataSize:1; /**< Key Lookup data size 0= 5 1 is 9 bytes */
00147 } mlme_key_id_lookup_descriptor_t;
00148 
00149 
00150 /**
00151  * @brief struct mlme_key_descriptor_entry_t Key descriptor entry
00152  *
00153  * See IEEE standard 802.15.4-2006 (table 89) for more details
00154  */
00155 typedef struct mlme_key_descriptor_entry_s {
00156     mlme_key_id_lookup_descriptor_t *KeyIdLookupList;   /**< List of Key lookup data for this descriptor*/
00157     uint8_t KeyIdLookupListEntries;                     /**< Number of entries in KeyIdLookupList*/
00158     mlme_key_device_descriptor_t *KeyDeviceList;        /**< List of descriptor user entries indicating which devices are valid or blacklisted */
00159     uint8_t KeyDeviceListEntries;                       /**< Number of entries in KeyDeviceList*/
00160     mlme_key_usage_descriptor_t *KeyUsageList;          /**< List of descriptor entries indicating which frame types this key may be used with*/
00161     uint8_t KeyUsageListEntries;                        /**< Number of entries in KeyUsageList*/
00162     uint8_t Key[16];                                    /**< Actual value of Security key*/
00163 }mlme_key_descriptor_entry_t;
00164 
00165 /**
00166  * @brief MLME primitive error statuses
00167  *
00168  * See IEEE standard 802.15.4-2006 for more details
00169  */
00170 #define MLME_SUCCESS                    0x00 /**< The requested operation was completed successfully*/
00171 #define MLME_BUSY_CHAN                  0xe1 /**< CSMA-CA fail*/
00172 #define MLME_BUSY_RX                    0x01 /**< The radio is asked to change its state while receiving */
00173 #define MLME_BUSY_TX                    0x02 /**< The radio is asked to change its state while transmitting. */
00174 #define MLME_FORCE_TRX_OFF              0x03 /**< The radio is to be switched off immediately */
00175 #define MLME_IDLE                       0x04 /**< The CCA attempt has detected an idle channel */
00176 #define MLME_RX_ON                      0x06 /**< The radio is in or is to be configured into the receiver enabled state. */
00177 #define MLME_TRX_OFF                    0x08 /**< The radio is in or is to be configured into the receiver enabled state. */
00178 #define MLME_TX_ON                      0x09 /**< The radio is in or is to be configured into the receiver enabled state. */
00179 #define MLME_COUNTER_ERROR              0xdb /**< Originated messages security counter is not valid */
00180 #define MLME_IMPROPER_KEY_TYPE          0xdc /**< Received Messages key used is agains't key usage policy */
00181 #define MLME_IMPROPER_SECURITY_LEVEL    0xdd /**< Received Messages security level does not meet minimum security level */
00182 #define MLME_UNSUPPORTED_LEGACY         0xde /**< The received frame was purportedly secured using security based on IEEE Std 802.15.4-2003, and such security is not supported by this standard. */
00183 #define MLME_UNSUPPORTED_SECURITY       0xdf /**< The received frame security is not supported */
00184 #define MLME_SECURITY_FAIL              0xe4 /**< Cryptographic processing of the received secured frame failed. */
00185 #define MLME_FRAME_TOO_LONG             0xe5 /**< Either a frame resulting from processing has a length that is greater than aMaxPHYPacketSize */
00186 #define MLME_INVALID_HANDLE             0xe7 /**< Status for Purge request when Mac not detect proper queued message*/
00187 #define MLME_INVALID_PARAMETER          0xe8 /**< A parameter in the primitive is either not supported or is out of the valid range */
00188 #define MLME_TX_NO_ACK                  0xe9 /**< No ack was received after macMaxFrameRetries */
00189 #define MLME_NO_BEACON                  0xea /**< A scan operation failed to find any network beacons */
00190 #define MLME_NO_DATA                    0xeb /**< No response data were available following a request */
00191 #define MLME_NO_SHORT_ADDRESS           0xec /**< Operation fail because 16-bit address is not allocated */
00192 #define MLME_PAN_ID_CONFLICT            0xee /**< A PAN identifier conflict has been detected and communicated to the PAN coordinator. */
00193 #define MLME_TRANSACTION_EXPIRED        0xf0 /**< The transaction has expired and its information was discarded */
00194 #define MLME_TRANSACTION_OVERFLOW       0xf1 /**< MAC have no capacity to store the transaction */
00195 #define MLME_UNAVAILABLE_KEY            0xf3 /**< Received message use unknown key, or the originating device is unknown or is blacklisted with that particular key */
00196 #define MLME_UNSUPPORTED_ATTRIBUTE      0xf4 /**< A SET/GET request was issued with the unsupported identifier */
00197 #define MLME_INVALID_ADDRESS            0xf5 /**< A request to send data was unsuccessful because neither the source address parameters nor the destination address parameters were present.*/
00198 #define MLME_INVALID_INDEX              0xf9 /**< An attempt to write to a MAC PIB attribute that is in a table failed because the specified table index was out of range. */
00199 #define MLME_LIMIT_REACHED              0xfa /**< A scan operation terminated prematurely because the number of PAN descriptors stored reached an implementation- specified maximum */
00200 #define MLME_READ_ONLY                  0xfb /**< A SET request was issued with the identifier of an attribute that is read only.*/
00201 #define MLME_SCAN_IN_PROGRESS           0xfc /**< Request scan request fail when scan is already active */
00202 //NOT-standard
00203 #define MLME_DATA_POLL_NOTIFICATION     0xff /**< Thread requirement feature COMM status status for indicate for successfully data poll event to refresh neighbour data */
00204 
00205 /**
00206  * @brief enum mac_scan_type_t MAC scan type
00207  *
00208  * See IEEE standard 802.15.4-2006 (table 67) for more details
00209  */
00210 typedef enum {
00211     MAC_ED_SCAN_TYPE = 0,  /**< Energy detection scan operation */
00212     MAC_ACTIVE_SCAN = 1,   /**< Active scan operation */
00213     MAC_PASSIVE_SCAN = 2,   /**< Passive scan operation */
00214     MAC_ORPHAN_SCAN = 3     /**< Orphan scan operation (Not supported) */
00215 } mac_scan_type_t;
00216 
00217 /**
00218  * @brief enum mlme_attr_t MLME attributes used with GET and SET primitives
00219  *
00220  * See IEEE standard 802.15.4-2006 (table 86) for more details
00221  */
00222 typedef enum {
00223     phyCurrentChannel = 0x00,       /*<Current RF channel*/
00224     macAckWaitDuration = 0x40,      /*<Integer, n. of symbols*/
00225     macAssociatedPANCoord = 0x56,   /*<Boolean, associated to PAN coordinator*/
00226     macAssociationPermit = 0x41,    /*<Boolean, if association is allowed (in coordinator)*/
00227     macAutoRequest = 0x42,          /*<Boolean, if device automatically sends data request on beacon*/
00228     macBattLifeExt = 0x43,          /*<Boolean, if BLE is enabled*/
00229     macBattLifeExtPeriods = 0x44,   /*<Integer 6-41, BLE back off periods */
00230     macBeaconPayload = 0x45,        /*<Set of bytes, beacon payload*/
00231     macBeaconPayloadLength = 0x46,  /*<Integer 0-MaxPayLoadLen*/
00232     macBeaconOrder = 0x47,          /*<Integer 0–15, Beacon tx period, 15 = no periodic beacon*/
00233     macBeaconTxTime = 0x48,         /*<Integer 0x000000–0xffffff, symbols, when last beacon was transmitted*/
00234     macBSN = 0x49,                  /*<Integer 0x00–0xff, Beacon sequence number*/
00235     macCoordExtendedAddress = 0x4a, /*<64-bit IEEE of coordinator*/
00236     macCoordShortAddress = 0x4b,    /*<16-bit addr of coordinator*/
00237     macDSN = 0x4c,                  /*<Integer 0x00–0xff, Data frame sequence number*/
00238     macGTSPermit = 0x4d,            /*<Boolean, GTS allowed?*/
00239     macMaxBE = 0x57,                /*<Integer 3–8, max value of back off exponent*/
00240     macMaxCSMABackoffs = 0x4e,      /*<Integer 0–5*/
00241     macMaxFrameTotalWaitTime = 0x58,/*<Integer, max of CAP symbols while waiting for data requested by DREQ or PEND*/
00242     macMaxFrameRetries = 0x59,      /*<Integer 0–7*/
00243     macMinBE = 0x4f,                /*<Integer 0–macMaxBE*/
00244     macPANId = 0x50,                /*<PAN ID, 16 bits*/
00245     macPromiscuousMode = 0x51,      /*<Boolean*/
00246     macResponseWaitTime = 0x5a,     /*<Integer 2–64  The maximum time in SuperFrameDurations to wait for responses*/
00247     macRxOnWhenIdle = 0x52,         /*<Boolean*/
00248     macSecurityEnabled = 0x5d,      /*<Boolean*/
00249     macShortAddress = 0x53,         /*<Short address, 16 bits*/
00250     macSuperframeOrder = 0x54,      /*<Integer 0–15, The length of the active portion of the outgoing super frame, 15 = none*/
00251     macSyncSymbolOffset = 0x5b,     /*<Integer 0x000–0x100 (symbols) time stamp offset*/
00252     macTimestampSupported = 0x5c,   /*<Boolean*/
00253     macTransactionPersistenceTime = 0x55, /*<Integer 0x0000–0xffff (unit periods)*/
00254     macKeyTable = 0x71,             /*<A table of KeyDescriptor entries, each containing keys and related information required for secured communications.*/
00255     macKeyTableEntries = 0x72,      /*<The number of entries in macKeyTable.*/
00256     macDeviceTable = 0x73,          /*<List of Descriptor entries, each indicating a remote device*/
00257     macDeviceTableEntries = 0x74,   /*<The number of entries in macDeviceTable.*/
00258     macSecurityLevelTable = 0x75,   /*<A table of SecurityLevelDescriptor entries*/
00259     macSecurityLevelTableEntries = 0x76,    /*<The number of entries in macSecurityLevelTable*/
00260     macFrameCounter = 0x77,         /*<The outgoing frame counter*/
00261     macAutoRequestSecurityLevel = 0x78, /*<0x00–0x07  The security level used for automatic data requests.*/
00262     macAutoRequestKeyIdMode = 0x79,      /*< The key identifier mode used for automatic data requests.*/
00263     macAutoRequestKeySource = 0x7a, /*<Key source for automatic data*/
00264     macAutoRequestKeyIndex = 0x7b,  /*<The index of the key used for automatic data*/
00265     macDefaultKeySource = 0x7c,      /*<Default key source*/
00266     //NON standard extension
00267     macAcceptByPassUnknowDevice = 0xfc,  /*< Accept data trough MAC if packet is data can be authenticated by group key nad MIC. Security enforsment point must be handled carefully these packets */
00268     macLoadBalancingBeaconTx = 0xfd,  /*< Trig Beacon from load balance module periodic */
00269     macLoadBalancingAcceptAnyBeacon = 0xfe, /*<Beacon accept state control from other network. Value size bool, data true=Enable, false=disable .*/
00270     macThreadForceLongAddressForBeacon = 0xff /*<Thread standard force beacon source address for extended 64-bit*/
00271 } mlme_attr_t;
00272 
00273 /**
00274  * @brief struct mlme_beacon_pending_address_spec_t Pending address specification field
00275  *
00276  * See IEEE standard 802.15.4-2006 (figure 51) for more details
00277  */
00278 typedef struct mlme_beacon_pending_address_spec_s{
00279     unsigned short_address_count:3;                 /**< Number of short address count */
00280     unsigned extended_address_count:3;              /**< Number of extended address count */
00281 }mlme_beacon_pending_address_spec_t;
00282 
00283 /**
00284  * @brief struct mlme_beacon_gts_spec_t Format of GTS specification field
00285  *
00286  * See IEEE standard 802.15.4-2006 (figure 48) for more details
00287  */
00288 typedef struct mlme_beacon_gts_spec_s{
00289     unsigned description_count:3;       /**< Number of GTS description count */
00290     unsigned gts_permit:1;              /**< 1= GTS request accepted 0= not accepted */
00291 }mlme_beacon_gts_spec_t;
00292 
00293 /**
00294  * @brief struct mlme_beacon_ind_t Beacon notify structure
00295  *
00296  * See IEEE standard 802.15.4-2006 (table 54) for more details
00297  */
00298 typedef struct mlme_beacon_ind_s {
00299     uint8_t BSN;                                        /**< Beacon sequence number */
00300     mlme_pan_descriptor_t PANDescriptor;                /**< Beacon parsed Pan description */
00301     mlme_beacon_pending_address_spec_t PendAddrSpec;    /**< Address pending field */
00302     uint8_t *AddrList;                                  /**< Address pending list */
00303     uint16_t beacon_data_length;                        /**< Length of beacon payload */
00304     uint8_t *beacon_data;                               /**< Pointer to beacon payload */
00305 } mlme_beacon_ind_t;
00306 
00307 /**
00308  * @brief struct mlme_scan_t Scan request structure
00309  *
00310  * See IEEE standard 802.15.4-2006 (table 67) for more details
00311  */
00312 typedef struct mlme_scan_s {
00313     mac_scan_type_t     ScanType;   /**< ED=0, active=1, passive=2, orphan=3*/
00314     channel_list_s  ScanChannels;   /**<bit field, low 27 bits used*/
00315     uint8_t     ScanDuration;       /**<0-14, scan duration/channel*/
00316     uint8_t     ChannelPage;        /**<0-31*/
00317     mlme_security_t Key;            /**< Security parameters for active scan process */
00318 } mlme_scan_t;
00319 
00320 /**
00321  * @brief struct mlme_set_t Set request structure
00322  *
00323  * See IEEE standard 802.15.4-2006 (table 70) for more details
00324  */
00325 typedef struct mlme_set_s {
00326     mlme_attr_t attr;           /**<PIB attribute for operation*/
00327     uint8_t attr_index;         /**< attribute index to to table (use only for PIB attributes which are tables)*/
00328     const void *value_pointer;  /**< Pointer to value*/
00329     uint8_t value_size;         /**< define data length in bytes behind pointer*/
00330 } mlme_set_t;
00331 
00332 /**
00333  * @brief struct mlme_get_t Get request structure
00334  *
00335  * See IEEE standard 802.15.4-2006 (table 56) for more details
00336  */
00337 typedef struct mlme_get_s {
00338     mlme_attr_t attr;       /**<PIB attribute for operation*/
00339     uint8_t attr_index;     /**< attribute index to to table (use only for PIB attributes which are tables)*/
00340 } mlme_get_t;
00341 
00342 /**
00343  * @brief struct mlme_get_conf_t Get confirm structure
00344  *
00345  * See IEEE standard 802.15.4-2006 (table 57) for more details
00346  */
00347 typedef struct mlme_get_conf_s {
00348     uint8_t status;             /**< status of operation*/
00349     mlme_attr_t attr;           /**<PIB attribute for operation*/
00350     uint8_t attr_index;         /**< attribute index to to table (valid only for PIB attributes which are tables)*/
00351     void *value_pointer;        /**< Pointer to data when status is MLME_SUCCESS */
00352     uint8_t value_size;         /**< define data length in bytes behind pointer*/
00353 } mlme_get_conf_t;
00354 
00355 /**
00356  * @brief struct mlme_set_conf_t Set confirm structure
00357  *
00358  * See IEEE standard 802.15.4-2006 (table 71) for more details
00359  */
00360 typedef struct mlme_set_conf_s {
00361     uint8_t status;         /**< status of operation*/
00362     mlme_attr_t attr;       /**<PIB attribute for operation*/
00363     uint8_t attr_index;     /**< attribute index to to table (valid only for PIB attributes which are tables)*/
00364 } mlme_set_conf_t;
00365 
00366 
00367 #define MLME_MAC_RES_SIZE_MAX 16 /**< Mac scan response max supported list size */
00368 
00369 /**
00370  * @brief struct mlme_scan_conf_t Scan confirm structure
00371  *
00372  * See IEEE standard 802.15.4-2006 (table 68) for more details
00373  */
00374 typedef struct mlme_scan_conf_s {
00375     uint8_t status;                                             /**< status of operation*/
00376     unsigned ScanType:2;                                        /**< Finished Scan type*/
00377     uint8_t ChannelPage;                                        /**< Operated Channel Page*/
00378     channel_list_s UnscannedChannels;                           /**< Channel mask for unscanned channels*/
00379     uint8_t ResultListSize;                                     /**< Result list size*/
00380     uint8_t *ED_values;                                         /**< Energy scan result types Check only when scan type is 0*/
00381     mlme_pan_descriptor_t *PAN_values[MLME_MAC_RES_SIZE_MAX];   /**< List of scanned Pan description's*/
00382 } mlme_scan_conf_t;
00383 
00384 /**
00385  * @brief struct mlme_reset_t Reset request structure
00386  *
00387  * See IEEE standard 802.15.4-2006 (table 63) for more details
00388  */
00389 typedef struct mlme_reset_s {
00390     bool SetDefaultPIB; /**< true= Set standard default values, false= Mac sub layer will be reset but it retain configured MAC PIB values */
00391 } mlme_reset_t;
00392 
00393 /**
00394  * @brief struct mlme_reset_conf_t Reset confirm structure
00395  *
00396  * See IEEE standard 802.15.4-2006 (table 64) for more details
00397  */
00398 typedef struct mlme_reset_conf_s {
00399     uint8_t status; /**< Status of reset operation */
00400 } mlme_reset_conf_t;
00401 
00402 /**
00403  * @brief struct mlme_rx_enable_t Rx enable request structure (Not supported)
00404  *
00405  * See IEEE standard 802.15.4-2006 (table 65) for more details
00406  */
00407 typedef struct mlme_rx_enable_s {
00408     bool DeferPermit;               /**< This will be ignored at nonbeacon-enabled PAN*/
00409     uint32_t RxOnTime;              /**< This will be ignored at nonbeacon-enabled PAN*/
00410     uint32_t RxOnDuration;          /**< Number of symbols which receiver is enabled, 0 receiver is not disabled*/
00411 } mlme_rx_enable_t;
00412 
00413 /**
00414  * @brief struct mlme_rx_enable_conf_t Rx enable confirm structure (Not supported)
00415  *
00416  * See IEEE standard 802.15.4-2006 (table 66) for more details
00417  */
00418 typedef struct mlme_rx_enable_conf_s {
00419     uint8_t status;                     /**< Status of operation */
00420 } mlme_rx_enable_conf_t;
00421 
00422 /**
00423  * @brief struct mlme_comm_status_t Comm status indication structure
00424  *
00425  * See IEEE standard 802.15.4-2006 (table 69) for more details
00426  */
00427 typedef struct mlme_comm_status_s {
00428     uint16_t PANId;                 /**< Messages Pan-id */
00429     unsigned SrcAddrMode:2;         /**< source address mode: MAC_ADDR_MODE_NONE,MAC_ADDR_MODE_16_BIT or MAC_ADDR_MODE_64_BIT */
00430     uint8_t SrcAddr[8];             /**< source address when mode is: MAC_ADDR_MODE_16_BIT or MAC_ADDR_MODE_64_BIT */
00431     unsigned DstAddrMode:2;         /**< destination address mode: MAC_ADDR_MODE_NONE,MAC_ADDR_MODE_16_BIT or MAC_ADDR_MODE_64_BIT */
00432     uint8_t DstAddr[8];             /**< Destination address when mode is: MAC_ADDR_MODE_16_BIT or MAC_ADDR_MODE_64_BIT */
00433     uint8_t status;                 /**< Communication status */
00434     mlme_security_t Key;            /**< Messages Security parameters */
00435 } mlme_comm_status_t;
00436 
00437 /**
00438  * @brief struct mlme_start_t Start request structure
00439  *
00440  * See IEEE standard 802.15.4-2006 (table 72) for more details
00441  */
00442 typedef struct mlme_start_s {
00443     uint16_t PANId;                     /**< Pan-id */
00444     uint8_t LogicalChannel;             /**< Operated Logical channel */
00445     uint8_t ChannelPage;                /**< Operated Logical channel page */
00446     uint32_t StartTime;                 /**< Start time,  set 0 */
00447     unsigned BeaconOrder:4;             /**< Beacon order,  set 15 */
00448     unsigned SuperframeOrder:4;         /**< Super frame order,  set 15 */
00449     bool PANCoordinator:1;              /**< true= Enable beacon response for beacon request, false = disable beacon request responses */
00450     bool BatteryLifeExtension:1;        /**< Set false */
00451     bool CoordRealignment:1;            /**< Set false */
00452     mlme_security_t CoordRealignKey;    /**< Coordinator Realignment security parameter's  (Valid only CoordRealignment = true)*/
00453     mlme_security_t BeaconRealignKey;   /**< Beacon realign security parameter's (Valid only CoordRealignment = true)*/
00454 } mlme_start_t;
00455 
00456 /**
00457  * @brief struct mlme_start_conf_t Start confirm structure (Currently not triggered yet)
00458  *
00459  * See IEEE standard 802.15.4-2006 (table 73) for more details
00460  */
00461 typedef struct mlme_start_conf_s {
00462     uint8_t status;                 /**< Status for start confirmation */
00463 } mlme_start_conf_t;
00464 
00465 
00466 /**
00467  * @brief struct mlme_sync_loss_s Synch loss indication
00468  *
00469  * Stack will trig this with FHSS enabled mac when synch to parent is lost
00470  * See IEEE standard 802.15.4-2006 (table 73) for more details
00471  */
00472 typedef struct mlme_sync_loss_s {
00473     mlme_loss_reason_t LossReason; /**< Loss reason, BEACON_LOST with FHSS */
00474     uint16_t PANId;                 /**< Pan-id */
00475     uint8_t LogicalChannel;         /**< Logical channel */
00476     uint8_t ChannelPage;            /**< Logical channel page */
00477     mlme_security_t Key;            /**< Security parameters */
00478 } mlme_sync_loss_t;
00479 
00480 /**
00481  * @brief struct mlme_poll_t Poll request structure
00482  *
00483  * See IEEE standard 802.15.4-2006 (table 76) for more details
00484  */
00485 typedef struct mlme_poll_s {
00486     unsigned CoordAddrMode:2;   /**< coordinator address mode:MAC_ADDR_MODE_16_BIT or MAC_ADDR_MODE_64_BIT */
00487     uint16_t CoordPANId;        /**< coordinator Pan-id to coordinator*/
00488     uint8_t CoordAddress[8];    /**< coordinator address */
00489     mlme_security_t Key;        /**< Security parameters for Poll request */
00490 } mlme_poll_t;
00491 
00492 /**
00493  * @brief struct mlme_poll_conf_t Poll confirm structure
00494  *
00495  * See IEEE standard 802.15.4-2006 (table 77) for more details
00496  */
00497 typedef struct mlme_poll_conf_s {
00498     uint8_t status;             /**< Status of Poll operation */
00499 } mlme_poll_conf_t;
00500 
00501 #endif /* MLME_H_ */