宅基地出品-24zigbee學(xué)習(xí)之路之協(xié)議棧綁定_第1頁
宅基地出品-24zigbee學(xué)習(xí)之路之協(xié)議棧綁定_第2頁
宅基地出品-24zigbee學(xué)習(xí)之路之協(xié)議棧綁定_第3頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、ZigBee 四種綁定方式在 Z-Stack 中的應(yīng)用/yqh2007/archive/2011/04/29/2032487.html本文是作者根據(jù) TI Z-Stack 開檔,ZigBee Specificat on-2007,Zigbee Wireleetworking等英文資料整合和翻譯而成,采用中英雙語對照方便讀者理解,文中翻譯不當(dāng)之處,望廣大不吝賜教。推廣 ZigBee 技術(shù),提高國內(nèi)電子行業(yè)的國際,是無線通訊工程師的愿景。he Zigbee 2006 release,the binding mechanism is implemented in all deviand is cal

2、led source binding. Binding allows anapplication to send a packet without knowing the destinat on address,the APS layer determines the destination address from tsbinding table,and then forwards the message on to the destinat on appl cation(or multiple applications)roup.ZigBee2006 版本中規(guī)定,在全部節(jié)點中實現(xiàn)綁定機制,

3、并將其稱為源綁定。綁定機制允許一個應(yīng)用服務(wù)在不知道目標(biāo)地址的情況下方(的應(yīng)用服務(wù))發(fā)送數(shù)據(jù)包。發(fā)送時使用的目標(biāo)地址將由應(yīng)用支持子層從綁定表中自動獲得,從而能使消息順利被目標(biāo)節(jié)點的一個或多個應(yīng)用服務(wù),乃至分組接收。Binding Table1.Defined in RAM,ban be saved in Flash if the NV_RESTORE compiler opt on is used2.Stored on source node(REFLECTOR compiler opt on required)3.Entries map messages to theirended desti

4、nat on4.Each entryhe binding tabletains the following:typedef structu16 srcIdx;/Source indexu8 srcEP;/Source endpou8 dstGroupMode;/Specifies normalroup addressingu16 dstIdx;/Destinat on indexroup addressu8 dstEP;/Destination endpou8 numClusterIds;/Number of cluster IDshe clusterIdList belowu16 clust

5、erIdListMAX_BINDING_CLUSTER_IDS;BindingEntry_t;綁定表1.綁定表存放的位置是內(nèi)存中預(yù)先定義的塊,如果編譯選項 NV_RESTORE 被激活,也能保存在 Flash 里。2.綁定表放置在源節(jié)點(需要激活編譯選項 REFLECTOR)。3.綁定表的條目把需要發(fā)送的消息到它們的目標(biāo)地址上。4.綁定表中每個條目包括以下內(nèi)容:5.綁定表條目結(jié)構(gòu)體的定義typedef structu16 srcIdx; /源地址索引u8 srcEP; /源端點u8 dstGroupMode; /指定尋址模式u16 dstIdx; /目標(biāo)地址索引或者分組號u8 dstEP; /

6、目標(biāo)端點u8 numClusterIds; /在簇標(biāo)識符表中簇標(biāo)識符的個數(shù)u16 clusterIdListMAX_BINDING_CLUSTER_IDS; /簇標(biāo)識符表BindingEntry_t;Simple Description - How to bind deviA binding is a logical link betn two deviat the appl cation layer. Multipindings can be created on a device, one for eachtype of data packet. In addit on, a bindin

7、g may have moren one destination device(one-to-many bindings).For exle,in a lighting network w th multiple sw tches and lights,each sw tch willtrol one or more light.hat case,abinding should be created in each switch.This allows the applicat on to send the data packets without knowing the actualdest

8、ination address.Once a binding is created on the source device,the appl cation can send data without specifying a destination address(he callto zb_SendDataRequest(),the inval d address-0 xE should be used as the destination).This will cause the stack to look up thedestination in tsernal binding taba

9、sed on thed identifier of the packet.There can be moren one destinationhe binding entry.hat case,the stack will automatically send a copy of the packetto each destinat on specifiedhe binding entry.Also,if the NV_RESTORE compile option is enabled when building the image,the stack will save the bindin

