How can change Device Name

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

On the GAP Settings tab under General exist Device Name field that connected device see it.

   

If I have more than 2 devices I see it same. I want to change it by soft. I see function CyBle_GapSetLocalName (const char8 name[])

   

but it`s not change. What to do.

0 Likes
1 Solution
Anonymous
Not applicable

CyBle_GapSetLocalName (const char8 name[]) API should be used before the device starts advertising. So what you can do is to stop advertisement, call this API and then start advertisement.

   

There is another method wherein you use the CyBle_GapUpdateAdvData () API to update the advertisement data but the CyBle_GapUpdateAdvData () should be called when the BLESS state is in CYBLE_BLESS_STATE_EVENT_CLOSE.

   

There is a forum post with the same question and it has been answered. Posting the link here:

   

http://www.cypress.com/forum/proc-ble/update-device-name-id-during-advertising

   

Hope this helps!

View solution in original post

0 Likes
10 Replies
Anonymous
Not applicable

CyBle_GapSetLocalName (const char8 name[]) API should be used before the device starts advertising. So what you can do is to stop advertisement, call this API and then start advertisement.

   

There is another method wherein you use the CyBle_GapUpdateAdvData () API to update the advertisement data but the CyBle_GapUpdateAdvData () should be called when the BLESS state is in CYBLE_BLESS_STATE_EVENT_CLOSE.

   

There is a forum post with the same question and it has been answered. Posting the link here:

   

http://www.cypress.com/forum/proc-ble/update-device-name-id-during-advertising

   

Hope this helps!

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

Thanks !

   

Problem of this forum that not exist FAQ and search is very difficulty.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Chaplin, you are quite right!

   

Searching for "change device name" (without the quotes) give more than 1200 results.

   

Searching for "change device name" (with quotes) give only 3 results, one is your post and the other two have no relevance.

   

@yssu:   So how to find the prior thread you mention?

   

 

   

Bob

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

For Device Name I assigned Custom Characteristic with type utf8s but PSOC Creator have only char.  It mean I need read value from BLE char by char or exist better method ?

0 Likes
Anonymous
Not applicable

@Bob: I don't quite understand your question.

   

@Chaplin: You can increase the length of the characteristic in the configuration window and you can treat the data as an array.

0 Likes

I don`t understand why in BLE custom characteristic I can define a lot of types but CyBle_GattsWriteAttributeValue receive ONLY  array /** Pointer to the value to be packed */    uint8*   val;

   

Cypress always send users to 100_Projects_in_100_Days but exist only 52 ! Where is all others examples ?

   

May be you can create number 53 with libraries of converters from all this types to  uint8*   val ?

   

   

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@yssu

   

Sorry, when I was not quite clear with my question.

   

I remembered to had seen that similar thread you showed up, but I wasn't able to find it. So my question was

   

With which keywords have you been able to find that thread again (or did you just know that)?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

@chaplin: Say you have a variable "char name[5]" and handle pair CYBLE_GATT_HANDLE_VALUE_PAIR_T  "handleValuePair". All you have to do is set handleValuePair.value.val=(uint8 *)name. Why we use pointers is because it makes definition of structures easier, or else there would have to be structures for every variable type.

   

Coming to the 100_Projects_in_100_Days, we will try to add more projects. We are working on it.

   

@Bob: I already knew it 🙂

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

I know it and I use it but it`s not comfortable. I talk about something like exist in other tool :

   

 1) AChar->SetValueAsString();
 2) AChar->SetValueAsUInt8();
 3) AChar->SetValueAsUInt16();
 4) AChar->SetValueAsUInt32();
 5) AChar->SetValueAsUInt64();
 6) AChar->SetValueAsInt8();
 7) AChar->SetValueAsInt16();
 😎 AChar->SetValueAsInt32();
 9) AChar->SetValueAsInt64();
10) AChar->SetValueAsDouble();
11) AChar->SetValueAsSingle();
ADevice->WriteCharacteristic(AChar);

0 Likes
Anonymous
Not applicable

Usually a combination of pointers and typecasting is used to make these assignments. I believe this is why there are no functions explicitly for conversion. Anyway, we will check if such functions can be included.

0 Likes