-
I want to advertise this object in order to comply to the standard:
which standard? GATT Heart Rate Service documented here
https://www.bluetooth.com/specifications/specs/heart-rate-profile-1-0/
is different from just advertising the data. Just went briefly through HRP_V10.pdf and don't see that you should advertise it "to comply to the standard"You are mixing two relatively unrelated BLE features. Advertising is GAP. Services/characteristics is GATT. GATT works over connections, advertising does not.
You need to call http://www.espruino.com/Reference#l_NRF_setAdvertising with
whenConnected:true
I'm not entirely sure what you mean about complex objects - you can advertise multiple services, but there is only so much space available in the packet (it's ~20 bytes).