10、g entries to non-volatileram This is usefulhe device has an accidental reset(or if the batteries need to be changed on the dev ce),the dev ce canrecover automatically without the user having to setup the bindings again.There are two mechanisms available tofigure dev ce bindings.If the extended addre

11、ss of the destination device is known,thezb_BindDev ceRequest()can be to create a binding entry. If the extended address is not known,a“push button”strategy may beemployed.his case,the destination device isput in a s e where it will respond to match requests by iing thezb_AllowBindResponse().Then th

12、e zb_BindDeviceRequest()is ied on the source device winull address.In add tion,bindings can be setup by using an external commiss oning tool.Notet bindings can only be createdbetn“complementary”devi.t is,the binding will only succeed if both devihave registered the samed_id intheir simple descriptor

13、 structures and one device has thed as an“output”while the other dev ce has t as an“input”.概述-怎樣綁定節(jié)點綁定指的是兩個節(jié)點在應(yīng)用層上建立起來的一條邏輯鏈路。在同一個節(jié)點上可以建立多個綁定服務(wù),分別對應(yīng)不同種類的數(shù)據(jù)包。此外,綁定也允許有多個目標(biāo)節(jié)點(一對多綁定)。舉個例子,在一個燈光網(wǎng)絡(luò)中,有多個開關(guān)和燈光設(shè)備,每一個開關(guān)可以控制一個或以上的燈光設(shè)備。在這種情況下,需要在每個開關(guān)中建立綁定服務(wù)。這使得開關(guān)中的應(yīng)用服務(wù)在不知道燈光設(shè)備確切的目標(biāo)地址時,可以順利地向燈光設(shè)備發(fā)送數(shù)據(jù)包。一旦在源節(jié)點上建立

14、了綁定,其應(yīng)用服務(wù)即可向目標(biāo)節(jié)點發(fā)送數(shù)據(jù),而不需指定目標(biāo)地址了(調(diào)用 zb_SendDataRequest(),目標(biāo)地址可用一個無效值 0 xE 代替)。這樣,協(xié)議棧將會根據(jù)數(shù)據(jù)包令標(biāo)識符,通過自身的綁定表查找到所對應(yīng)的目標(biāo)設(shè)備地址。在綁定表的條目中,有時會有多個目標(biāo)端點。這使得協(xié)議棧自動地重復(fù)發(fā)送數(shù)據(jù)包到綁定表指定的各個目標(biāo)地址。同時,如果在編譯目標(biāo)文件時,編譯選項 NV_RESTORE 被打開,協(xié)議棧將會把綁定條目保存在非易失性器里。因此當(dāng)意外重啟(或者節(jié)點電池耗盡需要更換)等突況的發(fā)生時,節(jié)點能自動恢復(fù)到掉電前的工作狀態(tài),而不需要用戶重新設(shè)置綁定服務(wù)。配置設(shè)備綁定服務(wù),有兩種機制可供選擇

15、。如果目標(biāo)設(shè)備的擴展地址(64 位地址)已知,可通過調(diào)用 zb_BindDev ceRequest()建立綁定條目。如果目標(biāo)設(shè)備的擴展地址未知,可實施一個“按鍵”策略實現(xiàn)綁定。這時,目標(biāo)設(shè)備將首先進(jìn)入一個允許綁定的狀態(tài),并通過zb_AllowBindResponse()對配對請求作出響應(yīng)。然后,在源節(jié)點中執(zhí)行 zb_BindDev ceRequest()(目標(biāo)地址設(shè)為無效)可實現(xiàn)綁定。此外,使用節(jié)點外部的委托工具(通常是協(xié)調(diào)器)也可實現(xiàn)綁定服務(wù)。請注意,綁定服務(wù)只能在“互補”設(shè)備之間建立。那就是,只有分別在兩個節(jié)點的簡單描述結(jié)構(gòu)體(simple descriptor structure)中,同

16、時d_id)并且方向相反(一個屬于輸出指令了相同令標(biāo)識符(“output”,另一個屬于輸入指令“input”),才能成功建立綁定。There are 4 ways to build a binding table:建立一個綁定表格有四種方法可供選擇:lAutomatic BindingA.Sending device broadcastsrsonal ad”on the network with:1)Address,Profile ID,Cluster Lists2)Match Descript on Request-ZDP_MatchDescReq()B.Compatible devresp

