#define TAG PCF("ocserver")
void ocInitialize () {
- char ipAddr[16] = "";
- OCGetInterfaceAddress (NULL, 0, AF_INET, (uint8_t *)ipAddr, 16);
OC_LOG(DEBUG, TAG, PCF("IP addr is:"));
OC_LOG_BUFFER(INFO, TAG, (uint8_t*)ipAddr, sizeof(ipAddr));
delay(2000);
- OCInit (ipAddr, 8001, OC_SERVER);
+ OCInit (NULL, 0, OC_SERVER);
}
void setup() {
- Serial.begin(115200);
-
+ Serial.begin(115200);
+
Serial.println ("Trying to get an IP addr using DHCP");
if (Ethernet.begin(ETHERNET_MAC) == 0) {
Serial.println("DHCP failed");
}
void loop() {
- Serial.println ("Processing CoAP messages!\n");
+ Serial.println ("Processing CoAP messages!\n");
OCProcess ();
- delay(1000);
+ delay(1000);
}
+