ProsecCoAP 🥂
 
Loading...
Searching...
No Matches
client.ino File Reference
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <ProsecCoAP.h>

Functions

IPAddress deviceIp (192, 168, 0, 99)
 
void callbackResponse (Coap::Message &message, IPAddress ip, uint16_t port)
 
void setup ()
 
void loop ()
 

Variables

byte mac [] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02}
 
IPAddress destinationIp = IPAddress(192, 168, 0, 100)
 
EthernetUDP Udp
 
Coap::Node coapNode (Udp)
 

Function Documentation

◆ callbackResponse()

void callbackResponse ( Coap::Message & message,
IPAddress ip,
uint16_t port )

◆ deviceIp()

IPAddress deviceIp ( 192 ,
168 ,
0 ,
99  )

◆ loop()

void loop ( )

◆ setup()

void setup ( )

Variable Documentation

◆ coapNode

Coap::Node coapNode(Udp) ( Udp )

◆ destinationIp

IPAddress destinationIp = IPAddress(192, 168, 0, 100)

◆ mac

byte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02}

Example CoAP Client.

This example sends a confirmable GET request to a CoAP server and handles any response.

To test this example, you can use a CoAP server such as libcoap or microcoap. You may also test with:

coap-server-notls -v 9

Note that coap-server-notls exposes a "time" endpoint that returns the current timestamp as payload.

◆ Udp

EthernetUDP Udp