17、ondC.Response handled and validated by the ZDOD.Sender application stores binding record in binding table自動綁定一、 負(fù)責(zé)發(fā)送消息的設(shè)備在網(wǎng)絡(luò)上廣播帶有如下參數(shù)的“個人公告”(al Advertisement):(1) 地址,配置文件標(biāo)識符,簇集合列表;(2) 描述符匹配請求- ZDP_MatchDescReq()。二、 匹配的設(shè)備會作出響應(yīng)。三、 由 ZDO 處理和驗證響應(yīng)。四、 負(fù)責(zé)發(fā)送消息的設(shè)備建立綁定表并保存綁定。五、 這種方法有時也稱“服務(wù)發(fā)現(xiàn)”,“自動找尋”或者“自動匹配”。l

18、Zigbee Device Object Bind Requesta commising tool canl the device to make a binding record,or namedAssisted Binding.Any device or appl cation can send a ZDO message to another device(over the air)to build a binding record fort other devicehe network.This is called Assisted Binding and it will create

19、 a binding entry for the sending device.The Commising ApplicationAn application can do this by calling ZDP_BindReq()defined in ZDProfile.hwith 2 applications(addresses and endpo s)and thecluster ID wantedhe binding record.Theparameter(dstAddr)is the short address of the bindings sourceaddress(where

20、the binding record will be stored).Make sure you have the feature enabled in ZDfig.hZDO_BIND_UNBIND_REQUEST.You can use ZDP_UnbindReq()w th the same parameters to remove the binding record.Thedevice will send back a Zigbee Dev ce Object Bind or Unbind Response message which the ZDO code will parse a

21、ndnotify ZDApp.c by calling ZDApp_BindRsp()or ZDApp_UnbindRsp()w th the s us of the act on.For the Bind Response,the s us returned from the coordinator will be ZDP_SUCS,ZDP_TABLE_FULL orZDP_NOT_SUPPORTED.For the Unbind Response, the s us returned from the coordinator will be ZDP_SUCS,ZDP_NO_ENTRY or

22、ZDP_NOT_SUPPORTED.External device initiated binding(“external”meaning not a participant of the resultant binding)External device applicat on calls ZDP_BindReq()with 2 applications(addresses and endpo s)and the cluster ID to binTheparameter is where the binding record will be stored Make sure you hav

23、e REFLECTOR compile flag enabledZigBee 設(shè)備對象綁定請求-一種告訴目標(biāo)設(shè)備建立綁定的委托工具,也稱輔助綁定。任何一個設(shè)備或應(yīng)用服務(wù),都能通過無線信道向網(wǎng)絡(luò)上的另一個設(shè)備發(fā)送一個 ZDO 消息,幫助其建立一個綁定。這稱為輔助綁定,在消息發(fā)向的設(shè)備上會建立一個綁定條目。委托綁定的申請:任一個應(yīng)用服務(wù),通過向 ZDP_BindReq()defined in ZDProfile.h提供綁定所需要的應(yīng)用服務(wù)參數(shù)(地址和端點)以及簇標(biāo)識號(clusterID),即可啟動委托綁定的申請。第一個參數(shù)(消息發(fā)送目標(biāo)地址)是綁定源節(jié)點的短地址(即保存綁定的節(jié)點地址,這是因為

24、ZDP 需委托應(yīng)用框架 AF 輔助實現(xiàn)綁定,如果節(jié)點本身是 REFLECTOR,并且希望保存綁定,則此消息發(fā)送的目標(biāo)地址就是本地的 AF,這與目標(biāo)節(jié)點的地址 DestinationAddr of Receiving device 不同)。注意事項:確保ZDfig.h中 ZDO_BIND_UNBIND_REQUEST 特性已經(jīng)打開!你可以通過 ZDP_UnbindReq()(使用相同參數(shù))來移除綁定。被請求輔助綁定的目標(biāo)設(shè)備會返回的 ZDO 申請綁定或者解除綁定的應(yīng)答消息。此 ZDO 消息會被并通過調(diào)用 ZDApp_BindRsp()或ZDApp_UnbindRsp()告知 ZDApp.c 此次

