Closed chiararuggeri closed 7 years ago
I would also love to see this supported (advertising multiple services). Is there anything I can do to help make this feature a reality ?
I'm going this PR for now, as the following issues exist:
1) It reverts some changes
2) The Travis CI build is failing
3) setAdvertisedServiceUuid
is unclear now because it actually adds not sets (this is a breaking change IMO)
4) There is no nRF8001 board support.
Hi Sandeep, I added to the advertising module the capability to advertise more than a service, the appearance and the tx power. Take a look at the code and, if it can help you, add it to your repo. Here is a little example to try the new feature:
include
BLEPeripheral blePeripheral = BLEPeripheral();
BLEService serviceOne = BLEService("19b10001e8f2537e4f6cd104768a1214"); BLEService serviceTwo = BLEService("aaaa"); BLEService serviceThree = BLEService("bbbb");
void setup() { blePeripheral.setLocalName("AdvTest"); blePeripheral.setAdvertisedServiceUuid(serviceOne.uuid()); blePeripheral.setAdvertisedServiceUuid(serviceTwo.uuid()); blePeripheral.setAdvertisedServiceUuid(serviceThree.uuid()); blePeripheral.setAppearance(BLE_APPEARANCE_GENERIC_COMPUTER); blePeripheral.setTxPower(-40); blePeripheral.begin(); }
void loop() {}
Please notice that I tested this feature only with the nRF52 microcontroller. Regards, Chiara