Closed daniel-v closed 3 weeks ago
The second call to setservicedata will overwrite the first. There is no provision in that call to handle multiples and with 2 128bit uuids there is not enough room in the advertisement packet.
You'll need to create 2 instances of NimBLEAdvertisementData, one for the advertisement and one for the scan response and put each service data into one or the other of those then set the advertisement and scan data. The iBeacon example shows how to do this.
I've been trying to advertise multiple services with a couple of bytes of data each.
This is the code:
I expected both services to be advertised but it seems like only the 2nd one is being adverted. (I checked with nRF Connect app). Is it possible that only a single service can be adverted?