Vouching for Chat GPT again. Want to learn how to code? Give it your requirements and not only will it give you the code but will explain it properly. 1st pic is simple class example. 2nd pic is CoAP server initialization, 3rd is MQTT server implementation. Ridiculous