From 062d1d065f31552c6b35121de496897375e916fc Mon Sep 17 00:00:00 2001 From: hirotaka Date: Thu, 29 Mar 2018 23:10:11 +0900 Subject: [PATCH] Arduino don't have a IPAddress.toString(). --- coap.cpp | 5 +++-- library.properties | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/coap.cpp b/coap.cpp index b36788e..b4dcdb4 100644 --- a/coap.cpp +++ b/coap.cpp @@ -126,8 +126,9 @@ uint16_t Coap::send(IPAddress ip, int port, char *url, COAP_TYPE type, COAP_METH packet.messageid = rand(); // use URI_HOST UIR_PATH - packet.options[packet.optionnum].buffer = (uint8_t *)ip.toString().c_str(); - packet.options[packet.optionnum].length = ip.toString().length(); + String ipaddress = String(ip[0]) + String(".") + String(ip[1]) + String(".") + String(ip[2]) + String(".") + String(ip[3]); + packet.options[packet.optionnum].buffer = (uint8_t *)ipaddress.c_str(); + packet.options[packet.optionnum].length = ipaddress.length(); packet.options[packet.optionnum].number = COAP_URI_HOST; packet.optionnum++; diff --git a/library.properties b/library.properties index 8e33b06..2561d10 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=CoAP simple library -version=1.3.11 +version=1.3.12 author=Hirotaka Niisato maintainer=Hirotaka Niisato sentence=Simple CoAP client/server library for generic Arduino Client hardware.