Bluetooth LE

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ktmoss01
 
Posts: 12
Joined: Mon Apr 28, 2014 2:08 pm

Bluetooth LE

Post by ktmoss01 »

I have the Bluefruit LE module (nRF8001). I would like to be able to modify the name of the device when it is advertising. Currently it is set to "UART". The Arduino code that is provided doesn't really show the setup of the nRF8001 device. How do I modify the configurations such as the name?

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: Bluetooth LE

Post by adafruit2 »

Quick answer: you can't easily
Longer answer: you have to edit and recompile the XML document that defines the name using nordic tools. we're not even sure the tools are available for download. Will ask KTOWN for more details

User avatar
ktmoss01
 
Posts: 12
Joined: Mon Apr 28, 2014 2:08 pm

Re: Bluetooth LE

Post by ktmoss01 »

I downloaded the nRFgo Studio which generates the setup file. I also downloaded an Android app from Nordic (nRF Master Control Panel) which allows me to connect and change the name value but the Arduino code rewrites the value when it resets. There has to be a file somewhere with this value set in the code. I just need to find it.

User avatar
ktmoss01
 
Posts: 12
Joined: Mon Apr 28, 2014 2:08 pm

Re: Bluetooth LE

Post by ktmoss01 »

In addition, I want to say that having the code you all provided is great. It makes development on the nRF8001 so much easier. Great job and thanks!!

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: Bluetooth LE

Post by adafruit2 »

Thanks! still researching this - its been a long time since we started this codebase :)

User avatar
ktownsend
 
Posts: 1447
Joined: Thu Nov 05, 2009 2:18 am

Re: Bluetooth LE

Post by ktownsend »

If you open the .xml config file for the UART service in nRFGo Studio (see here: https://github.com/adafruit/Adafruit_nR ... ility/uart), you can go to the GAP Settings tab and then change the name to something else (up to 7 characters long). Then click 'nRF8001 Setup > Generate Source Files > Generate only services.h'. This file contains all the settings that get passed down to the nRF8001 during init, and the name is contained here. You can do a compare of the existing services.h file with the new one and there should be two chunks of data that changed. I suspect that is what you're after, though be very careful with the rest of the settings in that .xml file or everything will break if you start changing the service, etc.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluetooth LE

Post by adafruit_support_rick »

OK, we just pushed up a new version of the library:

Code: Select all

I just pushed an update that adds a new (optional) .setDeviceName function. You can set a name up to 7 characters long instead of the default "UART" (that's all the space we have in the advertising packet). Sending more than 7 characters will return without taking the changes into affect.

This needs to be called before the device is initialised, so I added it at the appropriate place in both the echoDemo and callbackDemo examples
https://github.com/adafruit/Adafruit_nRF8001

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”