Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

Question about combining dns + websocket protocol

I have built a BLE peripheral in C (first C program). 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:
1) 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)
2) How can i have mongoose listen to "somename.local" address?
3) Can this also be 'threaded' so that i can use the main thread for the bluetooth related callbacks and have (both) mongoose connections running in a separate thread?

Thanx!

Comments

Sign In or Register to comment.