Hey Everyone -
First post, so please forgive any hiccups!
Writing some code for an argon, and having a heck of a time trying to get a particle event to publish. Here is the relevant excerpt from the code:
//make the connection
int response = httpsClientConnection(httpRequestContent, 0, NULL);
//TEMPORARY TEST - send event to particle
Particle.publish("FMToken Contents", string(response), PRIVATE));
I am using the Glowfi.sh HTTPS client library, and setting the response equal to an int variable. Then, I try to publish an event with that value, making sure to convert to string, but I continually get these compile errors for the publish line:
- no matching function for call to ‘std::__cxx11::basic_string<char>::basic_string(int&)’
- invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
I’ve used the format of
"Particle.publish("Title", string(variable), PRIVATE)
before with no issues. Any ideas what’s tripping me up here?