void SensorRule::onHeartRateSelectChanged(QString value) { OC::OCRepresentation rep; rep.setValue("heartRate", value.toInt()); m_resource->put(rep, OC::QueryParamsMap(), IoTivity::onPut); }
JNIEXPORT void JNICALL setValueString(JNIEnv *env, jobject jobj, jstring jstr, jstring jval) { OC::OCRepresentation *rep = getHandle<OC::OCRepresentation>(env, jobj); string str = env->GetStringUTFChars(jstr,0); string val = env->GetStringUTFChars(jval,0); rep->setValue(str, val); }
void SensorRule::onCrazyJumpingChecked(bool checkedState) { bool state; OC::OCRepresentation rep; if (m_resource == nullptr) return; state = checkedState == Qt::Unchecked ? false : true; rep.setValue(IoTivity::IOTIVITY_CRAZY_JUMPING_RULE, state); m_resource->put(rep, OC::QueryParamsMap(), IoTivity::onPut); }