Exemplo n.º 1
0
JNIEXPORT jstring JNICALL getUri(JNIEnv *env, jobject jobj)
{
    OC::OCRepresentation *rep = getHandle<OC::OCRepresentation>(env, jobj);
    string uri = rep->getUri();
    __android_log_print(ANDROID_LOG_INFO, TAG, "getUri() URI : %s", uri.c_str());
    return env->NewStringUTF(uri.c_str());
}
Exemplo n.º 2
0
void SensorRule::sensorChanged(const OC::OCRepresentation &sensor)
{
    RuleChangedEvent *event;

    if (sensor.getUri() != objectName().toStdString())
        return;

    event = new RuleChangedEvent(static_cast< QEvent::Type >(QEvent::User + 1));
    event->setSensorRepresentation(sensor);
    QApplication::instance()->postEvent(this, event);
}