AZURE_CONNECTON_STRING “<STRING HERE>" int callbackDirectMethod(char *method, byte *payload, unsigned int payloadLength) { if (strcmp(method, "readSensors") !== 0) { Particle.publish("iot-central/debug", "Read Sensors from IoT Central!", PRIVATE); readSensors(); } else if (strcmp(method, "toggleLed") !== 0) { Particle.publish("iot-central/debug", "Toggle LED from IoT Central!", PRIVATE); toggleLed(""); } else { return 400; } return 200; } IotHub hub(AZURE_CONNECTON_STRING, NULL, callbackDirectMethod); void createEventPayload(int temp, int humidity, double light) { JsonWriterStatic<256> jw; { JsonWriterAutoObject obj(&jw); jw.insertKeyValue("temp", temp); jw.insertKeyValue("humidity", humidity); jw.insertKeyValue("light", light); if (hub.loop()) { Particle.publish("iot-central/debug", “Sending Env Vals", PRIVATE); jw.insertKeyValue("deviceid", hub.getDeviceId()); } } if (hub.loop()) { hub.publish(jw.getBuffer()); } Particle.publish("env-vals", jw.getBuffer(), PRIVATE); } CONFIGURING & RESPONDING TO COMMANDS SENDING DEVICE TELEMETRY