25、請求的結(jié)果。對于申請綁定的應(yīng)答消息,從協(xié)調(diào)器返回的狀態(tài)可能有 ZDP_SUCS,ZDP_TABLE_FULL or ZDP_NOT_SUPPORTED。對于解除綁定的應(yīng)答消息,從協(xié)調(diào)器返回的狀態(tài)可能有 ZDP_SUCS,ZDP_NO_ENTRY or ZDP_NOT_SUPPORTED。綁定是由外部的設(shè)備發(fā)起(“外部”的意思是發(fā)起綁定的不是綁定的對象之一)。外部設(shè)備應(yīng)用程序以兩個應(yīng)用服務(wù)(地址和端點)和簇標(biāo)識符作為參數(shù)調(diào)用 ZDP_BindReq ()發(fā)起綁定。第一個參數(shù)就是綁定保存的設(shè)備地址。確保編譯選項 REFLECTOR 已經(jīng)打開!ZDP_BindReq()This iually a m

26、acrot calls ZDP_BindUnbindReq().This call will build and send a Bind Request.Use this function to requestthe Zigbee Coordinator to bind appl cation based on clusterID.PrototypeafS us_t ZDP_BindReq(zAddrType_t*dstAddr,byte*SourceAddr,byte Srcntf,byte ClusterID,byte*Destinat onAddr,byte Dstntf,byte Se

27、curitySuite);Parameter DetailsDstAddr-The destinat on address. (the bindings source address)SourceAddr64 b t IEEE address of the device generating the messages.Srcntfendpo / erface of the application generating the messages.ClusterIDcluster ID of the messages to bind.DestinationAddr64 bit IEEE addre

28、ss of the device receiving the messages.Dstntfendpo / erface of the application receiving the messages.Secur tySuite-Type of secur ty wanted on the message.ReturnafS us_tThis function uses AF to send the message,so the s us values are AF s us values defined in ZS us_t inZComDef.h.函數(shù):ZDP_BindReq()實際上

29、是調(diào)用 ZDP_BindUnbindReq()的一個宏。這一調(diào)用會產(chǎn)生并發(fā)送一個綁定的請求,使得 ZigBee 協(xié)調(diào)器根據(jù)簇標(biāo)識號clusterID 對相應(yīng)的應(yīng)用服務(wù)實施綁定。函數(shù)原型:afS us_t ZDP_BindReq(zAddrType_t*dstAddr,byte*SourceAddr,byte Srcntf,byte ClusterID,byte*Destinat onAddr,byte Dstntf,byte SecuritySuite);參數(shù)細(xì)節(jié):DstAddr-消息發(fā)送地址 (負(fù)責(zé)綁定的設(shè)備地址)SourceAddr源節(jié)點的 64 位 IEEE 地址Srcntf源節(jié)點應(yīng)用服

30、務(wù)的端點ClusterID需要綁定的簇標(biāo)識符DestinationAddr目標(biāo)節(jié)點的 64 位 IEEE 地址Dstntf目標(biāo)節(jié)點應(yīng)用服務(wù)的端點Secur tySuite-安全機制模式返回值:afS us_t此函數(shù)需要借助 AF 發(fā)送(AF_DataRequest())生成的消息,因此返回值是 AF 狀態(tài)值。lZigbee Device Object End Device Bind Request2 devicanl the coordinatort they would like to setupa binding table record.The coordinator will make

31、 the match up and create the binding table entrieshe 2devi.Or named Centralized Binding.This mechanism uses a button press or other similar action at the selected devito bind within a specific timeout period. TheEnd Device Bind Request messages are collected at the coordinator withhe timeout period

32、and a resulting Binding Table entryis created based on the agreement of profile ID and cluster ID. The default end dev ce bindingtimeout(APS_DEFAULT_MAXBINDING_TIME)is 16 seds(defined in nwk_globals.h),ban be changed if added tof8wfig.cfg.Youll noticet all sle appl cations have a functionndles key e

