Skip to content

Commit

Permalink
Arduino don't have a IPAddress.toString().
Browse files Browse the repository at this point in the history
  • Loading branch information
hirotakaster committed Mar 29, 2018
1 parent fa8c078 commit 062d1d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions coap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=CoAP simple library
version=1.3.11
version=1.3.12
author=Hirotaka Niisato <hirotakaster@gmail.com>
maintainer=Hirotaka Niisato <hirotakaster@gmail.com>
sentence=Simple CoAP client/server library for generic Arduino Client hardware.
Expand Down

0 comments on commit 062d1d0

Please sign in to comment.