View unanswered posts | View active topics It is currently Tue Sep 23, 2014 11:12 am






Reply to topic  [ 1 post ] 
Bluecore not entering RawDataMode 
Author Message
Rookie

Joined: Mon Jun 23, 2014 5:12 am
Posts: 4
Post Bluecore not entering RawDataMode
So, I have a third party bluetooth scanner paired with an NXT (running F/W Version 9.68). They pair wonderfully, but the scanner is not read natively by either an EV3 or NXT, so I need to use RawDataMode.

The program compiles perfectly fine, but the NXT is not entering RawDataMode as it should. I've followed the examples to the letter, but it does not enter the mode. I used the debugger and sure as nuts it does not exit the while loop that makes the program wait for bBTRawMode.

Here is the pertinent sections of my code:

Code:
void btSetup()
{
   //Connect automatically to device with name "BTScanner" if no connection present
   while(nBTCurrentStreamIndex < 0)
   {
   nxtDisplayCenteredTextLine(3, "*Connecting*");
   bBTSkipPswdPrompt=true;
   btConnect(2, "BTScanner");  // connects to the BT Scanner on port 2
   }
   //Enters Raw Data Mode
   setBluetoothRawDataMode();
      wait1Msec(50);
   
   while (bBTRawMode==false)
   {
      eraseDisplay();
      nxtDisplayCenteredTextLine(3, "Entering");
      nxtDisplayCenteredTextLine(4, "RawData Mode");
      wait1Msec(5);
   }
   eraseDisplay();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//                                        Main Task
//
////////////////////////////////////////////////////////////////////////////////////////////////////////

task main()
{
bBTDebugTrace = true;
btSetup();
while(true)
{
   if(getChar()!=-1)
   {
      eraseDisplay();
      nxtDisplayString(3, "Read:%d", getChar());
      wait10Msec(10);
   }
   else
   wait10Msec(10);
}
}


I am unsure of what I'm doing wrong?


Mon Jun 30, 2014 9:17 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: JohnWatson 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.