phattaradanai / libxbee

Automatically exported from code.google.com/p/libxbee
0 stars 0 forks source link

sending frame #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
thank you for the libxbee c library, i would like you to show me an example of 
using frame.h to send a frame or a packet with API mode, i had tried to use it 
but i couldnt.

Original issue reported on code.google.com by Amal.Gara90@gmail.com on 1 Apr 2014 at 3:31

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
As a user, you don't use frame.h - you will use xbee.h

If you would like samples, please look in the 'samples' directory.

Original comment by attie@attie.co.uk on 1 Apr 2014 at 9:22

GoogleCodeExporter commented 8 years ago
i looked to samples directory but there is no example that send a frame.

Original comment by Amal.Gara90@gmail.com on 2 Apr 2014 at 7:41

GoogleCodeExporter commented 8 years ago
This is not a bug - please use Google Groups for support requests.

The following is an example showing how to send and receive data.
https://code.google.com/p/libxbee/source/browse/sample/xbee1/0.simple_at/main.c?
repo=libxbee-v3

Original comment by attie@attie.co.uk on 2 Apr 2014 at 8:06

GoogleCodeExporter commented 8 years ago

Original comment by attie@attie.co.uk on 2 Apr 2014 at 8:07

GoogleCodeExporter commented 8 years ago
ok thanks

Original comment by Amal.Gara90@gmail.com on 2 Apr 2014 at 8:12

GoogleCodeExporter commented 8 years ago
im sorry but i cannot solve my problem, how can i send this packet: 7E 00 10 17 
01 00 00 00 00 00 00 00 01 FF FE 02 44 34 05 6A usin xbee_contx function.

Original comment by Amal.Gara90@gmail.com on 2 Apr 2014 at 1:02

GoogleCodeExporter commented 8 years ago
You can't, libxbee takes care of all of the framing and checksumming for you.
Instead you should be trying to do the following (no error checking is given).
By the way... the 64-bit address you gave isn't valid. It should begin 
0x0013A200.

struct xbee_conAddress addr;
memset(&addr, 0, sizeof(addr));
addr.addr64_enabled = 1;
addr.addr64[0] = 0x00;
addr.addr64[1] = 0x00;
addr.addr64[2] = 0x00;
addr.addr64[3] = 0x00;
addr.addr64[4] = 0x00;
addr.addr64[5] = 0x00;
addr.addr64[6] = 0x00;
addr.addr64[7] = 0x01;

xbee_con *con;
xbee_conNew(xbee, &con, "Remote AT", &addr);

xbee_conTx(con, NULL, "D4%c", 0x05);

Original comment by attie@attie.co.uk on 3 Apr 2014 at 6:08

GoogleCodeExporter commented 8 years ago
thanks a loooooooooooot, you have resolved my problem.

Original comment by Amal.Gara90@gmail.com on 3 Apr 2014 at 7:50

GoogleCodeExporter commented 8 years ago
:-)

Original comment by attie@attie.co.uk on 3 Apr 2014 at 7:51