Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Is it possible to publish a String ?
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Is it possible to publish a String ?

by smkraph on Mon Feb 15, 2016 1:39 pm

Is it possible to publish a string to AdafruitIO (like, say, "Battery Low condition") ?

I have tried various syntaxes / variations of .publish(String) but the API seems only set up for (const char*) (double, uint8_t) (int32_t) (uint32_t) (uint8_t*, uint8_t)

Setup: ESP8266 (2.0 bd mgr), Arduino IDE 1.6.5

smkraph
 
Posts: 5
Joined: Sun Jan 10, 2016 3:49 pm

Re: Is it possible to publish a String ?

by adafruit2 on Tue Feb 16, 2016 10:02 pm

there should be something like String.toChar() or whatever, to get it into a character buffer, then send that :)

adafruit2
Site Admin
 
Posts: 19225
Joined: Fri Mar 11, 2005 7:36 pm

Re: Is it possible to publish a String ?

by dhalbert on Tue Feb 16, 2016 10:50 pm

smkraph wrote:Is it possible to publish a string to AdafruitIO (like, say, "Battery Low condition") ?

A const char* is the type of a regular C/C++ string; e.g., "abc" is a const char*. DId you mean that or an instance of the String class? If you have any code, could you show it?

(not an Adafruit employee)

dhalbert
 
Posts: 401
Joined: Tue Feb 17, 2015 6:18 pm

Please be positive and constructive with your questions and comments.