Doing a PUT

For Arduino users on XOBXOB
Posts: 1
Joined: Sat Aug 31, 2013 2:22 am

Doing a PUT

Postby jward448 » Mon Sep 09, 2013 9:25 pm

Using the XOBXOB_Connector. I need to do a PUT. Here is my scenario:

I get a XOB using XOB.requestXOB("MORSE").
Read a value an attribute called "state".
If it's "ON" then I read the value of another attribute called "message" and do something with it.
After that I need to change the value in "state" to "OFF".

It's clear how or if I can do this. I have successfully executed all (GET, POST, PUT and DELETE) functions with an external client but in this case I need the Arduino to do it using the connector.



Posts: 18
Joined: Sat Jul 27, 2013 8:41 am

Re: Doing a PUT

Postby xobxob » Tue Sep 17, 2013 7:50 am

Hi James. There's a new method in the XOBXOB libraries to update the value of a single XOB message. The method is called updateXOB and takes three strings as arguments for the XOB name, the message name, and the message contents. So for your example, the call might be:

updateXOB ("MORSE", "state", "OFF");

This will generate a response, in reply, that you have to deal with (you can just scan and ignore it if you want).

The updateXOB method is documented in the most recent library guide.

Return to “Arduino”

Who is online

Users browsing this forum: No registered users and 1 guest