33、ventsfor exle, TransmitApp_HandleKeys()inTransmitApp.c.This function calls ZDApp_SendEndDev ceBindReq()in ZDApp.c,which gathers all the information for theapplications endpoand calls ZDP_EndDev ceBindReq()ZDProfile.cto send the message to the coordinator.Or,as inSleLight and SleSwitch,ZDP_EndDev ceB

34、indReq()is called directly with only the cluster IDs relevant to the lOn/Offfunctions.The coordinator will receiveingData()in ZDProfile.cand parse ZDO_ProsEndDeviceBindReq()inZDObject.cthe message and call ZDApp_EndDeviceBindReqCB()in ZDApp.c,which callsZDO_MatchEndDeviceBind()ZDObject.c to pros the

35、 request.Coordinator receives and holds the request until a request from another node is received(16 seds is the default).When the coordinator receives 2 matching End Dev ce Bind Requests,it will start the pros of creating source binding entrieshe requesting dev.The coordinator follows the following

36、 pros,aming matches were foundhe ZDO End DeviceBind Requests:1.Send a ZDO Unbind Request to thedevice.Device Bind is toggle pros,so the unbind is sentto remove anexisting bind entry.2.Wait for the ZDO Unbind Response,if the response s us is ZDP_NO_ENTRY,send a ZDO Bind Request to make the bindingent

37、ryhe source device.If the response s us is ZDP_SUCS,move on to the cluster ID for thedevice(the unbindremoved the entrytoggle).3.Wait for the ZDO Bind Response.When received,move on to the next cluster ID for thedevice.4.When thedevice is done,do the same pros with the sed dev ce.5.When the sed devi

38、ce is dond the ZDO End Dev ce Bind Response messages to both theand sed device.ZigBee 設(shè)備對象終端節(jié)點綁定請求-兩個設(shè)備可向協(xié)調(diào)器告知他們想建立一個綁定表。協(xié)調(diào)器通過安排配對并分別在這兩個設(shè)備上建立綁定表條目,也稱集中式綁定。這一機制規(guī)定在指定的時限內(nèi),通過按鍵或者其他類似動作對指定的設(shè)備實施綁定。在規(guī)定的時限內(nèi),協(xié)調(diào)器負(fù)責(zé)收集終端設(shè)備綁定請求消息,然后根據(jù)相同的配置文件標(biāo)識號和簇標(biāo)識號建立相應(yīng)的綁定表格條目。默認(rèn)的終端節(jié)點綁定時限(APS_DEFAULT_MAXBINDING_TIME)是 16秒(在 nw

39、k_globals.h 中定義),若要修改可在 f8wfig.cfg 中新增數(shù)值。所有例子的應(yīng)用服務(wù)中都有一個響應(yīng)按鍵事件的函數(shù)(例如,Transm tApp.c 中的 TransmitApp_HandleKeys())。這一響應(yīng)函數(shù)調(diào)用ZDApp_SendEndDev ceBindReq()在 ZDApp.c 中收集該應(yīng)用服務(wù)端點的所有信息,然后再調(diào)用 ZDP_EndDeviceBindReq()在ZDProfile.c 中把給協(xié)調(diào)器。或者,像 SleLight 和 SleSw tch 例程中,按鍵后直接調(diào)用 ZDP_EndDeviceBindReq(),僅把與開關(guān)燈函數(shù)相關(guān)的簇標(biāo)識號發(fā)送出

40、去。這一消息將會被協(xié)調(diào)器接收ingData()in ZDProfile.c和ZDO_ProsEndDeviceBindReq()in ZDObject.c,然后讓回調(diào)函數(shù) ZDApp_EndDev ceBindReqCB()in ZDApp.c調(diào)用 ZDO_MatchEndDeviceBind()ZDObject.c處理這一請求。當(dāng)協(xié)調(diào)器接收到第一個綁定請求時,他會在一定的時限內(nèi)保留這一請求并等待第二個請求的出現(xiàn)。(默認(rèn)的最長時間間隔是 16 秒)。一旦協(xié)調(diào)器接收到兩個需要匹配的終端設(shè)備綁定請求時,它就會啟動綁定過程,為發(fā)出請求的設(shè)備建立源綁定條目。假設(shè)在 ZDO 終端設(shè)備綁定請求中找到匹配,

