From: Tomasz Marciniak Date: Wed, 11 Feb 2015 12:52:31 +0000 (+0100) Subject: [Sensor] Added SensorService class. X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~455 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54bc36a1549c1d684e266767c11cbfc04c6c9ca3;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Sensor] Added SensorService class. [Verification] Code compiles without errors. Change-Id: Ie4a1058a1af38c25b8885b349656604dbd1e193c Signed-off-by: Tomasz Marciniak --- diff --git a/src/sensor/sensor.gyp b/src/sensor/sensor.gyp index dead3021..d60eccf5 100644 --- a/src/sensor/sensor.gyp +++ b/src/sensor/sensor.gyp @@ -12,6 +12,8 @@ 'sensor_extension.h', 'sensor_instance.cc', 'sensor_instance.h', + 'sensor_service.cc', + 'sensor_service.h' ], 'includes': [ '../common/pkg-config.gypi', diff --git a/src/sensor/sensor_service.cc b/src/sensor/sensor_service.cc new file mode 100644 index 00000000..a8229de2 --- /dev/null +++ b/src/sensor/sensor_service.cc @@ -0,0 +1,34 @@ +// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "sensor_service.h" + +#include "common/logger.h" +#include "common/platform_exception.h" + +using namespace common; + +namespace extension { +namespace sensor { + +SensorService::SensorService() { + +} + +SensorService::~SensorService() { + +} + +SensorService* SensorService::GetInstance() { + static SensorService instance_; + return &instance_; +} + +void SensorService::GetAvailableSensors(picojson::object& out) { + LoggerD("Entered"); + +} + +} // namespace sensor +} // namespace extension diff --git a/src/sensor/sensor_service.h b/src/sensor/sensor_service.h new file mode 100644 index 00000000..4a56abd6 --- /dev/null +++ b/src/sensor/sensor_service.h @@ -0,0 +1,40 @@ +// Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SENSOR_SENSOR_SERVICE_H_ +#define SENSOR_SENSOR_SERVICE_H_ + +#include + +#include "common/picojson.h" + +namespace extension { +namespace sensor { + +class SensorService +{ + typedef struct { + sensor_h handle; + sensor_listener_h listener; + } SensorData; + + public: + static SensorService* GetInstance(); + void GetAvailableSensors(picojson::object& out); + + private: + SensorService(); + ~SensorService(); + + SensorData light_sensor_; + SensorData magnetic_sensor_; + SensorData pressure_sensor_; + SensorData proximity_sensor_; + SensorData ultraviolet_sensor_; +}; + +} // namespace sensor +} // namespace extension + +#endif // SENSOR_SENSOR_SERVICE_H_