eclipse-agail / agile-core

Source code repository for agile core components
Eclipse Public License 2.0
7 stars 16 forks source link

Error on POST `/device/{deviceId}/{sensorName}` #51

Closed jordiescudero closed 6 years ago

jordiescudero commented 7 years ago

Hi, I'm trying to write data on one device through the http api but seems that the payload data parameter is missing and the subsequent Write does nothing.

@POST
@Path("/{sensorName}")
public void Write(@PathParam("id") String id, @PathParam("sensorName") String sensorName) throws DBusException {
    try {
      getDevice(id).Write();
    } catch (UnknownObject ex) {
      throw new AgileDeviceNotFoundException("Device not found");
    } catch (Exception ex) {
      throw new WebApplicationException("Error on writing data", ex);
    }
  }

Regards

ansriaz commented 6 years ago

fixed by Device write fixed.

TiSensorTag allows to enable/disable notifications. With this write functionality in TiSensorTag, you can turn on/off notification by passing 1/0 respectively.