Recent Changes - Search:

ParticipatorySensing

In this section we explain in detail the tools provided by the SmartSantander platform that assist the developer to build service(s) and/or application(s) that follow a participatory sensing approach. Moreover we describe the functionalities provided by the PSens server and client libraries: Java and Objective-C.

PSens Server

The PSens Server is a server component that sits on the Service Manager Layer of the SmartSantander platform. This component supports the registration/deresgistration of participatory sensing devices into the SmartSantander platform; submission of observations into the SmartSantander platform; and retrieval of historical sensed data. The following figure shows the architecture of the Pace Of The City service; a service that makes use of the participatory sensing approach.

The mobile nodes on the right connect to the PSens Server in order to register themselves; to send observations; and to retrieve historical data. Each of these functionalities is available via a RESTfull interface provided by the PSens Server. In the following sections we will explain in detail each of the functionalities.

PSens Server interface

The PSens Server component provides the following operations:

  • RegisterDeviceResponseDTO registerDevice(DeviceDTO device);
  • UnregisterDeviceResponseDTO unregisterDevice(String deviceUUID);
  • ObservationPublicationResponseDTO submitObservations(Collection<Observation> observations, String deviceUUID);
  • Collection<Observation> getHistoricalData(HistoricalPeriod period);

Device Registration

The registration message call contains the device information. The device information is represented by the DeviceDTO class. This object contains the following structure:

The DeviceDTO object contains three elements: the deviceInfo of type DeviceInfoDTO, a collection of device capabilities, and a collection of applications. The device capabilities are the sensor capabilities that the device has; and the applications are the applications that will make use of the participatory sensing; each application has a collection of capabilities that are the application related capabilities that will be used by the application to submit observations to the SmartSantander platform. As result of the device registration call, the application or service gets a unique identifier deviceUUID generated by the PSens Server when registering the device into the SmartSantander platform. This deviceUUID needs to be stored in the phone since you will need it to interact with the PSens Server in further calls.

Submit Observations

To submit observations the application or service needs to call the submitObservation method; an observation contains a date; the gps coordinates where it took place; a deviceUUID and a set of measurements; a measurement contains a type, a raw value and units. The following class diagram shows the classes involved:

The method submitObservations takes a set of observations and the deviceUUID of your device (the one returned from PSens when calling the register method).

  • ObservationPublicationResponseDTO submitObservations(Collection<Observation> observations, String deviceUUID);

As result of the submit observations call you will receive a boolean; if true then the submission of observations to the SmartSantander was successful; false if an error occurred.

Get Historical Data

To retrieve historical observation data from your device you need to call the getHistoricalData of the participatory sensing service interface; this method takes one parameter, the period of HistoricalPeriod type; this type contains a date from and to where you specify the period of time from which you want to retrieve the historical data.

  • Collection<Observation> getHistoricalData(HistoricalPeriod period);

As a result you will receive the set of observations of your device that occurred in the time frame you specified as the period parameter.

Unregister Device

In order to deregister your device in the SmartSantander platform you will need to call the unregisterDevice method; this method takes the deviceUUID of your device as parameter.

  • UnregisterDeviceResponseDTO unregisterDevice(String deviceUUID);

As result you will receive a boolean; if true the device was successfuly deregistered from the SmartSantander platform; false otherwise.

Client Libraries

We currently have client libraries for the PSens Server for Java and Objective-C. You can download them here.

- Link Java - Link Objective-C

Edit - History - Print - Recent Changes - Search
Page last modified on November 30, 2012, at 04:38 AM