joey shelton / LED_Demo

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mac_common_defines.h Source File

mac_common_defines.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2016 ARM Limited. All rights reserved.
00003  *
00004  * SPDX-License-Identifier: LicenseRef-PBL
00005  *
00006  * Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  * https://www.mbed.com/licenses/PBL-1.0
00010  *
00011  * See the License for the specific language governing permissions and limitations under the License.
00012  *
00013  */
00014 
00015 /** \file mac_common_defines.h
00016  * \brief Common definitions for MAC layer.
00017  */
00018 
00019 #ifndef MAC_COMMON_DEFINES_H_
00020 #define MAC_COMMON_DEFINES_H_
00021 
00022 #include "ns_types.h"
00023 
00024 #define MAC_ADDR_MODE_NONE 0
00025 #define MAC_ADDR_MODE_16_BIT 2
00026 #define MAC_ADDR_MODE_64_BIT 3
00027 
00028 #define MAC_FRAME_VERSION_2003         0    // FCF - IEEE 802.15.4-2003 compatible
00029 #define MAC_FRAME_VERSION_2006         1    // FCF - IEEE 802.15.4-2006 (big payload or new security)
00030 
00031 
00032 #define MAC_KEY_ID_MODE_IMPLICIT    0
00033 #define MAC_KEY_ID_MODE_IDX         1
00034 #define MAC_KEY_ID_MODE_SRC4_IDX    2
00035 #define MAC_KEY_ID_MODE_SRC8_IDX    3
00036 
00037 /* IEEE 802.15.4 constants */
00038 #define MAC_IEEE_802_15_4_MAX_MPDU_UNSECURED_OVERHEAD   25
00039 #define MAC_IEEE_802_15_4_MIN_MPDU_OVERHEAD             9
00040 #define MAC_IEEE_802_15_4_MAX_BEACON_OVERHEAD           75
00041 #define MAC_IEEE_802_15_4_MAX_PHY_PACKET_SIZE           127
00042 
00043 #define MAC_IEEE_802_15_4_MAX_BEACON_PAYLOAD_LENGTH \
00044     (MAC_IEEE_802_15_4_MAX_PHY_PACKET_SIZE - MAC_IEEE_802_15_4_MAX_BEACON_OVERHEAD)
00045 #define MAC_IEEE_802_15_4_MAX_MAC_SAFE_PAYLOAD_SIZE \
00046     (MAC_IEEE_802_15_4_MAX_PHY_PACKET_SIZE - MAC_IEEE_802_15_4_MAX_MPDU_UNSECURED_OVERHEAD)
00047 
00048 #define mac_unsecured_2003_compatibility false
00049 
00050 /**
00051  * @brief struct mlme_security_t MLME/MCPS security structure
00052  * This structure encapsulates security related variables,
00053  * which are always used together if SecurityLevel > 0.
00054  *
00055  * See IEEE standard 802.15.4-2006 (e.g end of table 41) for more details
00056  */
00057 typedef struct mlme_security_s {
00058     unsigned SecurityLevel:3;
00059     unsigned KeyIdMode:2; /* 2-bit value which define key source and ID use case */
00060     uint8_t KeyIndex; /* Key index */
00061     uint8_t Keysource[8];
00062 } mlme_security_t;
00063 
00064 #endif /* MAC_COMMON_DEFINES_H_ */