资源简介
基于802.15.4 的开源代码,希望基于802.15.4协议栈开发的同学下载。
代码片段和文件信息
/* Standard includes. */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifdef HAVE_DEBUG
__data unsigned char bp = 0x21;
#endif
static volatile uint8_t stay_associated = 0;
static bool associating = FALSE;
static pan_descriptor_t pan;
static void
pause_sec (void)
{
uint8_t j k;
for (j = 0; j < 4; j++) {
for (k = 0; k < 250; k++) {
pause_us (250);
pause_us (250);
pause_us (250);
pause_us (250);
}
}
}
static void
error (void)
{
EA = 0;
LED1_OFF ();
LED2_OFF ();
for (;;) {
pause_sec ();
LED1_TOGGLE ();
LED2_TOGGLE ();
}
}
void
main (void)
{
if (!mac_init ())
error ();
pause_us (250);
vTaskStartScheduler();
error ();
}
void
app_start (void)
{
uint16_t channels = 0x400;
debug (“Node started\r\n“);
mlme_scan_request (PASSIVE_SCAN channels 8 NULL);
}
void
mcps_data_indication (phy_frame_t * frame mac_frame_info_t * info int8_t lqi security_info_t * security)
{
debug (“data\r\n“);
}
void
mlme_associate_confirm (uint8_t status uint16_t short_addr security_info_t * security)
{
if (!associating)
return;
if (status == MAC_SUCCESS) {
SET_MAC_PIB_SHORT_ADDRESS (short_addr);
mac_pib.associated = TRUE;
debug (“Association successful with address “);
debug_hex (short_addr >> 8);
debug_hex (short_addr);
debug (“\r\n“);
} else {
debug (“Association failed: “);
debug_hex (status);
debug (“\r\n“);
}
associating = FALSE;
}
void
mlme_beacon_notify_indication (uint8_t bsn pan_descriptor_t * pan_descriptor
uint8_t sdu_length uint8_t * sdu)
{
// debug (“beacon\r\n“);
}
void
mlme_sync_loss_indication (mac_enum_t reason uint16_t pan_id uint8_t channel security_info_t * security)
{
debug (“Lost sync: “);
debug_hex (reason);
debug (“\r\n“);
}
void
application_symbol_timer_isr (void)
{
static uint16_t counter = 0xffff;
if (counter == 0) {
stay_associated--;
counter = 0xffff;
} else
counter--;
}
/* static void */
/* application_iteration (void) */
/* { */
/* static enum { */
/* APP_SCANNING */
/* APP_ASSOCIATE */
/* APP_ASSOCIATING */
/* APP_DISASSOCIATE */
/* APP_WAIT */
/* APP_IDLE */
/* } app_status = APP_SCANNING; */
/* static pan_descriptor_t pan_descriptor_list[4]; */
/* static uint8_t list_size = 4; */
/* static uint8_t wait; */
/* switch (app_status) { */
/* case APP_SCANNING: */
/* { */
/* uint16_t channels = 0x400; */
/* debug (“Scanning...\r\n“); */
/* if (mlme_scan (PASSIVE_SCAN &channels 8 &list_size NULL pan_descriptor_list NULL) != MAC_SUCCESS) */
/* error (); */
/*
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-01-14 14:40 cc_flasher
目录 0 2011-01-14 14:40 cc_flasher\cc_flasher
文件 5 2011-01-14 14:40 cc_flasher\cc_flasher\.gitignore
目录 0 2011-01-14 14:40 cc_flasher\cc_flasher\bin
文件 0 2011-01-14 14:40 cc_flasher\cc_flasher\bin\.keep
文件 10230 2011-01-14 14:40 cc_flasher\cc_flasher\Doxyfile
文件 1132 2011-01-14 14:40 cc_flasher\cc_flasher\Makefile
文件 966 2011-01-14 14:40 cc_flasher\cc_flasher\Makefile.win32
目录 0 2011-01-14 14:40 cc_flasher\cc_flasher\obj
文件 0 2011-01-14 14:40 cc_flasher\cc_flasher\obj\.keep
目录 0 2011-01-14 14:40 cc_flasher\cc_flasher\obj\ccc
文件 0 2011-01-14 14:40 cc_flasher\cc_flasher\obj\ccc\.keep
文件 488 2011-01-14 14:40 cc_flasher\cc_flasher\Readme.txt
目录 0 2011-01-14 14:40 cc_flasher\cc_flasher\src
目录 0 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc
文件 4108 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\ccmutex.cpp
文件 4463 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\ccthread.cpp
目录 0 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\include
文件 4386 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\include\ccconlist.h
文件 2015 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\include\ccmutex.h
文件 2438 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\include\ccthread.h
文件 2175 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\include\tcpconnection.h
文件 6422 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\include\tcplistener.h
文件 2925 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\include\utils.h
文件 6402 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\tcpconnection.cpp
文件 2129 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\tcplistener.cpp
文件 4887 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccc\utils.cpp
文件 23797 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccdebuginterface.cpp
文件 5650 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccdebuginterface.h
文件 9887 2011-01-14 14:40 cc_flasher\cc_flasher\src\ccdebuginterfaceusb.cpp
............此处省略751个文件信息
相关资源
- IEEE Standard 802.15.4—2011
- 802.15.4g官方协议
- IEEE 802.15.4A-2007
- 802.15.4-2011.pdf
- 802.15.4-中文版前5章.pdf
- IEEE802.15.4e-2012版.rar
- IEEE802.15.4代码
- 802.15.4协议中文版-zigbee
- IEEE Std 802.15.4g官方文档最新
- 802.15.4在ns2下的仿真代码
- AES加密模块verilog代码
- IEEE802.15.4无线收发芯片比较
- RFC6282(中文版)基于IEEE 802.15.4网路的
- RFC4944中文版在IEEE 802.15.4网路上传送
- 802.15.4 无线传感器网络物理层仿真代
- IEEE+802.15.4-2015
- IEEE std 802.15.4-2015
- IEEE802.15.4_opnet_simulation_model_v2.0
评论
共有 条评论