You are here

Need help in understanding the eddystone project | Cypress Semiconductor

Need help in understanding the eddystone project

Summary: 3 Replies, Latest post by e.pratt_1639216 on 22 May 2017 03:39 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
Dheeraj Dake's picture
User
49 posts

Hello,
I am using CYBLE-012011 eval board and I have successfully transmitted beacons by making necessary changes to the eddyStone project for PSoC-4-BLE.
In eddyStone.c --> ConfigureAdvPacket(bool isPacketRegular), 

/* Service Data */
cyBle_discoveryData.advData[7] = 0x0E; /* Length */
cyBle_discoveryData.advData[8] = 0x16; /* Service Data */
cyBle_discoveryData.advData[9] = 0xAA; /* LSB - Eddystone Service */
cyBle_discoveryData.advData[10] = 0xFE; /* MSB - Eddystone Service */
cyBle_discoveryData.advData[11] = 0x10; /* Signifies Eddystone URL */
cyBle_discoveryData.advData[12] = 0xF2; /* Ranging data: -14dB*/
cyBle_discoveryData.advData[13] = 0x00; /* URL scheme- http://www. */
cyBle_discoveryData.advData[14] = 0x63; /* Encoded URL - 'c' */
cyBle_discoveryData.advData[15] = 0x79; /* Encoded URL - 'y' */
cyBle_discoveryData.advData[16] = 0x70; /* Encoded URL - 'p' */
cyBle_discoveryData.advData[17] = 0x72; /* Encoded URL - 'r' */
cyBle_discoveryData.advData[18] = 0x65; /* Encoded URL - 'e' */
cyBle_discoveryData.advData[19] = 0x73; /* Encoded URL - 's' */
cyBle_discoveryData.advData[20] = 0x73; /* Encoded URL - 's' */
cyBle_discoveryData.advData[21] = 0x00; /* Expansion - .com */
/* ADV packet length */
cyBle_discoveryData.advDataLen = 28;
 

After beaconing this shows in LOCATE android app as

URL in APP:
http://www.cypress.com/ (Eddystone-URL)

When I add more data and increase the cyBle_discoveryData.advDataLen accordingly, I am not able to see the entire data in the beacon URL. Say if I want to transmit a data Len of 28,

I have added more 's' characters from array index [22] to [26] and set index [27] to 0x00

cyBle_discoveryData.advDataLen = 28;

​URL in APP:
http://www.cypresss (Eddystone-URL)

I am missing data from array index [22]. What am I doing wrong? Are there any other flags which I should modify?

Thanks
Dheeraj

e.pratt_1639216's picture
User
372 posts

cyBle_discoveryData.advData[7] = 0x0E; /* Length */

Needs to be set to the length of data you are sending, so the value will need to change accordingly.

Dheeraj Dake's picture
User
49 posts

Got it. I thought that cyBle_discoveryData.advData[7] is the length of the service data(not including my data).

In the original example, service data is from index [0] to [13] which is 14 bytes(0xE)

​cyBle_discoveryData.advData[7]  = 0x0E;  // WHY? Shouldn't it be 8 bytes? Data is from [14] to [21]
The packet length is specified in cyBle_discoverData.advDataLen which is 22 bytes. 

Also with cyBle_discoveryData.advDataLen field set, I am getting random characters in my URL

 

e.pratt_1639216's picture
User
372 posts

cyBle_discoveryData.advData[7]  is the length of all bytes associated with the service being transmitted, which includes both the header flag bytes ([8],[9],[10],[11],[12],[13]).

cyBle_discoverData.advDataLen is the length of physical bytes to send over the radio (size of everything in the .advData[] array), whereas the .advData[7] field is the length of data/bytes following the length field (.advData[7]) which should be associated with this service (Null-delimiter is application-level, not byte level, and hence you need to be adjusting the lengths to match the data.)

If you aren't using the structure/array instance pointing to the correct data, then the default structure will probably contain invalid data. If you want more specifics, posting the project would help :)

Log in to post new comments.