0 Replies Latest reply on Dec 25, 2015 9:25 AM by mrobregado RSS
    mrobregado Explorer

    ThingWorx Read and Write C API's

    Hi,

     

       I am trying to send sensor data from my Texas Instruments Launchpad to Thingworx. I am looking for C libraries that I can use at ThingWorx, but so far, I do not know where to download C libraries. Where at ThingWorx can I download the C Library.

     

    I found this C API for writing to Thingworx from this blog. Is there a read version of this?

     

    Getting Started with the Arduino Uno & ThingWorx - EAC Blog

    void ThingWorx::UpdateValues(double values[] , WiFiClient &client, char server[], char appKey[], char thingName[], char serviceName[], char* sensorNames[])

    {

     

     

    if (client.connect(server, 80)) {

     

        // send the HTTP POST request:

        client.print("POST /Thingworx/Things/");

        client.print(thingName);

        client.print("/Services/");

        client.print(serviceName);

        client.print("?appKey=");

        client.print(appKey);

        client.print("&method=post&x-thingworx-session=true");

        client.print("<");

       

        for(int idx = 0; idx < _sensorCount; idx++)

        {

        client.print("&");

        client.print(sensorNames[idx]);

        client.print("=");

        client.print(values[idx]);

        }

        client.print(">");

        client.println(" HTTP/1.1");

        client.print("Host: ");

        client.println(server);

        client.println("Content-Type: text/html");

        client.println();

     

     

      while (client.available()) {

        char c = client.read();

        Serial.print(c);

      }

     

      client.stop();

      }

      else {

        // if you couldn't make a connection:

     

        client.stop();

      }

    }