I have 2 devices ESP32 which manage the connection to wifi, and nRF52 DK which manage the BLE connection.
When connecting my app to the nRF52, one of the characteristics I created must receive the IP that the wifi is connected to.
Both codes are based on Arduino.
On the ESP32 I'm using the library "WiFi.h" and the function WiFi.localIP() to obtain the IP.
This IP comes with this format(as an example): 192.168.1.77.
On the nRF52 DK I'm using "BLEPeripheral.h"
The next lines of code create the service and characteristics I need.
Code: Select all
BLEService wifiIP_service = BLEService("faa0");
BLEIntCharacteristic wifiIP_Char("faa1", BLERead | BLEWriteWithoutResponse | BLENotify);
BLEDescriptor wifiIP_Descriptor = BLEDescriptor("2901", "WIFI_IP");
After this I can write a value in the characteristic like this:
Code: Select all
wifiIP_Char.setValue(valueNeeded);
Thank you,
Pablo.