Search found 11 matches
- 01 Feb 2011, 20:24
- Forum: Mindstorms Software
- Topic: Bluetooth communication from a host PC
- Replies: 2
- Views: 3963
Re: Bluetooth communication from a host PC
I am very interested in this, too. I use BluetoothWrite() on the NXT to send data over the Bluetooth-based serial port connection, and read the data on the PC using normal ReadFile() operation (opened with CreateFile on "com3"). I could find no information whatsoever on the format of the d...
- 27 Jan 2011, 21:54
- Forum: Mindstorms Software
- Topic: BluetoothStatus and BluetoothWrite return codes?
- Replies: 4
- Views: 6333
Re: BluetoothStatus and BluetoothWrite return codes?
1. To **send** to the brick, I want to use the other COM port or the same one? 2. I note the data I send from the NXT seems to be received by the PC in this format: unsigned byte len unsigned byte ??? <-- BT address 0..3? Always 0, which would make sense as the PC is 0. data So I would use this form...
- 27 Jan 2011, 21:23
- Forum: Mindstorms Software
- Topic: BluetoothStatus and BluetoothWrite return codes?
- Replies: 4
- Views: 6333
Re: BluetoothStatus and BluetoothWrite return codes?
Ok, as long as I follow this sequence, I'm OK: 1. Upload NXT program from Bricxcc. 2. Close communications on Bricxcc. 3. Start my C++ program on the PC which opens the serial port (com3 in this case). 4. Start the program on the brick. 5. Data is received. 6. End program on the brick first. 7. End ...
- 27 Jan 2011, 20:07
- Forum: Mindstorms Software
- Topic: BluetoothStatus and BluetoothWrite return codes?
- Replies: 4
- Views: 6333
Re: BluetoothStatus and BluetoothWrite return codes?
Thanks, I'll see what I can do with this. Is there flow control? If nothing's reading off the other end of the pipe, do things get backed up, and what's the error message if so?
- 25 Jan 2011, 02:55
- Forum: Mindstorms Software
- Topic: BluetoothStatus and BluetoothWrite return codes?
- Replies: 4
- Views: 6333
BluetoothStatus and BluetoothWrite return codes?
I've moved my Bricxcc project to a new computer and am having troubles debugging a Bluetooth connection that worked on my old machine. I'm using BluetoothStatus, which is returning -32. According to the NXC manual, there are 3 return values: NO_ERR 0 STAT_COMM_PENDING 32 STAT_MSG_EMPTY_MAILBOX 64 Is...
- 27 Dec 2010, 17:56
- Forum: Mindstorms Software
- Topic: Bluetooth remote control from PC sample code?
- Replies: 16
- Views: 19234
Re: Bluetooth remote control from PC sample code?
BluetoothStatus is returning -35. This is not 0, 32, or 64, the three COMM status values. As the help for BluetoothStatus() unhelpfully says it returns the Bluetooth status, with no pointers to possible return values, any ideas? 0 NO_ERR 32 STAT_COMM_PENDING 64 STAT_MSG_EMPTY_MAILBOX I'm having a de...
- 25 Dec 2010, 19:02
- Forum: Mindstorms Software
- Topic: Bluetooth remote control from PC sample code?
- Replies: 16
- Views: 19234
Re: Bluetooth remote control from PC sample code?
Ok, using BluetoothWrite() on the brick. It sends an encapsulated message of: Byte: Data payload length Byte: Unknown (always 0, is this the BT address, which would always be 0 as received by the PC? If so, why send it?) N Data bytes The data bytes are terminated by a C-string '\0' null character, w...
- 22 Dec 2010, 17:55
- Forum: Mindstorms Software
- Topic: Bluetooth remote control from PC sample code?
- Replies: 16
- Views: 19234
Re: Bluetooth remote control from PC sample code?
Ok, since I already have sensor-gathering and analysis built to run on the NXT, I think I would like to just pipe it to the PC rather than use the PC to request the data. So...on the NXT, using a BricxCC-generated program, let's say I have a string to send (flattened-var of struct, but that's beside...
- 21 Dec 2010, 21:55
- Forum: Mindstorms Software
- Topic: Bluetooth remote control from PC sample code?
- Replies: 16
- Views: 19234
Re: Bluetooth remote control from PC sample code?
Ok I have that working, I think anyway. Next step is to read the serial port on the NXT using BricxCC. So do I want to open a serial port (on the NXT) and receive my own messages? Or am I sending (from the PC, over the serial port) the Bluetooth-encoded messages (e.g. PLAYTONE, SETOUTPUTSTATE, etc.)...
- 21 Dec 2010, 19:58
- Forum: Mindstorms Software
- Topic: Bluetooth remote control from PC sample code?
- Replies: 16
- Views: 19234
Re: Bluetooth remote control from PC sample code?
Sort of -- however those: 1. Use the graphical NXT-G stuff to provide the brick-side part 2. Relies on a .Net SerialPort object for the serial port, PC-side. Their code does not compile as it cannot find any of that stuff, even though I am using MS Visual Studio Express. It is, of course, all the ov...