zigbee開發(fā)手記基于jennic5139_第1頁
zigbee開發(fā)手記基于jennic5139_第2頁
zigbee開發(fā)手記基于jennic5139_第3頁
zigbee開發(fā)手記基于jennic5139_第4頁
zigbee開發(fā)手記基于jennic5139_第5頁
已閱讀5頁,還剩13頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、Zigbee開發(fā)手記(基于 JN5139R1)(修改了源代碼,復(fù)制代碼后能直接編譯使用)基礎(chǔ)概念PANPersonal Area Network的縮寫,用于區(qū)別同一Channel中,不同的節(jié)點群組,只有屬于同一個PAN的節(jié)點之間才能相互通訊。Channel通常翻譯成通道,ZigBee所使用的頻率范圍從2400MH容U 2483.5MHz共16個通道,同一個網(wǎng)絡(luò)的設(shè)備必須位于同一個通道中。MACM址 / Extended AddressMACM址是網(wǎng)絡(luò)設(shè)備的一個唯一標(biāo)識碼,這一編碼具有全球唯一性,由IEEE進(jìn)行管理。短地址 / Network Address當(dāng)ZigBee裝置加入一個PAN中時,

2、會由上一層父節(jié)點分配一個16位地址,用于網(wǎng)絡(luò)內(nèi)節(jié)點之間的標(biāo)識和通訊,以減小包的大小。CoordinatorZigBee網(wǎng)絡(luò)中的一種網(wǎng)絡(luò)設(shè)備的角色定義,用以控制整個PAN,每一個PANfB必須有一個 CoordinatorRouterZigBee網(wǎng)絡(luò)中的一種網(wǎng)絡(luò)設(shè)備的角色定義,用以轉(zhuǎn)發(fā)數(shù)據(jù),延伸 ZigBee網(wǎng)絡(luò)的規(guī)模。End-DeviceZigBee網(wǎng)絡(luò)中的一種網(wǎng)絡(luò)設(shè)備的角色定義,作為網(wǎng)絡(luò)的最終端節(jié)點。WSN無線傳感器收集 WSN(Wireless Sensor Network)。Mesh網(wǎng)絡(luò)即”無線蜂窩網(wǎng)格網(wǎng)絡(luò)”,它是一個動態(tài)的可以不斷擴(kuò)展的網(wǎng)絡(luò)架構(gòu),任意的兩個設(shè)備均可以保持無線互聯(lián).Pro