41、協(xié)調(diào)器將采取以下步驟:1. 協(xié)調(diào)器發(fā)送一個 ZDO 解除綁定請求給第一個設(shè)備。終端設(shè)備綁定是一個切換過程,所以解除綁定請求需要發(fā)送給第一個設(shè)備,以便移除一個已有的綁定條目。2. 等待 ZDO 解除綁定的應(yīng)答,如果返回的狀態(tài)是 ZDP_NO_ENTRY,協(xié)調(diào)器可以發(fā)送一個 ZDO 綁定請求,在源設(shè)備(ZDP_EndDeviceBindReq()第一個參數(shù)指定的地址)中建立綁定條目。假如此時返回的狀態(tài)是 ZDP_SUCS,可繼續(xù)處理第一個設(shè)備的簇標(biāo)識符(解除綁定指令已經(jīng)移除了綁定條目,即已經(jīng)切換完成)。3.等待 ZDO 綁定應(yīng)答。收到以后,繼續(xù)處理第一個設(shè)備的下一個簇標(biāo)識符。4.等第一個設(shè)備完成了

42、以后,在第二個設(shè)備上實行同樣的過程。5.等第二個設(shè)備也完成了,協(xié)調(diào)器向兩個設(shè)備發(fā)送 ZDO 終端設(shè)備綁定應(yīng)答消息。注意打開編譯選項:REFLECTOR 和 ZDO_COORDINATORZDApp_SendEndDeviceBindReq()-Pro:The binding informat on resides on the network reflector device, saving RAM space on thedevi.-Pro:The network reflector must be RxOnWhenIdle(always listening to the network).

43、So if one of the bound devibroadcastst its network address has changed,then the network reflector will update the corresponding binding table entry.Thus,even ifthe other bound dev ce was sle ng,itbsequent messages to the changed dev ce will still be correctly addressed by thenetwork reflector.-:A de

44、vicet is bound to moren one other device cannod a message to one or a subset of its matching devithereflector will generate a unicast message to all of the bound devi.-:A sending dev ce cannot receive notif cation of delivery to the destinat on dev ce(i.e.the expected result when using theAF_ACK_REQ

45、UEST flag.)-:All messages must go thru the network reflector, reducing network bandwidth.-Pro/:A sending device bound to six deviwill send one message to the network reflector wh ch will resulthe networkreflector sending six unicast messages.sider a network dividedo two equal geographic reg ons,A an

46、d B,with the networkreflector on the centerline.If the sending dev ce is dento region A and the receiving deviare dento region B,then forevery message sent, network traff c in region A will be six times lessn it would be if the sending device has generated sixinstead of one trans-network messages.If

47、 all deviare nearby each other,den one region,then network traffichat regionis very muoren if the sending device could jusd single hop messages to theended recipients.ZDApp_SendEndDeviceBindReq()優(yōu)點:1. 綁定信息保存在網(wǎng)絡(luò)反射設(shè)備(例如協(xié)調(diào)器、路由器)中,可以節(jié)省目標(biāo)設(shè)備的內(nèi)存空間。2. 網(wǎng)絡(luò)反射設(shè)備總是處于網(wǎng)絡(luò)的狀態(tài)。所以,如果其中一個被綁定的節(jié)點廣播網(wǎng)絡(luò)地址改變的消息,網(wǎng)絡(luò)反射設(shè)備就可以馬上更新

48、相應(yīng)的綁定表條目。這樣,其他被綁定的節(jié)點即使處于休眠狀態(tài)(沒有收到該節(jié)點網(wǎng)絡(luò)地址改變的消息),隨后向該節(jié)點(網(wǎng)絡(luò)地址已改變)發(fā)送的消息,(在)網(wǎng)絡(luò)反射設(shè)備(協(xié)助下)仍能準(zhǔn)確定位。缺點:1.一個與多個設(shè)備綁定的節(jié)點不能只向一個或若干個配對的設(shè)備發(fā)送消息。網(wǎng)絡(luò)反射設(shè)備會向全部已綁定的設(shè)備本別發(fā)送單播消息。2.發(fā)送消息的設(shè)備無法收到目標(biāo)設(shè)備接收情況的通告。(沒有像 AF_ACK_REQUEST 標(biāo)志位那樣返回接收情況的功能!)3.所有的消息必須經(jīng)過網(wǎng)絡(luò)反射設(shè)備傳輸,降低了網(wǎng)絡(luò)的帶寬。進(jìn)一步分析:與六個設(shè)備綁定的某個設(shè)備,向網(wǎng)絡(luò)反射器發(fā)送一個消息后,會導(dǎo)致反射器發(fā)送六個單播消息。假設(shè)一個網(wǎng)絡(luò)被分成兩個

