期间参加了一次天池的比赛,然后就来了项目,,,(无力),比赛的内容也忘得差不多了,有时间再补上。
项目需要用zigbee做通信,为了开发得快一点这里就使用了Z-Stack,这是一个近似于小型操作系统管理的协议栈。我们先来看以下它的工作流程。
一、OSAL
OSAL管理着开发板上的各种资源,是一个为操作系统,他的工作流程如下。
首先我们需要知道整个协议栈程序的开端,程序的开端在Zmain文件夹的Zmian.c文件中,在这个c文件中可以看到一段如下的程序:
int main( void )
{
// Turn off interrupts
osal_int_disable( INTS_ALL );
// Initialization for board related stuff such as LEDs
HAL_BOARD_INIT();
// Initialize board I/O
InitBoard( OB_COLD );
// Initialze HAL drivers
HalDriverInit();
// Initialize NV System
osal_nv_init( NULL );
// Initialize the MAC
ZMacInit();
// Determine the extended address
zmain_ext_addr();
#if defined ZCL_KEY_ESTABLISH
// Initialize the Certicom certificate information.
zmain_cert_init();
#endif
// Initialize basic NV items
zgInit();
#ifndef NONWK