protected void settempMeasurement(TempStruct newValue) {
    if (tempMeasurement != newValue) {
      tempMeasurement = newValue;

      Logger.log(myDeviceInfo.getName(), "TemperatureSensor", "Publishing tempMeasurement");

      this.myPubSubMiddleware.publish("tempMeasurement", newValue, myDeviceInfo);
    }
  }
  private static void setUpNode(Device deviceInfo) {

    myPubSub =
        (PubSubMiddleware)
            IoTSuiteFactory.getInstance(deviceInfo.getProtocol(), setUpDeviceInfo(), myContext);

    LogicSmartHomeApp logicSmartHomeAppImpl =
        new LogicSmartHomeApp(myPubSub, deviceInfo, ui, (Context) myContext);
    new Thread(logicSmartHomeAppImpl).start();
  }
示例#3
0
  public void notifyReceived(String eventName, Object arg, Device deviceInfo) {
    try {

      if (eventName.equals("getprofile")) {
        Logger.log(myDeviceInfo.getName(), "ProfileDB", "CommandReceived getprofile");

        onNewprofileRequestReceived((String) arg);
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
  }