Contiki 2.5
Macros | Functions | Variables
zmac.h File Reference

The IEEE 802.15.4 (2003/2006) MAC utility functions. More...

#include <stdint.h>
#include <stdbool.h>
#include "frame.h"
#include "ieee-15-4-manager.h"

Go to the source code of this file.

Macros

#define MPDU_OVERHEAD   (11)
 This overhead includes FCF, DSN, DEST_PAN_ID, DEST_ADDR, SOURCE_ADDR, & FCS.
 
FCF Values

Pre-defined data frame control field (FCF) values.

#define FCF_NO_ACK   (0x8841)
 
#define FCF_ACK_REQ   (0x8861)
 
Pre-defined network addresses

Hardcoded various "network" addresses, for use when testing.

#define DEST_PAN_ID   (0xABCD)
 
#define SOURCE_PAN_ID   (0xABCD)
 
#define LONG_ADDR_1   (0xFFEEDDCCBBAA1100LL)
 
#define LONG_ADDR_2   (0x1122334455667788LL)
 
#define LONG_ADDR_3   (0xDDEEAADDBBEEEEFFLL)
 
#define LONG_ADDR_4   (0x0123456789ABCDEFLL)
 
#define SOURCE_ADDR   (0x1234)
 
#define FCF_ACK   (0x0002)
 
#define TX_OPTION_NOACK   (0)
 
#define TX_OPTION_ACK   (1)
 
#define LONG_ADDR_LEN   (8)
 
FCF element values definitions

These are some definitions of values used in the FCF.

See the 802.15.4 spec for details.

#define BEACONFRAME   (0x00)
 
#define DATAFRAME   (0x01)
 
#define ACKFRAME   (0x02)
 
#define CMDFRAME   (0x03)
 
#define BEACONREQ   (0x07)
 
#define IEEERESERVED   (0x00)
 
#define NOADDR   (0x00)
 Only valid for ACK or Beacon frames. More...
 
#define SHORTADDRMODE   (0x02)
 
#define LONGADDRMODE   (0x03)
 
#define NOBEACONS   (0x0F)
 
#define BROADCASTADDR   (0xFFFF)
 
#define BROADCASTPANDID   (0xFFFF)
 
#define IEEE802154_2003   (0x00)
 
#define IEEE802154_2006   (0x01)
 
#define SECURITY_LEVEL_NONE   (0)
 
#define SECURITY_LEVEL_128   (3)
 
#define PSDULEN   (127)
 

Functions

void mac_init (void)
 Initializes the (quasi) 802.15.4 MAC. More...
 

Variables

ieee_15_4_manager_t ieee15_4ManagerAddress
 Interface structure for this module. More...
 
uint8_t phyCurrentChannel
 The RF channel to use for all following transmissions and receptions (see 6.1.2). More...
 
uint64_t macCoordExtendedAddress
 The 64-bit address of the coordinator/router through which the network layer wishes to communicate.
 
uint16_t macCoordShortAddress
 The 16-bit short address assigned to the coordinator through which the network layer wishes to communicate. More...
 
uint64_t macDestAddress
 This address is the 64-bit address that will be used as the mechanism to provide a destination to the upper layers. More...
 
uint8_t macDSN
 The sequence number (0x00 - 0xff) added to the transmitted data or MAC command frame. More...
 
uint16_t macDstPANId
 The 16-bit identifier of the PAN on which the device is sending to. More...
 
uint16_t macSrcPANId
 The 16-bit identifier of the PAN on which the device is operating. More...
 
uint16_t macShortAddress
 The 16-bit address that the device uses to communicate in the PAN. More...
 
Scan variables

Global variables and defines for scan.

uint8_t msduHandle
 
bool iAmCoord
 
bool autoModes
 
uint16_t macShortAddr
 
uint64_t macLongAddr
 Our own long address. More...
 

Detailed Description

The IEEE 802.15.4 (2003/2006) MAC utility functions.

Definition in file zmac.h.