You are here

How can change Device Name | Cypress Semiconductor

How can change Device Name

Summary: 10 Replies, Latest post by yssu on 05 Oct 2016 02:05 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
chaplin.u_1533771's picture
User
132 posts

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.

yssu's picture
Cypress Employee
42 posts

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-adver...

Hope this helps!

chaplin.u_1533771's picture
User
132 posts

Thanks !

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

 

user_1377889's picture
User
10400 posts

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

chaplin.u_1533771's picture
User
132 posts

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 ?

 

yssu's picture
Cypress Employee
42 posts

@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.

chaplin.u_1533771's picture
User
132 posts

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 ?

user_1377889's picture
User
10400 posts

@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

yssu's picture
Cypress Employee
42 posts

@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 :)

chaplin.u_1533771's picture
User
132 posts

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();
 8) AChar->SetValueAsInt32();
 9) AChar->SetValueAsInt64();
10) AChar->SetValueAsDouble();
11) AChar->SetValueAsSingle();
ADevice->WriteCharacteristic(AChar);

 

yssu's picture
Cypress Employee
42 posts

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.

 

Log in to post new comments.