Author Topic: How do I change RFDuino device name from iOS app?  (Read 87 times)

iDeveloper

  • RFduino Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
How do I change RFDuino device name from iOS app?
« on: July 11, 2017, 06:40:38 AM »
I am writing an application where I am using Core Bluetooth Services. I am stuck at a point where I need to change the name of RFDuino device. i.e. Currently whenever my app starts searching for devices the device shows its name as 'RFduino' I need it to be changed from within my iOS app. And when I search the same device from different iPhone its should show the "New Name". I tried searching the web but din't get any success. Any help will be highly appriciated. TIA

RFD_Nelson

  • RFduino Team
  • *****
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: How do I change RFDuino device name from iOS app?
« Reply #1 on: July 11, 2017, 07:03:39 AM »
Hi iDeveloper,

The name of the device is coded in the sketch, and defaults to "RFduino". If you want to be able to change that from the application, you'll need to connect to the RFduino, send a message which would be recieved in the RFduinoBLE_onReceive() in the sketch telling it to change it's deviceName. Once the deviceName has been changed in the sketch, you'll need to restart RFduinoBLE and restart it before the iOS app would see a different name in the advertisementData.

Thanks,

Nelson

Tim

  • RFduino Sr. Member
  • ****
  • Posts: 119
  • Karma: +2/-0
    • View Profile
Re: How do I change RFDuino device name from iOS app?
« Reply #2 on: July 12, 2017, 10:48:55 AM »
You can also set the device name before starting BLE:

Code: [Select]
  SimbleeBLE.deviceName = "myName";
  SimbleeBLE.begin();
(We use Simblee, but works the same with RFduino.)

In our product, we actually allow the user to set the device name. It defaults to a generic name (using method above), then once connected to our iOS app, the app presents UI allowing the user to change the name. Then the iOS app sends message to device with new name and sketch writes the new name to flash, disconnects, then restarts BLE. The next time a central (iOS app) connects, Simblee advertises using the new name.

Hope helpful ...

Tim