HOW TO CHANGE CHARACTERISTIC NAME AND SERVICE NAME FROM CODE

HI friends 

i am vary new to bluetooth ,

1.the problem is i want to give custom name for the UUID characteristics, as of now in mobile app it displaying unknown service ,and unknown characteristics .

2.i found some solution like in nrf connect mobile app if we long press on characteristics  we can edit the name but it is only possible locally  if we use other mobile again it will show same unkown characteristics .

3.please give any solution to change the service name and characteristics name globally llike if you scan and connect  with different mobile it should not change .

thanks in advance

Parents
  • Hi 

    The Bluetooth stack doesn't store any names for services and characteristics, but for standard services and characteristics it is possible to maintain a list on the phone side that associates particular 16-bit UUID's with a standard name for that particular service/characteristic. 

    This doesn't work for 128-bit proprietary UUID's, as there is no central list or repository storing names for all the proprietary UUID's out there. 

    In principle anyone can create their own 128-bit UUID's simply by using a random generator, and there is no need to associate an official name with these UUID's. 

    Can you confirm whether or not you are planning to use a proprietary 128-bit UUID, or if you are simply planning to use standard services? 

    The normal approach when using 128-bit UUID's is to make a custom app for the phone that will look for your particular UUID. Then you can label the services and characteristics anything you like. 

    Also, while services and characteristics don't have names per se you can include a so called Characteristic User Description descriptor with your characteristics, allowing you to include a description string with each characteristic. This you could then read out on the phone side and use to label the different characteristics in your device. 
    This is not commonly used though, and you would still need to add some code in the mobile app to read this out and display it to the user. Also, if you want to connect to other third party devices not made by you then they will typically not use this descriptor. 

    Best regards
    Torbjørn

  • thank you ovrebekk 

    for your fast replay.

    i am using standard services UUID .

    i found another way i,i edited service name and characteristics name in mobile app using long press ,after i exported .json file and shared to another mobile they imported that file now  the changed  service name and characteristics are visible even in other mobiles.

    is this the only way are we have any other methods .if  it is please suggest ,

    warm regards,

    bharath.m 

  • Hi Bharath

    Are you planning to make your own app, or just use a standard one like the nRF Connect for Mobile app?

    If you make your own app then you can implement a system that shares the names between all the apps, as long as you use some kind of cloud backend where you can store the names in a central location. 

    In our app there is no automatic method to have this synchronized between multiple phones. 

    Best regards
    Torbjørn

  • hi ovrebekk

    TQ for clarification.

    based on this ,my understanding is  not able to hard code characteristics name and service name from peripheral device ,its should be take care by central device.?

  • Hi Bharath

    It's not really a peripheral/central issue. The Bluetooth specification doesn't provide a mechanism for reading out a human readable name for characteristics and services, on either side of the connection. What you get is the UUID, and if you want to display names for services and characteristics you need to maintain a map somewhere that links the UUID to the name. 

    You can store this map anywhere you like, and you could hard code it into the central or peripheral if you wanted to, but to save memory on the embedded device (peripheral in your case) it probably makes more sense to store it on the central/phone side. 

    Best regards
    Torbjørn

Reply
  • Hi Bharath

    It's not really a peripheral/central issue. The Bluetooth specification doesn't provide a mechanism for reading out a human readable name for characteristics and services, on either side of the connection. What you get is the UUID, and if you want to display names for services and characteristics you need to maintain a map somewhere that links the UUID to the name. 

    You can store this map anywhere you like, and you could hard code it into the central or peripheral if you wanted to, but to save memory on the embedded device (peripheral in your case) it probably makes more sense to store it on the central/phone side. 

    Best regards
    Torbjørn

Children
No Data
Related