grabbing a stream from coordinator

5 views
Skip to first unread message

G2subsPstLC

unread,
Dec 9, 2010, 2:58:40 AM12/9/10
to xbee...@googlegroups.com
Hey Xbee-api,

if one wants to grab a stream from the coordinator that Rx'd it from a end node, what method does one call for that?

i can parse it once i grab it from the coordinator.

--
Bill
Key fingerprint = C472 148A 4185 ED70 2A61 B77C B428 3668 5D84 4495

Andrew Rapp

unread,
Dec 9, 2010, 9:54:31 AM12/9/10
to xbee...@googlegroups.com
This software parses packets for you so there's no need to access to the underlying stream.  You can provide your own packet parsing implementation by registering a ResponseHandler, with the apiId it should parse (example below).  This code is not yet released so you need to get from subversion.

public class ResponseHandlerExample {


public ResponseHandlerExample() {

XBee xbee = new XBee();

xbee.registerResponseHandler(0, MyResponse.class);

// xbee.open(..);

}

public static class MyResponse extends XBeeResponse {


@Override

protected void parse(IPacketParser parser) throws IOException {

// this.setxxx(parser.read("xxx"));

// this.setxxy(parser.read("xxy));

}

}

}



--
You received this message because you are subscribed to the Google Groups "xbee-api" group.
To post to this group, send email to xbee...@googlegroups.com.
To unsubscribe from this group, send email to xbee-api+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xbee-api?hl=en.


G2subsPstLC

unread,
Dec 15, 2010, 5:10:46 PM12/15/10
to Andrew Rapp
thanks Andrew!!!
Reply all
Reply to author
Forward
0 new messages