BLE LocalName

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

cross mob
Anonymous
Not applicable

Hello guys,

   

I need your help again 🙂

   

I configured my PSoC 4200 BLE as I²C to BLE Bridge as shown in the PSoC 100 projects in 100 day (No.35).
The project works great, my data sent by an Arduino Uno to the PSoC.
With the Cypress BLE App I can read the Characteristics and the value.

   

But I want to display the value without reading the characteristics(a scanning client should be able to read the value just by scanning).
I heard that it is possible to directly transfer the value as the name of the device.
So I want to let a variable be the "Local Name" of the device.

   

I know that there is the API " CyBle_GapSetLocalName" but how do I get the I²C value in this command?

0 Likes
1 Solution
Anonymous
Not applicable

void sendI2CNotification(void) is called whenever new I2C data is received; Rewrite the internal logic to set the CyBle_GapSetLocalName() based on the I2C data received. wrBuf is the pointer to the I2C received buffer, and byteCnt is the count of data bytes received. You might need to turn off the BLE radio advertising/connecting/scanning in order to set the local name, but you should be able to determine that yourself 🙂

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

void sendI2CNotification(void) is called whenever new I2C data is received; Rewrite the internal logic to set the CyBle_GapSetLocalName() based on the I2C data received. wrBuf is the pointer to the I2C received buffer, and byteCnt is the count of data bytes received. You might need to turn off the BLE radio advertising/connecting/scanning in order to set the local name, but you should be able to determine that yourself 🙂

0 Likes
Anonymous
Not applicable

Okay, I understand.
But the parameter of GapSetLocalName is a const8 char.
The value of the I²C data is integer datatype.

   

At the moment I have problems converting this integer value into string/const8 char.
Can you help me at this issue?

0 Likes
Anonymous
Not applicable

Since it requires a string, you merely need to convert the integer how you want into a character or multiple characters and pass them as a string to the function call.