3、file如果需要譯成中文的話我習(xí)慣叫它規(guī)約,但是在這個手冊里面我還是保留它的英文名稱不再翻譯,這樣可以和Jennic的手冊保持一致。每一個ZigBee的網(wǎng)絡(luò)設(shè)備都應(yīng)該使用一個Profile, Profile定義了設(shè)備的應(yīng)用場景,比如是家庭自動化(HC威者是無限傳感器網(wǎng)絡(luò)(WSN),另外定義了設(shè)備的類型還有設(shè)備之間的信息交換規(guī)范。Profile分為兩種,一種是公共的Profile,這種Profile通常由某個組織發(fā)布,用于實現(xiàn)不同廠商生產(chǎn)的ZigBee設(shè)備之間可以互相的通訊使用。私有的Profile通常只是在公司內(nèi)部或者項目的內(nèi)部的一個默認(rèn)的標(biāo)準(zhǔn)。App Obj這個概念的全名叫 Applicat

4、ion objects,這個概念目前是一個純概念范疇的東西,在Jennic的開發(fā)中我們并看不到這個概念白具體表現(xiàn),目前我們可以理解為凡是和一個應(yīng)用的相關(guān)的操作和數(shù)據(jù)都可以算屬于這個應(yīng)用的 Application Object.End Point每一個App Obj連接一個End Point, End Point類似于端口號的概念,他是一個數(shù)據(jù)交換的接口,在 Jennic 開發(fā)中它表現(xiàn)為一個整形的數(shù)值,設(shè)備之間的通訊實際上表現(xiàn)為 end point和end point之間的數(shù)據(jù)交換。 數(shù)據(jù)在通過協(xié)議棧請求發(fā)送的時候都需要指定發(fā)往哪個end point.Cluster通常我們翻譯成簇“。它定義了

5、endpoint和endpoint之間的數(shù)據(jù)交換格式。Cluster包含一系列有著邏輯含義的屬性。通常profile都會定義自己的一系列cluster。每一個endpoint上都會定義自己發(fā)送和接收的cluster.另外需要說明的是兩個特殊的 endpoint定義。Endpoint 0用于配置和管理整個 ZigBee設(shè)備,通過這個 endpoint,應(yīng)用可以和 ZigBee協(xié)議棧的其他層進(jìn)行通訊,進(jìn)行相關(guān)的初始化和配置工作。和這個endpoint接口的是ZigBee Device Object (ZDO)。另外一個特殊的 endpoint是255,這個endpoint用來向所有的 endpoi

6、ntZigbee開發(fā)手記(基于 JN5139R1)進(jìn)行廣播。241-254是保留的endpoint ,用戶在自己的應(yīng)用中不能使用。Application support sublayer提供了數(shù)據(jù)安全和綁定的功能,綁定(Binding)就是將不同的但是兼容的設(shè)備進(jìn)行匹配的一種能力,比如開關(guān)和燈。Network layer完成了大部分的網(wǎng)絡(luò)功能,包括設(shè)備之間的通訊,設(shè)備的初始化,數(shù)據(jù)的路由等等。上面的圖中還提到了SAP的概念,SAP就是Service Access Point如果要翻譯成中文的話我們習(xí)慣叫作服務(wù)訪問接口,也就是數(shù)據(jù)或者管理的接口。不同層之間通過這些接口進(jìn)行數(shù)據(jù)的交換和管理。這又是

7、一個純概念上的含義,沒有具體的表現(xiàn)形式和固定的實現(xiàn)形式。每兩個層之間都有自己的SAP的實現(xiàn)方法。API文檔JN-RM-2014-ZigBeeAppDevAPI-1v8.pdfThis manual describes the Application Development API that provides the interface to the ZigBee stack when developing ZigBee applications.本文檔是zigbee協(xié)議棧的接口函數(shù)JN-RM-2021-BOS-Operating-System-3v1.pdfThis chapter provi

8、des a brief introduction to Jennic s Basic Operating System (BOS) and itsApplication Programming Interface (API). The BOS is designed to be used in conjunction with theJennic ZigBee protocol stack in wireless network applications.JN-RM-2018-ZigBeeAppFramework-API-1v6.pdfThis chapter introduces the A

9、F (Application Framework) APIs.JN-RM-2001-Integrated-Peripherals-API-3v2.pdfThis manual details the C functions of the Jennic Integrated Peripherals Application Programming Interface (API), which allows a wireless network application to interact with the peripherals on a Jennic wireless microcontrol

10、ler. These functions can be used to set up, control and respond to the on-chip peripheral blocks, such as UARTs, timers and general-purpose digital IO lines, amongst others.JN-RM-2017-ZigBeeDeviceProfileAPI-1v4.pdfThis manual describes the ZigBee Device Profile (ZDP) APIs of the Jennic ZigBee stack.

11、WSN代碼解釋(基于zigbee協(xié)議)先給出Coordinator的代碼,后面將詳細(xì)解釋各個函數(shù)的功能以及組網(wǎng)過程/*/*Include files*/*/ #include jendefs.h#include AppHardwareApi.h#include JZ_Api.hZigbee開發(fā)手記(基于 JN5139R1)/以下是定義在文件WSN_Profile.h中。為了簡潔不給WSN_Profile.h文件,把定義給出,方便大家調(diào)試#define WSN_PROFILE_ID 0 x123#define WSN_CID_SENSOR_READINGS 0 x12#define WSN PA

12、N ID0 xAFED#define WSN_CHANNEL17#define WSN DATA SINK ENDPOINT 0 x40#define WSN_DATA_SOURCE_ENDPOINT 0 x41/*/*Macro Definitions*/*/PUBLIC bool bAppTimerStarted;PUBLIC bool bNwkStarted;PUBLIC bool bNodJoined;PUBLIC bool bUartIsStop;PRIVATE uint8 u8Receiver;PRIVATE void vInit(void);PRIVATE void myLoop

13、(void *pvMsg, uint8 u8Dummy);/添加了串口操作PRIVATE void uart0Callback(uint32 u32Device, uint32 u32ItemBitmap);/*/PUBLIC void AppColdStart(void)/* Set network information */JZS sConfig.u32Channel = WSN CHANNEL;JZS_sConfig.u16PanId = WSN_PAN_ID;/* General initialisation */vInit();/* No return from the above

14、 function call */*/PUBLIC void AppWarmStart(void)*/AppColdStart();/* Local FunctionsZigbee開發(fā)手記(基于 JN5139R1)/*/PRIVATE void vlnit(void)/* Initialise Zigbee stack */JZS_u32InitSystem(TRUE);bAppTimerStarted = FALSE; bNwkStarted = FALSE; bNodJoined = FALSE;/LED 燈接 16, 17 口/* Set DIO for LEDs */ vAHI Dio

15、SetDirection(0,316);vAHI_DioSetOutput(316,0);vAHI_UartEnable(E_AHI_UART_0);/vAHI_UartReset(E_AHI_UART_0, TRUE, TRUE); /vAHI UartReset(E AHI UART 0, FALSE, FALSE); vAHI_UartSetBaudDivisor(E_AHI_UART_0, 104);vAHI_UartSetControl(E_AHI_UART_0, E_AHI_UART_EVEN_PARITY,一E_AHI_UART_PARITY_DISABLE,E AHI UART

16、 WORD LEN 8, E AHI UART 1 STOP BIT, E_AHI_UART_RTS_LOW);vAHI_UartSetInterrupt(E_AHI_UART_0,TRUE,E_AHI_UART_FIFO_LEVEL_8);bUartIsStop = TRUE;vAHI_Uart0RegisterCallback(uart0Callback);/* Start BOS */(void)bBosRun(TRUE);/* No return from the above function call */PRIVATE void myLoop(void *pvMsg, uint8

17、u8Dummy) static bool_t bToggle;if (bToggle)Zigbee開發(fā)手記(基于 JN5139R1)vAHI_DioSetOutput(116,0);if(bNodJoined)vAHI_DioSetOutput(117,0);elsevAHI_DioSetOutput(0,116);if(bNodJoined)vAHI_DioSetOutput(0,117);if(bUartIsStop)bUartIsStop = FALSE;vAHI_UartWriteData(E_AHI_UART_0,0 xaa);bUartIsStop = TRUE;bToggle =

18、 !bToggle;(void)bBosCreateTimer(myLoop, , 0, 100, NULL);PRIVATE void uart0Callback(uint32 u32Device, uint32 u32ItemBitmap) u8Receiver = u8AHI UartReadData(E AHI UART 0);vAHI_UartWriteData(E_AHI_UART_0, u8Receiver);/* Functions called by the stack*/*/ void JZA vAppEventHandler(void)if (!bAppTimerStar

19、ted & bNwkStarted)bAppTimerStarted = TRUE;(void)bBosCreateTimer(myLoop, , 0, 20, NULL); /*/PUBLIC void JZA_vPeripheralEvent(uint32 u32Device, uint32 u32ItemBitmap)switch(u32Device)case EAHIDEVICEUART0:Zigbee開發(fā)手記(基于 JN5139R1)if(bUartlsStop)(bUartIsStop = FALSE;u8Receiver = u8AHI_UartReadData(E_AHI_UA

20、RT_0);vAHI_UartWriteData(E_AHI_UART_0, u8Receiver); bUartIsStop = TRUE;/*/PUBLIC void JZA_vAppDefineTasks(void)*/*PUBLIC bool_t JZA_boAppStart(void)JZS_vStartStack(); return TRUE; I*/*PUBLIC bool_t JZA_bAfKvpObject(APS_Addrmode_e eAddrMode,uint16 u16AddrSrc,uint8 u8SrcEP,uint8 u8LQI,uint8 u8DstEP,ui

21、nt8 u8ClusterId,uint8 *pu8ClusterIDRsp,/*/PUBLIC void JZA_vAfKvpResponse( APS_Addrmode_e eAddrMode, uint16 u16AddrSrc, uint8 u8SrcEP, uint8 u8LQI,Zigbee開發(fā)手記(基于 JN5139R1)uint8 u8DstEP, uint8 u8ClusterID,AF_Transaction_s *puTransactionInd)/*/PUBLIC bool_t JZA_bAfMsgObject(APS_Addrmode_e eAddrMode, uin

22、t16 u16AddrSrc, uint8 u8SrcEP,uint8 u8LQI,uint8 u8DstEP,uint8 u8LQI,uint8 *pu8Payload, uint8 u8PayloadLen)/*/PUBLIC void JZA_vStackEvent(teJZS_EventIdentifier eEventId, tuJZS_StackEvent *puStackEvent)uint8 u8InputClusterCnt = 1;uint8 au8InputClusterList口 = WSN_CID_SENSOR_READINGS;uint8 u8OutputClust

23、erCnt = 0;uint8 au8OutputClusterList口 = ;switch(eEventId)case JZS EVENT NWK STARTED:/ load the simple descriptor now that the network has started (void)afmeAddSimpleDesc(WSN_DATA_SINK_ENDPOINT,WSN_PROFILE_ID,0 x0000,Zigbee開發(fā)手記(基于 JN5139R1)0 x00,0 x00,u8InputClusterCnt,au8InputClusterList,u8OutputClu

24、sterCnt,au8OutputClusterList);bNwkStarted = TRUE;break;case JZS_EVENT_NEW_NODE_HAS_JOINED: bNodJoined = TRUE; |break;default:break; 函數(shù)的功能以上是基于zigbee2004協(xié)議開發(fā)PUBLIC void AppColdStart這個函數(shù)是整個程序的入口,Jennic的開發(fā)程序雖然使用標(biāo)準(zhǔn)的C語言進(jìn)行開發(fā),但是它的程序構(gòu)建在Application Support Layer基礎(chǔ)上,所以沒有我們熟悉的main函數(shù)入口,AppColdStart就是我們的起點了。JN-R

25、M-2014-ZigBeeAppDevAPI-1v8 文檔的描述PUBLIC void AppColdStart(void);DescriptionThis function is the main entry point to the user application. Whenever the device is powered up or wakesfrom sleep (except in RAM retention mode see AppWarmStart() below), the program begins to run from this point.This functi

26、on should contain several calls to other routines in order to initialise the ZigBee stack and the Basic Operating System (BOS). These are shown in the example below.ParametersNoneReturnsNoneNone PUBLIC void AppWarmStart這個函數(shù)是程序熱啟動的入口,系統(tǒng)在休眠后重新啟動的時候會自動的調(diào)用這個函數(shù)。在這個應(yīng)用中我們簡單的調(diào)用了 AppColdStart.JN-RM-2014-ZigB

27、eeAppDevAPI-1v8 文檔的描述PUBLIC void AppWarmStart(void);DescriptionZigbee開發(fā)手記(基于 JN5139R1)This function is the re-entry point to the user application when the device wakes from sleep with memory hold. In this case, the user application is still present in memory and all variables maintain their values.

28、If not required, this function can be left empty.ParametersNoneReturnsNonePRIVATE void vInit自定義函數(shù)一個私有函數(shù),被前面的AppColdStart函數(shù)調(diào)用,用來完成一系列的初始化工作。包括初始化系統(tǒng),初始化BOS 一個小型的任務(wù)系統(tǒng),然后我們的程序就在這個小型系統(tǒng)的調(diào)度文檔中這樣描述BOS指示燈,初始化傳感器,最后啟動了 下開始工作,進(jìn)入不同的事件處理函數(shù)。JN-RM-2021-BOS-Operating-System-3v1The BOS is a simple task scheduler. It

29、 is not pre-emptive - tasks run until complete and each task has the same level of priority. The lack of context switching between tasks removes the need for individual stacks and saves on memory space.2igBeeTaskDefaultUser TaskOptiandTaskHardware Peripheral EventsFigure 1: Stack and User Tasks由此可知B

30、OS是一個任務(wù)的調(diào)度系統(tǒng)JN-RM-2014-ZigBeeAppDevAPI-1v8 文檔中的描述PUBLIC uint32 JZS_u32InitSystem(bool_t bColdStart);DescriptionThis function initialises the Jennic ZigBee protocol stack.ParametersbColdStart TRUE if function is called during a cold start, FALSE if called during a warm start ReturnsIf bColdStart is T

31、RUE, returns version number of stack. Otherwise returns 0.該函數(shù)初始化 zigbee協(xié)議棧,必須在 AppWarmStart或者AppColdStart中調(diào)用PRIVATE void myLoop(void *pvMsg, uint8 u8Dummy)自定義函數(shù)LED燈的閃爍由BOS定時調(diào)用,實現(xiàn)自己想要實現(xiàn)的功能,這里只是簡單控制在這個函數(shù)最后調(diào)用了bBosCreateTimer函數(shù),Zigbee開發(fā)手記(基于 JN5139R1)在文檔 JN-RM-2021-BOS-Operating-System-3v1 中這樣描述:bool_t

32、bBosCreateTimer(void (*pfvTimerHandler)(void *, uint8),void *pvMsg,uint8 u8MsgSize,uint32 u32Delay,uint8 *pu8TimerId);DescriptionThis function creates a software timer for use by the BOS, based on the internal hardware tick timer. Once created, the timer is assigned a unique timer ID. The created ti

33、mer runs for the specified period of time. Once the timer has expired, the specified timer handler function is called and will receive the specified message.! Caution:The created timer is based on the on-chip tick timer. Your application must not use this hardware timer, otherwise abnormal operation

34、 of the BOS will result.! Caution:Do not create a timer in interrupt context, as this will cause the BOS to malfunction.Parameters*pfvTimerHandler Pointer to timer handler function that will be called by the BOS once the timer has expired*pvMsg Pointer to the message to be sent to timer handler (the

35、 data type on the transmission and reception sides must be the same)u8MsgSize Length of message to be sent, in bytesu32Delay This parameter determines the timeout period for which the timer will run. The specified value is a period multiplier - a multiple of 10 milliseconds. For example, for a 50-ms

36、 timeout period, set this value to 5*pu8TimerId Pointer to location to receive ID for the created timer. Can be NULL if the ID is not wanted (the ID is only required by the application if it wants to remove a timer before it has expired).ReturnsTRUE Timer successfully createdFALSE Unable to create t

37、imerIf the function returns FALSE, you can use the function eBosGetLastError() to obtain further information. One of the following error IDs may be returned:Error IDDescriptionE_NULL_FUNCTIONThe timer handler pointer (*pfvTimerHandler) is NULLE_NO_MEMORYThere is insufficient memory to create the tim

38、erE_NO_MSGMessage is NULL (but message length is not zero)在描述上說到因為 bBosCreateTimer函數(shù)使用的是芯片上的定時器,所以要保證這個定時器沒有用于其他用 途,不然會出現(xiàn)錯誤;同時,這個函數(shù)是一次性函數(shù),就是被 BOS調(diào)用一次,所以要實現(xiàn)周期調(diào)用處理函 數(shù)則必須重新調(diào)用 bBosCreateTimer。PRIVATE void uart0Callback(uint32 u32Device, uint32 u32ItemBitmap) 串口 0的中斷回調(diào)函數(shù)。10Zigbee開發(fā)手記(基于 JN5139R1)PUBLIC v

39、oid JZA_vAppEventHandler周期性調(diào)用函數(shù),協(xié)議棧會周期性的調(diào)用這個函數(shù),這里我們定義了一個時鐘。JN-RM-2014-ZigBeeAppDevAPI-1v8 文檔描述:PUBLIC void JZA_vAppEventHandler(void);DescriptionThis is a user application function, which is regularly called by the BOS. This function does not require any specific event to occur in order to be called

40、. It may be used as the main user task, or to handle hardware events triggered from within an interrupt context. Note that events passed to JZA_vStackEvent will indicate when the device has started or joined a network, so activities that require an active network should be delayed until then.This fu

41、nction should only operate for a short time before returning, to allow the BOS to schedule other activities.ParametersNoneReturnsNonePUBLIC void JZA_vPeripheralEvent發(fā)生外圍部件事件的時候調(diào)用的函數(shù)PUBLIC void JZA_vAppDefineTasks協(xié)議棧要求用戶定義自定義任務(wù)的時候調(diào)用的函數(shù)PUBLIC bool_t JZA_boAppStart系統(tǒng)初始化薪后會調(diào)用這個函數(shù),通常我們在這個函數(shù)中進(jìn)行設(shè)備描述。JN-RM-

42、2014-ZigBeeAppDevAPI-1v8 文檔描述:PUBLIC bool_t JZA_boAppStart(void);DescriptionThis function allows the user application to register any endpoint descriptors before starting the ZigBee stack.It can also be used to start the device running as a ZigBee Co-ordinator, Router or End Device, through a call t

43、o the ZigBee stack.ParametersNoneReturnsThis function should always return TRUE.PUBLIC void JZS_vStartStack(void);DescriptionThis function starts the Jennic ZigBee protocol stack. The device will start to function as a Co-ordinator, Router or End Device, as specified by the makefile. A Co-ordinator

44、will try to start a network. A Router or End Device will try to find and join an existing network.ParametersNoneReturnsNone11Zigbee開發(fā)手記(基于 JN5139R1)PUBLIC bool_t JZA_bAfKvpObject收到KVP調(diào)用的函數(shù)。PUBLIC void JZA_vAfKvpResponse收到KVP回應(yīng)的時候協(xié)議棧調(diào)用的函數(shù)PUBLIC uint8 JZA_u8AfMsgObject收到MsgObject調(diào)用的函數(shù)。JN-RM-2014-ZigBe

45、eAppDevAPI-1v8 文檔描述:PUBLIC bool_t JZA_bAfKvpObject( AF_Addrmode_e eAddrMode,uint16 u16AddrSrc,uint8 u8SrcEPuint8 u8LQI,uint8 u8DstEP,uint8 u8ClusterID,uint8 *pu8ClusterIDRsp,AF_Transaction_s *puTransactionInd, AF_Transaction_s *puTransactionRsp);DescriptionThis function receives incoming KVP command

46、 frames. The data passed back by this function is used by the ZigBee stack to construct a KVP response frame to the sender, where one is required.ParameterseAddrMode Address mode, one of: APS_ADDRMODE_NOT_PRESENT - Indirect transmission APS_ADDRMODE_SHORT - Direct transmission u16AddrSrc Network (sh

47、ort) address of source device u8SrcEP Source endpoint number (in range 1 to 240) u8LQI Link Quality Index (LQI) for received frame u8DstEP Destination endpoint number (in range 1 to 240) u8ClusterID Requested Cluster ID on the destination endpointpu8ClusterIDRsp Pointer to Cluster ID for the respons

48、epuTransactionInd Pointer to transaction structure received in commandpuTransactionRsp Pointer to transaction structure for the responseReturnsTRUE - Response will be sent (only for command types that require a response)FALSE - No response will be sentPUBLIC void JZA_vZdpResponse收到ZDP回應(yīng)的時候協(xié)議棧調(diào)用的函數(shù)PU

49、BLIC void JZA_vStackEvent協(xié)議棧發(fā)生網(wǎng)絡(luò)事件的時候調(diào)用這個函數(shù),在這個例程中我們在這個函數(shù)中判斷是否已經(jīng)加入了網(wǎng)絡(luò),或者是否有新節(jié)點接入。JN-RM-2014-ZigBeeAppDevAPI-1v8 文檔描述:Stack EventsEvent Id/Structure12Zigbee開發(fā)手記(基于 JN5139R1)Field DescriptionValuesJZS_EVENT_APS_DATA_CONFLRMkpsDataConfirmEventGenerated when a data frame is passed to the stack by the ap

50、plication using a call to afdeDataRequest().u8StatusAPS enumerations: 0 x00: APS_ENUM_SUCCESS 0 x04:Indicates success if the frame wasAPS_ENUM_NOT_SUPPORTED0 x08:successfullypassed down through theAPS_ENUM_NO_BOUND_DEVICEstack to the MAC, and an ACK was receivedNLDEenumerations:0 xC3:from the next h

51、op.NWK_ENUM_INVALID_REQUEST0 xD0:Otherwise contains the error code from theNWK_ENUM_ROUTE_DISCOVERY_FAILED 0 xD1:stack layer at which the frame failed.NWK_ENUM_TRANSACTION_EXPIREDNote:Receivinga statusofMCPSenumerations:0 xE1:APS_ENUM_SUCCESS indicates that a frameMAC_ENUM_CHANNEL_ACCESS_FAILURE 0 x

52、E5:has reached the next hop to itsMAC_ENUM_FRAME_TOO_LONG0 xE8:destination (and does not confirm that itMAC_ENUM_INVALID_PARAMETER0 xE9:has reached its final destination, unlessMAC_ENUM_NO_ACK0 xF0:this is a single hop away).MAC_ENUM_TRANSACTION_EXPIRED0 xF1:MAC_ENUM_TRANSACTION_OVERFLOWu16DstAddr0

53、x0000 - 0 xFFFENetwork address of the remote device.u8DstEPEndpoint address on the remote device.1 - 240u8SrcEPEndpoint address on the local device.1 - 240JZS_EVENT_NWK_JOINED_AS_ROUTERwkJoinedEventGenerated on a Router which has just successfully joined a network.u16Addr0 x0000 - 0 xFFFENetwork add

54、ress assigned to Router.JZS_EVENT_NWK_JOINED_AS_ENDDEVIsNwkJoinedEventGenerated on an End Device which has just successfully joined a network.u16AddrNetwork address assigned to End Device.0 x0000 - 0 xFFFEJZS_EVENT_NWK_STARTEDGenerated on a Co-ordinator which has just successfully started a network.

55、Event Id/StructureField DescriptionValuesJZS_EVENT_CONTEXT_RESTOREDGenerated when a node is started with a valid network context in its Flash memory. The node13Zigbee開發(fā)手記(基于 JN5139R1)starts running using the stored context instead of attempting to start or join a new network.ZS_EVENT_FAILED_TO_START

56、_NETWORKGenerated on a Co-ordinator that has tried to start a network but failed because there is already a network with the same PAN ID.JZS_EVENT_FAILED_TO_JOIN_NETWORKGenerated on a Router or End Device that has tried to join a network but failed, eitherbecause no network can be found or because t

57、he network will not allow the device to join.JZS_EVENT_NEW_NODE_HAS_JOINsNfewNodeEventGenerated by a Router or the Co-ordinator whena new child node joins it. Contains information on new child node.u16ShortAddrNetwork address assigned to child.0 x0000 - 0 xFFFEpsExtAddrPointer to IEEE (MAC) address

58、of child.32-bit addressu8CapabilityInfoContains the capability information for the child.Refer to ZigBee Specificationfor furtherdetailsJZS_EVENT_REMOVE_NODDRemoveNodeEventGenerated after a call to JZS_vRemoveNode(). Includes status information on process ofremoving child node from a Router or the C

59、o-ordinator.psExtAddrPointer to IEEE (MAC) address of child32-bit addresseStatusStatus of leave request.0 x00:NWK_ENUM_SUCCESS0 xC2:NWK_ENUM_INVALID_REQUEST0 xC8:NWK_ENUM_UNKNOWN_DEVICE0 xCB:NWK_ENUM_LEAVE_UNCONFIRMED0 xD1:NWK_ENUM_TRANSACTION_EXPIREDJZS_EVENT_LEAVE_INDICATIONsLeaveIndicationEventGe

60、nerated by a Co-ordinator or Router upon the successful exit of one of its children from the network. It is also generated on a device that has been asked to leave by its parent.psExtAddrPointer to IEEE (MAC) address of the child.32-bit address, or NULL if leave request received from parentEvent Id/

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論