49、相等的地理區(qū)域 A 和 B,網(wǎng)絡(luò)反射器在兩區(qū)之間的。如果發(fā)送消息的設(shè)備在 A 區(qū)的深處,接收消息的(六個)設(shè)備在 B 區(qū)的深處,那么每次通過綁定(向反射器)發(fā)送一個消息,A 區(qū)的網(wǎng)絡(luò)流量將會是對六個接收設(shè)備分別發(fā)送消息時的六分之一。(這是優(yōu)點?。┑绻l(fā)送和接收的設(shè)備都鄰近在一個區(qū)的深處(假設(shè)離反射器很遠(yuǎn)),那么(其中一個設(shè)備通過反射器的綁定功能想其他設(shè)備發(fā)送一個消息)該區(qū)的網(wǎng)絡(luò)流量將會是對六個接收設(shè)備分別發(fā)送單跳消息的許多倍。(這是缺點?。﹍ Device ApplicationAn application on the device can build or manage a bindin

50、g table. Another way to enterbinding entries on the device is for the application to manage the binding table for itself.Meaningt the application will enter and remove binding table entries locally by calling the following binding tablemanagement functions(ref.ZStack AocumentBinding Table Management

51、 section)bindAddEntry()Add entry to binding tablebindRemoveEntry()Remove entry from binding tablebindRemoveClusterIdFromList()Remove a cluster ID from an existing binding table entrybindAddClusterIdToList()Add a cluster ID to an existing binding table entrybindRemoveDev()Remove all entries win addre

52、ss referencebindRemoveSrcDev()Remove all entries wireferenced source addressbindUpdateAddr()Update entries to another addressbindFindExisting()Find a binding table entrybindIsClusterIDinList()Check for an existing cluster ID in a table entrybindNumBoundTo()Number of entries with the same address(sou

53、rce or destination)bindNumOfEntries()Number of table entriesbindCapacity()um entries allowedBindWr teNV()Update table in NV.設(shè)備的應(yīng)用服務(wù)-設(shè)備上的一個應(yīng)用服務(wù)可以建立或者一個綁定表。進(jìn)入設(shè)備上綁定條目的另法是由應(yīng)用服務(wù)本身去管理綁定表。這意味著應(yīng)用服務(wù)通過調(diào)用以下的綁定表管理函數(shù),可以在本地進(jìn)入或者移除綁定表的條目。管理綁定表使用的 API:bindAddEntry()綁定表中加條目bindRemoveEntry()綁定表中移除條目bindRemoveClusterId

54、FromList()從一個已有的綁定表條目中移除一個簇標(biāo)識符bindAddClusterIdToList()在一個已有的綁定表條目中加入一個簇標(biāo)識符bindRemoveDev()移除某目標(biāo)地址的所有條目bindRemoveSrcDev()移除某源地址的所有條目bindUpdateAddr()更新條目到新的地址bindFindExisting()查找一個綁定條目bindIsClusterIDinList()在綁定條目中查找一個已有的簇標(biāo)識符bindNumBoundTo()某一地址(源地址或目標(biāo)地址)綁定條目的個數(shù)bindNumOfEntries()綁定表條目的個數(shù)bindCapacity()允許的最大綁定條目數(shù)BindWr teNV()在 NV 中保存新的綁定表Which Binding Method To Use?應(yīng)該選擇哪一種綁定方式?Automatic+no usereraction required+no tool cost-development time knowledge-non-figurableAssisted+install-time decis(site-specific knowledge)+ysis,ma enance,modification,visualizat oncan be under installerstrol-cost of toolC

溫馨提示

  • 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

提交評論