Shop OBEX P1 Docs P2 Docs Learn Events
Updated Xbee object in exchange — Parallax Forums

Updated Xbee object in exchange

Martin HebelMartin Hebel Posts: 1,239
edited 2009-12-01 00:13 in Propeller 1
Hi All,
Long time no post. I've updated to my Xbee Object in the exchange.
http://obex.parallax.com/objects/146/

It now supports remote configuration of nodes and querying of remote nodes (firmware 10CD required on Xbee), along with ability to more easily build packets for API more and parsing of ADC data.

Pub API_RemConfig (addy16,stringptr,val)| Length, chars, csum,ptr ,i
{{
Sends AT commands in API mode to be immediately processed on REMOTE XBee.
(Firmware 10CD or higher)
If FrameID is not 0, status will be returned as to success.
XB.API_Config(5, string("DL"),$2) ' Configure DL on a remote XBee at addr 5

}}

Pub API_RemQuery (addy16,stringptr)| Length, chars, csum,ptr ,i
{{
Sends AT command in API mode to query a parameter value on a REMOTE XB.
Data is returned as a string.
XB.API_RemQuery(5, string("DL")) ' Query address 5
XB.API_Rx ' accept response
HisDL := XB.ParseHEX(XB.RxData,1) ' Pull out first hex value
}}

Pub API_NewPacket
{{ To assist in sending packets in API mode, these next several instuctions can
be made to assemble a data into a packet. Example:
XB.API_NewPacket ' Clear data out - fill with 0.
XB.API_AddStr(string("Hello,"))
XB.API_AddByte(32)
'all done, send to address 5 for 7 bytes
XB.API_txPacket(5,API_Packet,7)
' for packets with no 0's in message:
XB.API_str(5,API_Packet)
}}

This is in support of the new book due out from McGraw-Hill available for pre-sale on amazon, which includes my chapter on XBee comms along with all the other contributor's great chapters!
http://www.amazon.com/Programming-Customizing-Multicore-Propeller-Microcontroller/dp/0071664505/ref=sr_1_1?ie=UTF8&s=books&qid=1259613027&sr=8-1

-Martin Hebel
Southern Illinois University
Electronic Systems Technologies
and
SelmaWare Solutions
www.selmaware.com

Comments

Sign In or Register to comment.