A CoAP server example specific for Raspberry Pi Pico. More...
Macros | |
| #define | LEDP LED_BUILTIN |
Functions | |
| Wiznet5100lwIP | eth (17, SPI, 21) |
| IPAddress | deviceIp (192, 168, 0, 99) |
| IPAddress | dns (0, 0, 0, 0) |
| IPAddress | gateway (0, 0, 0, 0) |
| IPAddress | subnet (255, 255, 255, 0) |
| void | callbackLight (Coap::Message &packet, IPAddress ip, uint16_t port) |
| void | callbackResponse (Coap::Message &packet, IPAddress ip, uint16_t port) |
| void | setup () |
| void | loop () |
Variables | |
| byte | mac [] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02} |
| WiFiUDP | Udp |
| Coap::Node | coapNode (Udp) |
| bool | LED_STATUS |
A CoAP server example specific for Raspberry Pi Pico.
Tested on WIZnet W5100S-EVB-Pico. Other boards may require changes.
Requirements:
The current light status can be read using:
and the light can be set ON or OFF, respectively, by using:
Note that on some boards, ON/OFF logic may be inverted.
| #define LEDP LED_BUILTIN |
| void callbackLight | ( | Coap::Message & | packet, |
| IPAddress | ip, | ||
| uint16_t | port ) |
| void callbackResponse | ( | Coap::Message & | packet, |
| IPAddress | ip, | ||
| uint16_t | port ) |
| IPAddress deviceIp | ( | 192 | , |
| 168 | , | ||
| 0 | , | ||
| 99 | ) |
| IPAddress dns | ( | 0 | , |
| 0 | , | ||
| 0 | , | ||
| 0 | ) |
| Wiznet5100lwIP eth | ( | 17 | , |
| SPI | , | ||
| 21 | ) |
| IPAddress gateway | ( | 0 | , |
| 0 | , | ||
| 0 | , | ||
| 0 | ) |
| void loop | ( | ) |
| void setup | ( | ) |
| IPAddress subnet | ( | 255 | , |
| 255 | , | ||
| 255 | , | ||
| 0 | ) |
| Coap::Node coapNode(Udp) | ( | Udp | ) |
| bool LED_STATUS |
| byte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02} |
| WiFiUDP Udp |