I have built a BLE peripheral in C. The peripheral i made acts as Bluetooth keyboard, and also exposes a Mongoose websocket server on port 8000.
I can successfully send commands to the Mongoose websocket server which are correctly relayed via Bluetooth. So the groundwork is done.
Now i want to be able to transfer my code to ALSO run on a piece of hardware (ESP32 for example) that gets their IP via DHCP, i need somehow to expose the IP of the websocket server, and i was thinking about mDNS/zeroconf.
This made me think to implement the captive DNS sample code.
Questions:
- Can i use 1 manager, and just create an additional ‘DNS’ connection and for that connection set “mg_set_protocol_dns” ? Would this work, or can this cause issues with services that are already running (on the Pi for example)
- How can i have mongoose listen to “somename.local” address?
- Can this also be ‘threaded’ so that i can use the main thread for the bluetooth related callbacks and have (all) mongoose related communication running in a separate thread?
Thanx!