使用Mesh的拓樸結構。
請問一下如何於IAR內使用RSSI指令,抓取每個end device間的rssi值。由於使用ti內建的定位程式,僅能抓取到一開始綁定時的rssi值,但希望可以做到可以每格一段時間抓取一次rssi值,請問一下該使用哪個api?謝謝
Susan Yang:
建议您参考zcl_samplelight.c – zclSampleLight_event_loop():
uint16 zclSampleLight_event_loop( uint8 task_id, uint16 events ){afIncomingMSGPacket_t *MSGpkt;(void)task_id; // Intentionally unreferenced parameterif ( events & SYS_EVENT_MSG ){while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleLight_TaskID )) ){int8 msgRssi = MSGpkt->rssi;uint8 msgCorrelation = MSGpkt->correlation;#ifdef LCD_SUPPORTEDHalLcdWriteStringValue( "RSSI: ", msgRssi, 10, HAL_LCD_LINE_1 );HalLcdWriteStringValue( "Correlation: ", msgCorrelation, 10,HAL_LCD_LINE_2 );#endifswitch ( MSGpkt->hdr.event )
…
该code在C:\Texas Instruments\ZStack-CC2530\Projects\zstack\HomeAutomation
zhung mao-jen:
回复 Susan Yang:
想請問使用CC2430是否也是參考SAMPLELIGHT範例