access bluetooth settings from program

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, imaqine, 99jonathan

smalls
New User
Posts: 7
Joined: Wed Dec 29, 2010 9:35 am

access bluetooth settings from program

Postby smalls » Thu May 10, 2012 8:23 am

Hi everyone,

we (computer science Bachelor lab course) have several NXT bricks with broken display that however seem to work fine (at least nxjcontrol via usb does).
but we also need a bluetooth connection for remote control (the display itself is nice for debugging purposes but not really necessary). The problem is, that without display we are not able to tell the bluetooth settings and the PIN.
Is there another way to do that?

Many thanks for your time
Smalls

Edit: Flashing does not change neither Bluetooth settings nor PIN

User avatar
gloomyandy
leJOS Team Member
Posts: 4320
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: access bluetooth settings from program

Postby gloomyandy » Thu May 10, 2012 9:27 am

All of the Bluetooth settings can be accessed via leJOS APIs, after all the leJOS menu system is simply a leJOS program. Take a look at the menu source code (in the startup project) to see how to do it...
http://lejos.svn.sourceforge.net/viewvc ... k/startup/

Andy

matthias
New User
Posts: 20
Joined: Thu Mar 22, 2012 11:44 am

Re: access bluetooth settings from program

Postby matthias » Fri May 11, 2012 11:00 am

http://lejos.svn.sourceforge.net/viewvc ... otate=6539 Line 720

Code: Select all

static final String pinProperty = "lejos.bluetooth_pin";
[...]
String pinStr = SystemSettings.getStringSetting(pinProperty, "1234");

maybe write it to a file and send it via usb back to your computer.
Also take a look at the Bluetooth class.


Return to “NXJ Software”

Who is online

Users browsing this forum: Google [Bot], standy and 1 guest