Académique Documents
Professionnel Documents
Culture Documents
& is speci'icatio( )escri*es a simple protocol t at ca( *e +se) to )iscover c+stom (etwork co((ecte) )evices +si(, a simple *roa)cast -DP sc eme.
,D& <"oadcast Discove" e1uest Msg Device &o"t +)321 ,D& <"oadcast Discove" esponse Msg
62e se1uence of events a"e as follo3s fo" o5taining a devices pa"amete"s; 1. &C sends a ,D& 5"oadcast e1uest Message to a device t2at is listening on &o"t +)321. 2. 62e device t2en sends a ,D& 5"oadcast esponse Message to t2e &C 32ic2 is listening on &o"t +)322. 62e "esponse message contains its pe"tinent net3o"( pa"amete"s.
62e sixt2 fixed 16 5yte Gipadd"G field is t2e %& add"ess of t2e device in little endian 5yte o"de". %f t2is is a "e1uest message4 t2e field is igno"ed 5y t2e device. %f it is a set message t2en t2is is t2e %& add"ess t2at t2e device s2ould c2ange to. %f it is a "esponse message f"om t2e device4 t2is is t2e cu""ent %& add"ess of t2e device. 62e sevent2 fixed 2 5yte Gpo"tG field is t2e po"t num5e" of t2e device in little endian 5yte o"de". %f t2is is a "e1uest message4 t2e field is igno"ed 5y t2e device. %f it is a set message t2en t2is is t2e po"t num5e" t2at t2e device s2ould c2ange to. %f it is a "esponse message f"om t2e device4 t2is is t2e cu""ent po"t num5e" of t2e device. 62e last 5yte of t2e fixed common field can 5e used to specify diffe"ent custom field fo"mats fo" t2e same device. 2.1.2 "3amples o' 1illi(, 'i3e) commo( 'iel)s.
D%SC=.E >MS? msgD E ample PC re!uest messa"e for any devices on net#ork$ memset99voidH:Imsg4 /4 si8eof9D%SC=.E >MS?::D AA8e"o out all fields msg.(eyB/C E /x50D AAfill in (ey values msg.(eyB1C E /x05D msg.op E /D AA"e1uest message msg.lengt2B/C E 56D AAset message lengt2 of Just t2e fixed section E ample PC re!uest messa"e for any device #it% t%e name &MyDevice' on t%e net#ork$ memset99voidH:Imsg4 /4 si8eof9D%SC=.E >MS?::D AA8e"o out all fields msg.(eyB/C E /x50D AAfill in (ey values msg.(eyB1C E /x05D msg.op E /D AA"e1uest message st"cpy9 msg.name4 KMyDeviceL :D AAfill in name st"ing field msg.lengt2B/C E 56D AAset message lengt2 of Just t2e fixed section E ample simple Device response messa"e #it% t%e name &MyDevice' on t%e net#ork$ memset99voidH:Imsg4 /4 si8eof9D%SC=.E >MS?::D AA8e"o out all fields msg.(eyB/C E /x50D AAfill in (ey values msg.(eyB1C E /x05D msg.op E 1D AA"esponse message st"cpy9 msg.name4 KMyDeviceL :D AAfill in name st"ing field AAassume device %& add"ess is 1-2.16-.1.1// on po"t 123+5 msg.ipadd"B/C E 1//D AAdevice %& add"ess9 little endian 5yte o"de": msg.ipadd"B1C E 1D msg.ipadd"B2C E 16)D msg.ipadd"B3C E 1-2D msg.po"tB/C E 123+5I/x//FFD AAdevice &o"t 'um5e"9 little endian 5yte o"de": msg.po"tB1C E 123+5MM)D msg.lengt2B/C E 56D AAset message lengt2 of Just t2e fixed section E ample PC set messa"e for device #it% t%e name &MyDevice' on t%e net#ork$ memset99voidH:Imsg4 /4 si8eof9D%SC=.E >MS?::D AA8e"o out all fields msg.(eyB/C E /x50D AAfill in (ey values msg.(eyB1C E /x05D msg.op E 2D AAset message st"cpy9 msg.name4 KMyDeviceL :D AAfill in name st"ing field AAassume 3ant to set device %& add"ess to 1-2.16-.5.32 on po"t 5+321 msg.ipadd"B/C E 32D AAdevice %& add"ess9 little endian 5yte o"de": msg.ipadd"B1C E 5D msg.ipadd"B2C E 16)D msg.ipadd"B3C E 1-2D msg.po"tB/C E 5+321I/x//FFD AAdevice &o"t num5e"9 little endian 5yte o"de":
=ne can save 3o"( 5y fi"st "eading all t2e devices settings4 modify t2e fields t2at need to c2ange4 t2en send t2e message 5ac( out as a Set message to t2e device.
?ot filled in fields f"om device so only update fields t2at a"e to 5e c2anged t2en send Set message 3it2 modified fields. &C Discove" Set Msg Device
&C
Discove"
esponse Msg
st"uct >D%SC=.E >MS?>'E6SD @ AAfixed common 56 5yte fields unsigned c2a" lengt2B2CD AAlengt2 of total message in 5ytes 9little endian 5yte o"de": unsigned c2a" (eyB2CD AAfixed (ey (eyB/CEE/x50 (eyB1CEE/x05 unsigned c2a" opD AA/EE e1uest9to device: 1EE esponse9f"om device: 2 EESet9to device: c2a" nameB16CD AADevice name st"ing null te"minated c2a" snB16CD AASe"ial num5e" st"ing null te"minated unsigned c2a" ipadd"B16CD AAdevice %& add"ess 9little endian 5yte o"de": unsigned c2a" po"tB2CD AAdevice &o"t num5e" 9little endian 5yte o"de": unsigned c2a" customfieldD AASpecify a custom data field fo" a pa"ticula" device AAsta"t of optional va"ia5le custom 5yte fields unsigned c2a" macadd"B6CD AA7! mac add"ess 9little endian 5yte o"de": 9"ead only: unsigned c2a" 23ve"B2CD AA7a"d3a"e ve"sionH1// 9little endian 5yte o"de": 9"ead only: unsigned c2a" f3ve"B2CD AAFi"m3a"e ve"sionH1// 9little endian 5yte o"de":9"ead only: unsigned c2a" 5tve"B2CD AA<oot ve"sionH1// 9little endian 5yte o"de": 9"ead only: unsigned c2a" fpgaidD AAF&?0 %D 9"ead only: unsigned c2a" fpga"evD AAF&?0 "evision 9"ead only: unsigned c2a" optsD AA=ptions 9"ead only: unsigned c2a" modeD AA/ EE ,se D7C& 1EEmanual 2EEmanual 0lte"nate data add"ess unsigned c2a" su5netB+CD AA%& su5net mas( 9little endian 5yte o"de": unsigned c2a" g3add"B+CD AAgate3ay add"ess 9little endian 5yte o"de": unsigned c2a" dataipadd"B+CD AA 0lte"nate data %& add"ess fo" ,D& data 9little endian 5yte o"de": unsigned c2a" datapo"tB2CD AA 0lte"nate data &o"t add"ess fo" ,D& 9little endian 5yte o"de": unsigned c2a" fpgaD AA/ EE default cfg 1EEcustom1 2EEcustom2 unsigned c2a" statusD AA<it / EE 6C& Connected4 <it 1 EE unning4 <its 2$# not defined 9"ead only: unsigned c2a" futu"eB15CD AAfutu"e use F
2.2.2 SD4567 a() SD451# -si(, Server .+stom 1iel) Packet De'i(itio(s st"uct >D%SC=.E >MS?>SD NN @ AAfixed common 56 5yte fields unsigned c2a" lengt2B2CD AAlengt2 of total message in 5ytes 9little endian 5yte o"de": unsigned c2a" (eyB2CD AAfixed (ey (eyB/CEE/x50 (eyB1CEE/x05 unsigned c2a" opD AA/EE e1uest9to device: 1EE esponse9f"om device: 2 EESet9to device: c2a" nameB16CD AADevice name st"ing null te"minated c2a" snB16CD AASe"ial num5e" st"ing null te"minated unsigned c2a" ipadd"B16CD AAdevice %& add"ess 9little endian 5yte o"de": unsigned c2a" po"tB2CD AAdevice &o"t num5e" 9little endian 5yte o"de": unsigned c2a" customfieldD AASpecify a custom data field fo" a pa"ticula" device AAsta"t of optional va"ia5le custom 5yte fields unsigned c2a" f3ve"B2CD AAFi"m3a"e ve"sionH1// 9little endian 5yte o"de":9"ead only: unsigned c2a" 5tve"B2CD AA<oot ve"sionH1// 9little endian 5yte o"de": 9"ead only: unsigned c2a" su5netB+CD AA%& su5net mas( 9little endian 5yte o"de": unsigned c2a" g3add"B+CD AAgate3ay add"ess 9little endian 5yte o"de": c2a" connectionB32CD AAinte"face connection st"ing null te"minated9ex; C=M34 DE.66O54 etc: unsigned c2a" statusD AA<it / EE 6C& Connected4 <its 1$# not defined 9"ead only: unsigned c2a" futu"eB15CD AAfutu"e use F