⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frame_format.h.svn-base

📁 802.15.4协议的实现
💻 SVN-BASE
字号:
/*
 * @author IPP HURRAY http://www.hurray.isep.ipp.pt/art-wise
 * @author Andre Cunha
 */
//MAC frame Superstructure
typedef struct MPDU
{

uint8_t length;
uint16_t frame_control;
uint8_t seq_num;

uint8_t data[121];

//the transceiver automatic field
//uint16_t fcs;

}MPDU;




////////////////////////////////////////////////
//BEACON FRAME SCTRUCTURES
////////////////////////////////////////////////

typedef struct beacon_addr_short
{

uint16_t source_PAN_identifier;
uint16_t destination_address;
uint16_t source_address;

uint16_t superframe_specification;

}beacon_addr_short;


#define beacon_addr_short_length 7


typedef struct beacon_addr_long
{
uint16_t source_PAN_identifier;

uint32_t source_address0;
uint32_t source_address1;

uint16_t superframe_specification;

}beacon_addr_long;

#define beacon_addr_long_length 12



////////////////////////////////////////////////
//Data FRAME Structures
////////////////////////////////////////////////

/*
typedef struct data_addr_short
{

uint16_t source_PAN_identifier;
uint16_t destination_address;
uint16_t source_address;

}data_addr_short;

#define data_addr_short_length 6

typedef struct data_addr_long
{
uint16_t source_PAN_identifier;

uint32_t destination_address[1];
uint32_t source_address[1];

}data_addr_long;

#define data_addr_long_length 18

typedef struct data_destination_addr_short
{
uint16_t destination_address;

}data_destination_addr_short;

#define data_destination_addr_short_length 2

typedef struct data_destination_addr_long
{
uint32_t destination_address[1];

}data_destination_addr_long;

#define data_destination_addr_long_length 8

typedef struct data_source_addr_short
{

uint16_t source_address;

}data_source_addr_short;

#define data_source_addr_short_length 2

typedef struct data_source_addr_long
{
uint32_t source_address[1];

}data_source_addr_long;

#define data_source_addr_long_length 8

*/

////////////////////////////////////////////////
//ACK FRAME Structures
////////////////////////////////////////////////



////////////////////////////////////////////////
//COMMAND FRAME Structures
////////////////////////////////////////////////

//unused
typedef struct cmd_addr_short
{
uint16_t destination_PAN_identifier;
uint16_t destination_address;

uint16_t source_address;

uint8_t command_frame_identifier;

}cmd_addr_short;

#define cmd_addr_short_length 7 

//unused
typedef struct cmd_addr_long
{
uint16_t destination_PAN_identifier;

uint32_t destination_address0;
uint32_t destination_address1;

uint32_t source_address0;
uint32_t source_address1;

//uint16_t source_PAN_identifier;

uint8_t command_frame_identifier;

}cmd_addr_long;

#define cmd_addr_long_length 23

typedef struct cmd_association_request_short
{
uint16_t destination_PAN_identifier;

uint16_t destination_address;

uint16_t source_PAN_identifier;

uint32_t source_address0;
uint32_t source_address1;


uint8_t command_frame_identifier;

uint8_t capability_information;

}cmd_association_request_short;


//associacion response command structure pag. 125
typedef struct cmd_association_response
{
uint16_t destination_PAN_identifier;
uint32_t destination_address0;
uint32_t destination_address1;

uint16_t source_PAN_identifier;

uint32_t source_address0;
uint32_t source_address1;

uint8_t command_frame_identifier;

uint16_t short_address;
uint8_t association_status;

}cmd_association_response;


//disassociacion notification command structure pag. 126
typedef struct cmd_disassociation_notification
{
uint16_t destination_PAN_identifier;

uint32_t destination_address0;
uint32_t destination_address1;

uint16_t source_PAN_identifier;

uint32_t source_address0;
uint32_t source_address1;

uint8_t command_frame_identifier;

uint8_t disassociation_reason;

}cmd_disassociation_notification;


//data request command structure pag. 128
								//dest _ source
typedef struct cmd_data_request_0_2
{


uint16_t source_PAN_identifier;

uint16_t source_address;

uint8_t command_frame_identifier;

}cmd_data_request_0_2;

								//dest _ source
typedef struct cmd_data_request_0_3
{

uint16_t source_PAN_identifier;

uint32_t source_address0;
uint32_t source_address1;

uint8_t command_frame_identifier;

}cmd_data_request_0_3;


//pag 130
typedef struct cmd_beacon_request
{
uint16_t destination_PAN_identifier;
uint16_t destination_address;
uint8_t command_frame_identifier;
}cmd_beacon_request;


//pag 132
typedef struct cmd_gts_request
{
uint16_t source_PAN_identifier;
uint16_t source_address;
uint8_t command_frame_identifier;
uint8_t gts_characteristics;

}cmd_gts_request;




/*******************************************************/
/*     ADDRESSING FIELDS ONLY						   */
/*******************************************************/
#define DEST_SHORT_LEN 4
#define DEST_LONG_LEN 10
#define intra_pan_source_short_len 2
#define intra_pan_source_long_len 8
#define SOURCE_SHORT_LEN 4
#define SOURCE_LONG_LEN 10


//DESTINATION
typedef struct dest_short
{
uint16_t destination_PAN_identifier;
uint16_t destination_address;

}dest_short;

#define dest_short_len 4

typedef struct dest_long
{

uint16_t destination_PAN_identifier;
uint32_t destination_address0;
uint32_t destination_address1;

}dest_long;

//SOURCE
typedef struct intra_pan_source_short
{

uint16_t source_address;

}intra_pan_source_short;

typedef struct intra_pan_source_long
{
uint32_t source_address0;
uint32_t source_address1;

}intra_pan_source_long;


typedef struct source_short
{
uint16_t source_PAN_identifier;
uint16_t source_address;

}source_short;


typedef struct source_long
{

uint16_t source_PAN_identifier;

uint32_t source_address0;
uint32_t source_address1;

}source_long;



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -