BT-BLE: Possible to change the uuid via ConfigManager

Stargazer
Posts: 2
Joined: Sat Nov 28, 2020 7:24 pm

BT-BLE: Possible to change the uuid via ConfigManager

Postby Stargazer » Sat Nov 28, 2020 8:00 pm

Hi to all of this forum !

I use the ESP32 DevKit and want to build a garage opener with the ESP an a Shelly-Device.
So i want to switch the shelly via webhook and the posibillity of BLE.
For the configuration, i use the ConfigManager from Nick Wiersma:

https://github.com/nrwiersma/ConfigManager

On the HTML - Site on the ESP, i have a point to set the own UUID in 128bit.
This parameter will be stored on the ESP.

With the following part, i stored this uuid from the configManager to an array:

[Codebox]char* ibeacon1 = config.uuideins_name;[/Codebox]


The only thing i want is to transfer this ibeacon1 - char to the service UUID. Here is the code:

[Codebox]static BLEUUID serviceUUID("88bdf79f-59ec-4f47-bf82-39b957c5XXXX");[/Codebox]

Is ist possible to change it from an extern manager like the ConfigManager.

If i change it to : [Codebox]static BLEUUID serviceUUID(ibeacon1);[/Codebox] the UUID - number is missing.

I can control it with a [Codebox]Serial.println(serviceUUID.toString().c_str());[/Codebox]


I'am a little bit in trouble with the BLE - Libary's, i think... :?



Thanks a lot and best regards

André

Stargazer
Posts: 2
Joined: Sat Nov 28, 2020 7:24 pm

Re: BT-BLE: Possible to change the uuid via ConfigManager

Postby Stargazer » Mon Nov 30, 2020 7:22 pm

Hi,

the problem with the UUID is solved.

But, i want to use a second i-beacon - UUID for the filter.
In my case, i use the serviceUUID2 declaration of the BLEUUID.

Code: Select all

char* ibeacon2 = config.uuidzwei_name;
         static BLEUUID serviceUUID2(ibeacon2);
The Filter looks like:

Code: Select all

if (advertisedDevice.haveServiceUUID()&& advertisedDevice.isAdvertisingService(BLEUUID(serviceUUID2))& 
             advertisedDevice.getRSSI() > rssibeacon) 

Everything runs perfect. But if i send these UUID from nFC for mobile, he doesn't react.

Has anybody the same problem ?


BR

André

Who is online

Users browsing this forum: Baidu [Spider] and 61 guests