Bluetooth communication from a host PC
Posted: 01 Feb 2011, 19:54
Hello all,
I've been trying to implement a C/C++ program using fantom drivers to talk to a NXT over bluetooth. On the NXT I am running NXC.
I want to exchange my own messages, with no mailboxes. The reason is because with the mail boxes I'm limited to around 58 bytes, or something similar. So, I would like to write directly on the BT buffer.
Now the problem: from what I could understand, in the NXT, I can only read the buffer and not working like with mailboxes, pushing and popping msgs. I'm using the function GetBTInputBuffer() to fetch the buffer and it's a non-blocking function. What I want to say is that it's quite hard to be waiting for a message to arrive and knowing that I'm facing new data.
Also I noticed that I get in the buffer sometimes data from commands, that the firmware is handling, nothing to do with the data sent from the method "nFANTOM100::iNXT::write(...)" on the host application.
Am I thinking wrong about anything? Can someone give me some light on this?
Thanks a lot guys!
Ricardo
I've been trying to implement a C/C++ program using fantom drivers to talk to a NXT over bluetooth. On the NXT I am running NXC.
I want to exchange my own messages, with no mailboxes. The reason is because with the mail boxes I'm limited to around 58 bytes, or something similar. So, I would like to write directly on the BT buffer.
Now the problem: from what I could understand, in the NXT, I can only read the buffer and not working like with mailboxes, pushing and popping msgs. I'm using the function GetBTInputBuffer() to fetch the buffer and it's a non-blocking function. What I want to say is that it's quite hard to be waiting for a message to arrive and knowing that I'm facing new data.
Also I noticed that I get in the buffer sometimes data from commands, that the firmware is handling, nothing to do with the data sent from the method "nFANTOM100::iNXT::write(...)" on the host application.
Am I thinking wrong about anything? Can someone give me some light on this?
Thanks a lot guys!
Ricardo