View unanswered posts | View active topics It is currently Tue Sep 02, 2014 8:24 am






Reply to topic  [ 1 post ] 
Bluetooth Messaging - no sending or receiving messages 
Author Message
Rookie

Joined: Thu Mar 08, 2012 2:50 am
Posts: 1
Post Bluetooth Messaging - no sending or receiving messages
Hello all,

This is my first post on the boards here, so please excuse any n00bish tendencies I may have. I am currently having some trouble sending messages back and forth between my PC and my NXT. I have managed to get a successful pairing between the two, and can download programs to the NXT from the RobotC IDE if I so choose. I am using a C++ communications library found here: http://www.norgesgade14.dk/bluetoothlibrary.php. I have successfully implemented quite a few routines using this library and samples found in the documentation, so I am hesitant to think the problem lies within the PC host's code. Here's what happening on a nitty-gritty level:

PC Side program:

Initialize (start bluetooth connection to robot, bring up app window)
Loop: Get input from gamepad, analyze input and prepare message for the robot, send the message, wait for 100 ms, try to read the message out of the robot's queue

NXT program:

Initialize, check for connection
Loop: read messages from the inbox, write messages to the same queue

All seems well from the plan, but I get an exception thrown by the PC program whenever the program tries to read the response message from the NXT, saying the mailbox is empty.

I understand that since I am programming half of this in RobotC and half in C++, you may not be able to help me with all of this. I am working with the folks who support the C++ software to see if I am using that correctly, and only hoping that someone here will be able to help me verify that I am using (or misusing) the RobotC bluetooth routines correctly. Please find code listings attached below. Thanks in advance for your help!

-JB


Attachments:
File comment: PC Program Main File
main.cpp [3.85 KiB]
Downloaded 288 times
File comment: NXT Program Header
Bluetooth.h [3.89 KiB]
Downloaded 287 times
File comment: NXT Program Main File
BluetoothTesting.c [660 Bytes]
Downloaded 292 times
Thu Mar 08, 2012 3:10 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.