Cypress BLE mesh client applications

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

cross mob
LuLu_4493096
Level 1
Level 1
First question asked First reply posted

Hi,

I am interested in knowing how Cypress BLE mesh client applications (both for windows and smartphone), communicate with the nodes.


In particular, do they use GATT bearer (to connect to the proxy nodes) or do they use Advertising bearer to send a message to all of the nodes through advertising?


however, it seems that the IOS application uses the GATT bearer but I don't know about the windows and Android applications.

‎Cypress MeshApp on the App Store

Thanks a lot

0 Likes
1 Solution
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

If OS Platform supports sending arbitrary advertisement packets and can scan/receive the advertisement packets, it indeed does not need to use a GATT Proxy. The problem is that the phone OSes typically do not provide an interface to send a single advertisement packet. Android indeed allows you to start advertising stream, but it is a bit clumsy to stop the stream after application thinks that required number of retransmissions have been sent.

More importantly, unlike the GATT connection, where master and slave are synchronized, the mesh traffic is asynchronous and it is not possible to guess when somebody is sending you a message. To implement a mesh device without a GATT proxy, the phones would need to listen pretty close to 100% of the time, which affects the battery, affects performance of other BT profiles (for ex. audio), affects WiFi coexistance.

View solution in original post

9 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi lulu_4493096

Cypress BLE mesh stack is fully compliant with BLE mesh spec released by Bluetooth SIG. Please go through the app note for learning about Cypress ble mesh implementation from basics. https://www.cypress.com/file/473921/download

Peer application (Win, android, ios) will be connected to the proxy node through GATT connection. Proxy node helps to advertise the mesage to the network. Please go through the source code of the peer application to understand the implementation part.

Please go through the SIG mesh spec (profile and models) for more details regarding mesh working. https://www.bluetooth.com/specifications/mesh-specifications/

Thanks,

-Dheeraj

0 Likes

Hi Dheeraj,

Thanks, I have read the specification.

Back to my question, is there any reason that your smartphone/pc apps do not support sending msg by advertising? And do you have any plan for adding this support?

P.S. GATT connection is one way of communication, I am asking about sending a message by a smartphone to all the nodes.

0 Likes

Hi Luca Luca,

I believe it is possible to advertise mesh messages from smartphones/PC, but it is little complicated since Bluetooth stack running on these devices (android, Windows, ios) are different and also does not have full control on the radio. So currently GATT proxy is used. GATT proxy node is a bridge node between mesh network and traditional BLE devices (which does not have entire mesh stack on it) and it helps these devices to take part in mesh communication.

VictorZ_46

Thanks,

-Dheeraj

0 Likes

Hi Dheeraj,

Thanks for your response.


Well, no device has the entire MESH stack on it, am I right? it is to be implemented as far as I know
The problem with proxy nodes is it has a limitation, and the cellphone must be in its range.

I know that advertising mesh messages from smartphones should be more complicated, but I want to understand it better.
For example, the are APIs for advertising regular BLE messages in Android, so it should be possible to use them in the bearer layer in the BLE mesh stack instead of GATT, is that true?

Thanks

0 Likes
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

If OS Platform supports sending arbitrary advertisement packets and can scan/receive the advertisement packets, it indeed does not need to use a GATT Proxy. The problem is that the phone OSes typically do not provide an interface to send a single advertisement packet. Android indeed allows you to start advertising stream, but it is a bit clumsy to stop the stream after application thinks that required number of retransmissions have been sent.

More importantly, unlike the GATT connection, where master and slave are synchronized, the mesh traffic is asynchronous and it is not possible to guess when somebody is sending you a message. To implement a mesh device without a GATT proxy, the phones would need to listen pretty close to 100% of the time, which affects the battery, affects performance of other BT profiles (for ex. audio), affects WiFi coexistance.

Hi VictorZ_46​,


Thanks for your response.

The problem is that the phone OSes typically do not provide an interface to send a single advertisement packet. Android indeed allows you to start advertising stream, but it is a bit clumsy to stop the stream after application thinks that required number of retransmissions have been sent.

So when advertising is started it cannot be stopped anymore? at least not quickly.

Is that what you are saying? If yes, then how many packets are will be sent minimum? (in case of Android for example)

the phones would need to listen pretty close to 100% of the time, which affects the battery, affects performance of other BT profiles (for ex. audio), affects WiFi coexistance.

This should not be a problem as the cellphone is to be used mostly for sending messages and not receiving them, so the app could be closed afterward.

0 Likes

When host starts and then stops advertisement stream, the controller can send 0, 1, or more advertisement packets depending on a lot of different conditions.

A device has to receive secure network beacons to understand if key refresh or iv update procedure is in progress. In most cases, the phone would be interested to receive replies.

But if you think that it is not a problem, please go ahead and implement whatever you need. We cannot stop you.

I just wanted to make sure that the Android BLE advertising API could be used in the first place or not.

From your last reply, it seems there is no limitation in this respect, and I can implement it by myself.
Thanks

0 Likes
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

If the goal is to have something production ready, I strongly recommend against that. But if you want to practice in Android development and learn BLE mesh protocol, it would definitely be a good exercise.