简体   繁体   中英

Modify the BLE device name

I am working on an iPhone app and this app send command to a board through BLE module. the board controls some motor to move around.

I do code on iOS app and another guy do the code on Arduino. There is a BLUGiga 112 module on the board.

Now, in my iOS app, I can search out available BLE devices, but the detected device name is not always what I want.

The device name defined in gatt.xml file can always be detected on the iOS app. But I want user to be able to change the name by iOS app while the name in xml is static. So I let another hardware engineer write some code to accept new name from iOS and store in flush and then broadcast back to iPhone. I can pass the name from iOS app and the name is stored in device successfully. But next time, when I open iOS app and try to search around, the new name is not always be detected.

Anybody can tell me why? or what should I do to get the rename function done?

iOS prevents that Service from being usable by a developer. It also caches that data and it is hard to clear that cache.

I ended up making a custom Characteristic that an app could write to. The firmware would handle that write request and then update the device name and advertising packet. It's seems hacky, but I wasn't able to find a better solution.

Section 3.12 (page 24) documents the fact iOS does not let a developer use that Service (and a couple others) https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM