常用API(协议栈版本ZStack-CC2530-2.3.0-1.4.0)

1.数组处理
拷贝数据Generic memory copy:

void *osal_memcpy( void *dst, const void GENERIC *src, unsigned int len )
如:osal_memcpy(buf,pkt->cmd.Data,2)

初始化数组Set memory buffer to value:

void *osal_memset( void *dest, uint8 value, int len )
如:osal_memset(buf,0,3)  //将数组中数据清零

2.灯光控制接口
灯光闪烁Blink the leds

void HalLedBlink (uint8 leds, uint8 numBlinks, uint8 percent, uint16 period)
如:HalLedBlink(HAL_LED_1,0,50,500)   //LED1间隔0.5s闪烁

灯状态设置Tun ON/OFF/TOGGLE given LEDs:

uint8 HalLedSet (uint8 leds, uint8 mode)
如:HalLedSet(HAL_LED_1,HAL_LED_MODE_ON)  //关闭LED1

你可能感兴趣的:(Zigbee协议栈学习)