Sensor API (Samsung Extension)

This API defines interfaces and methods to manage sensor data from various sensors on the device.

The following sensor functionality is provided:

Since: 2.2.1.3

Table of Contents


Summary of Interfaces and Methods

Interface Method
SensorServiceManagerObject
SensorService Sensor getDefaultSensor (SensorType type)
SensorType[] getAvailableSensors ()
Sensor void start (SuccessCallback successCallback, optional ErrorCallback? errorCallback)
void stop ()
void setChangeListener (SensorDataSuccessCallback successCallback)
void unsetChangeListener ()
LightSensor void getLightSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
MagneticSensor void getMagneticSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
PressureSensor void getPressureSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
ProximitySensor void getProximitySensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
UltravioletSensor void getUltravioletSensorData (SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback)
SensorData
SensorLightData
SensorMagneticData
SensorPressureData
SensorProximityData
SensorUltravioletData
SensorDataSuccessCallback void onsuccess (optional SensorData? sensorData)

1. Type Definitions

1.1. SensorType

Available sensor types to the API.

Deprecated. LIGHT, MAGNETIC, PRESSURE, PROXIMITY, ULTRAVIOLET is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET" };

Since: 2.2.1.3

The sensor types defined by this enumerator are:

  • LIGHT - Light sensor
  • MAGNETIC - Magnetic sensor
  • PRESSURE - Pressure sensor
  • PROXIMITY - Proximity sensor
  • ULTRAVIOLET - Ultraviolet sensor

1.2. ProximityState

Proximity state.
    enum ProximityState { "FAR", "NEAR" };

Since: 2.2.1.3

1.3. MagneticSensorAccuracy

The accuracy of magnetic sensor data.
    enum MagneticSensorAccuracy { "ACCURACY_UNDEFINED", "ACCURACY_BAD", "ACCURACY_NORMAL", "ACCURACY_GOOD", "ACCURACY_VERYGOOD" };

Since: 2.2.1.3

2. Interfaces

2.1. SensorServiceManagerObject

The SensorServiceManagerObject interface defines what is instantiated by the WebAPIs object. The webapis.sensorservice object allows access to the sensor.
    [NoInterfaceObject] interface SensorServiceManagerObject {
        readonly attribute SensorService sensorservice;
    };
    WebAPIs implements SensorServiceManagerObject;

Since: 2.2.1.3

2.2. SensorService

The SensorServiceManagerObject interface provides methods to access sensor.
    [NoInterfaceObject] interface SensorService {

        Sensor getDefaultSensor(SensorType type);

        SensorType[] getAvailableSensors();

    };

Since: 2.2.1.3

Methods

getDefaultSensor
Gets the default sensor of the device for the given sensor type.
Sensor getDefaultSensor(SensorType type);
             

Since: 2.2.1.3

Parameters:

  • type: The sensor type to access

Return value:

Sensor The default sensor object.

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if accessing a given sensor type fails because of an unknown error.

    • with error type NotSupportedError, if this feature is not supported.

Code example:

 var proximitySensor = webapis.sensorservice.getDefaultSensor("PROXIMITY");
 
getAvailableSensors
Gets the available sensor types.
SensorType[] getAvailableSensors();
             

Since: 2.2.1.3

Return value:

SensorType[] All available sensor types.

Exceptions:

  • WebAPIException
    • with error type UnknownError, if getting available sensor type fails because of an unknown error.

Code example:

 var sensorCapabilities = webapis.sensorservice.getAvailableSensors();

 console.log("capable sensor : " + sensorCapabilities[0]);
 

2.3. Sensor

The Sensor interface provides methods to get the sensor type and access sensor data.
    [NoInterfaceObject] interface Sensor {

        readonly attribute SensorType sensorType;

        void start(SuccessCallback successCallback, 
                                optional ErrorCallback? errorCallback);

        void stop();

        void setChangeListener(SensorDataSuccessCallback successCallback);
        
        void unsetChangeListener();
    };

Since: 2.2.1.3

Attributes

  • readonly SensorType sensorType
    Sensor type to monitor the changes.

    Since: 2.2.1.3

Methods

start
Starts the sensor.
void start(SuccessCallback successCallback, optional ErrorCallback? errorCallback);
             

Since: 2.2.1.3

Parameters:

  • successCallback: Callback method to be invoked when sensor has been successfully started
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if starting the sensor fails because of an unknown error.

Code example:

 var proximitySensor = webapis.sensorservice.getDefaultSensor("PROXIMITY");

 function onsuccessCB() {
                console.log("The proximity sensor started successfully.");
 }

 proximitySensor.start(onsuccessCB);
 
stop
Stops the sensor.
void stop();
             

Since: 2.2.1.3

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if stopping the sensor fails because of an unknown error.

Code example:

 var proximitySensor = webapis.sensorservice.getDefaultSensor("PROXIMITY");

 function onsuccessCB() {
                console.log("proximity sensor start");
                proximitySensor.stop();
 }

 proximitySensor.start(onsuccessCB);
 
setChangeListener
Registers a change listener to be called when sensor data of the given type changes.
void setChangeListener(SensorDataSuccessCallback successCallback);
             

Since: 2.2.1.3

Note that the setChangeListener() method only registers the listener. The start() method must be called to turn on the sensor or the sensor data will not change.

Parameters:

  • successCallback: Callback method to be invoked when the sensor data changes

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if registering the listener fails because of an unknown error.

Code example:

 var proximitySensor = webapis.sensorservice.getDefaultSensor("PROXIMITY");

 function onsuccessCB() {
                console.log("proximity sensor start");
 }

 function onchangedCB(sensorData) {
                console.log("proximity distance : " + sensorData.proximityState);
 } 

 proximitySensor.setChangeListener(onchangedCB);

 proximitySensor.start(onsuccessCB);
 
unsetChangeListener
Unregisters the sensor data change listener.
void unsetChangeListener();
             

Since: 2.2.1.3

Exceptions:

  • WebAPIException
    • with error type UnknownError, if unregistering the listener fails because of an unknown error.

Code example:

 var proximitySensor = webapis.sensorservice.getDefaultSensor("PROXIMITY");

 function onchangedCB(sensorData) {
                console.log("proximity distance : " + sensorData.proximityState);
 } 

 proximitySensor.setChangeListener(onchangedCB);

 proximitySensor.unsetChangeListener();
 

2.4. LightSensor

The LightSensor interface provides methods to access light sensor data.

Deprecated. LightSensor interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface LightSensor : Sensor {

        void getLightSensorData(SensorDataSuccessCallback successCallback,
                                optional ErrorCallback? errorCallback);
    };

Since: 2.2.1.3

Methods

getLightSensorData
Gets the current sensor data.
void getLightSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);
             

Since: 2.2.1.3

Note that before calling the getLightSensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getLightSensorData method is called without calling the start method.
  • UnknownError : An unknown error has occurred.

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if retrieving the sensor data fails because of an unknown error.

Code example:

 var lightSensor = webapis.sensorservice.getDefaultSensor("LIGHT");

 function onGetSuccessCB(sensorData) {
                console.log("light level : " + sensorData.lightLevel);
 } 

 function onerrorCB(error) {
                console.log("error occurs");
 } 

 function onsuccessCB() {
                console.log("sensor start");
                lightSensor.getLightSensorData(onGetSuccessCB, onerrorCB);
 }

 lightSensor.start(onsuccessCB);

 

2.5. MagneticSensor

The MagneticSensor interface provides methods to access magnetic sensor data.

Deprecated. MagneticSensor interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface MagneticSensor : Sensor {

        void getMagneticSensorData(SensorDataSuccessCallback successCallback,
                                optional ErrorCallback? errorCallback);
    };

Since: 2.2.1.3

Methods

getMagneticSensorData
Gets the current sensor data.
void getMagneticSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);
             

Since: 2.2.1.3

Note that before calling the getMagneticSensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getMagneticSensorData method is called without calling the start method.
  • UnknownError : An unknown error has occurred.

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if retrieving the sensor data fails because of an unknown error.

Code example:

 var magneticSensor = webapis.sensorservice.getDefaultSensor("MAGNETIC");

 function onGetSuccessCB(sensorData) {
                console.log("magnetic field of the X axis : " + sensorData.x);
                console.log("magnetic field of the Y axis : " + sensorData.y);
                console.log("magnetic field of the Z axis : " + sensorData.z);
 } 

 function onerrorCB(error) {
                console.log("error occurs");
 } 

 function onsuccessCB() {
                console.log("sensor start");
                magneticSensor.getMagneticSensorData(onGetSuccessCB, onerrorCB);
 }

 magneticSensor.start(onsuccessCB);

 

2.6. PressureSensor

The PressureSensor interface provides methods to access pressure sensor data.

Deprecated. PressureSensor interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface PressureSensor : Sensor {

        void getPressureSensorData(SensorDataSuccessCallback successCallback,
                                optional ErrorCallback? errorCallback);
    };

Since: 2.2.1.3

Methods

getPressureSensorData
Gets the current sensor data.
void getPressureSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);
             

Since: 2.2.1.3

Note that the start() method should be called before calling the getPressureSensorData() method to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getPressureSensorData method is called without calling the start method.
  • UnknownError : An unknown error has occurred.

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if retrieving the sensor data fails because of an unknown error.

Code example:

 var pressureSensor = webapis.sensorservice.getDefaultSensor("PRESSURE");

 function onGetSuccessCB(sensorData) {
                console.log("pressure : " + sensorData.pressure);
 } 

 function onerrorCB(error) {
                console.log("error occurs");
 } 

 function onsuccessCB() {
                console.log("sensor start");
                pressureSensor.getPressureSensorData(onGetSuccessCB, onerrorCB);
 }

 pressureSensor.start(onsuccessCB);

 

2.7. ProximitySensor

The ProximitySensor interface provides methods to access proximity sensor data.

Deprecated. ProximitySensor interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface ProximitySensor : Sensor {

        void getProximitySensorData(SensorDataSuccessCallback successCallback,
                                optional ErrorCallback? errorCallback);
    };

Since: 2.2.1.3

Methods

getProximitySensorData
Gets the current sensor data.
void getProximitySensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);
             

Since: 2.2.1.3

Note that before calling the getProximitySensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getProximitySensorData method is called without calling the start method.
  • UnknownError : An unknown error has occurred.

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if retrieving the sensor data fails because of an unknown error.

Code example:

 var proximitySensor = webapis.sensorservice.getDefaultSensor("PROXIMITY");

 function onGetSuccessCB(sensorData) {
                console.log("proximity state : " + sensorData.proximityState);
 } 

 function onerrorCB(error) {
                console.log("error occurs");
 } 

 function onsuccessCB() {
                console.log("proximity sensor start");
                proximitySensor.getProximitySensorData(onGetSuccessCB, onerrorCB);
 }

 proximitySensor.start(onsuccessCB);

 

2.8. UltravioletSensor

The UltravioletSensor interface provides methods to access ultraviolet sensor data.

Deprecated. UltravioletSensor interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface UltravioletSensor : Sensor {

        void getUltravioletSensorData(SensorDataSuccessCallback successCallback,
                                optional ErrorCallback? errorCallback);
    };

Since: 2.2.1.3

Methods

getUltravioletSensorData
Gets the current sensor data.
void getUltravioletSensorData(SensorDataSuccessCallback successCallback, optional ErrorCallback? errorCallback);
             

Since: 2.2.1.3

Note that before calling the getUltravioletSensorData() method, the start() method should be called to turn on the sensor.

The ErrorCallback method is launched with these error types:

  • ServiceNotAvailableError : If the getUltravioletSensorData method is called without calling the start method.
  • UnknownError : An unknown error has occurred.

Parameters:

  • successCallback: Callback method to be invoked when the sensor data has been read
  • errorCallback [optional] [nullable]: Callback method to be invoked when an error occurs

Exceptions:

  • WebAPIException
    • with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

    • with error type UnknownError, if retrieving the sensor data fails because of an unknown error.

Code example:

 var ultravioletSensor = webapis.sensorservice.getDefaultSensor("ULTRAVIOLET");

 function onGetSuccessCB(sensorData) {
                console.log("ultraviolet level : " + sensorData.ultravioletLevel);
 } 

 function onerrorCB(error) {
                console.log("error occurs");
 } 

 function onsuccessCB() {
                console.log("ultraviolet sensor start");
                ultravioletSensor.getUltravioletSensorData(onGetSuccessCB, onerrorCB);
 }

 ultravioletSensor.start(onsuccessCB);

 

2.9. SensorData

The SensorData interface is a common abstract interface used by different types of sensor data objects.
    [NoInterfaceObject] interface SensorData {
     };

Since: 2.2.1.3

2.10. SensorLightData

The SensorLightData interface represents light sensor data.

Deprecated. SensorLightData interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface SensorLightData : SensorData {

        readonly attribute double lightLevel;
    };

Since: 2.2.1.3

Attributes

  • readonly double lightLevel
    Ambient light level in lux.

    Since: 2.2.1.3

2.11. SensorMagneticData

The SensorMagneticData interface represents magnetic sensor data.

Deprecated. SensorMagneticData interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface SensorMagneticData : SensorData {

        readonly attribute double x;

        readonly attribute double y;

        readonly attribute double z;

        readonly attribute MagneticSensorAccuracy accuracy;        
    };

Since: 2.2.1.3

Attributes

  • readonly double x
    Ambient magnetic field of the X axis in micro-Tesla (µT).

    Since: 2.2.1.3

  • readonly double y
    Ambient magnetic field of the Y axis in micro-Tesla (µT).

    Since: 2.2.1.3

  • readonly double z
    Ambient magnetic field of the Z axis in micro-Tesla (µT).

    Since: 2.2.1.3

  • readonly MagneticSensorAccuracy accuracy
    Accuracy of magnetic sensor data.

    For increasing the accuracy, wave the device in a figure eight.

    Since: 2.2.1.3

2.12. SensorPressureData

The SensorPressureData interface represents pressure sensor data.

Deprecated. SensorPressureData interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface SensorPressureData : SensorData {

        readonly attribute double pressure;
    };

Since: 2.2.1.3

Attributes

  • readonly double pressure
    Pressure in millibar (hPa).

    Since: 2.2.1.3

2.13. SensorProximityData

The SensorProximityData interface represents proximity sensor data.

Deprecated. SensorProximityData interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface SensorProximityData : SensorData {

        readonly attribute ProximityState proximityState;
    };

Since: 2.2.1.3

Attributes

  • readonly ProximityState proximityState
    Proximity state.

    Since: 2.2.1.3

2.14. SensorUltravioletData

The SensorUltravioletData interface represents ultraviolet sensor data.

Deprecated. SensorUltravioletData interface is deprecated since Tizen 2.3. It is recommended to use the Tizen Public Sensor API(tizen.sensorservice since Tizen 2.3) instead.

    [NoInterfaceObject] interface SensorUltravioletData : SensorData {

        readonly attribute long ultravioletLevel;
    };

Since: 2.2.1.3

Attributes

  • readonly long ultravioletLevel
    Ultraviolet index.

    The ultraviolet index is an international standard measurement of the strength of ultraviolet radiation from the sun. The ultravioletLevel ranges from 0 to 15.

    Since: 2.2.1.3

2.15. SensorDataSuccessCallback

The SensorDataSuccessCallback interface is a callback interface that is invoked when the sensor data has changed. For example, see Sensor interface
    [Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
        void onsuccess(optional SensorData? sensorData);
    };

Since: 2.2.1.3

Methods

onsuccess
Called when the sensor data has changed.
void onsuccess(optional SensorData? sensorData);
             

Since: 2.2.1.3

Parameters:

  • sensorData [optional] [nullable]: Current sensor data

3. Related Feature

It is recommended to design feature related code in a modular way.

To guarantee that the light sensor application runs on a device with a photometer (light) sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.photometer
  • http://developer.samsung.com/tizen/feature/samsung_extension
  • To guarantee that the magnetic sensor application runs on a device with a magnetic sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.magnetometer
  • http://developer.samsung.com/tizen/feature/samsung_extension
  • To guarantee that the barometer(pressure) sensor application runs on a device with a barometric (pressure) sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.barometer
  • http://developer.samsung.com/tizen/feature/samsung_extension
  • To guarantee that the proximity sensor application runs on a device with a proximity sensor, declare the following feature requirement in the config file:

  • http://tizen.org/feature/sensor.proximity
  • http://developer.samsung.com/tizen/feature/samsung_extension
  • To guarantee that the UV sensor application runs on a device with a UV sensor, declare the following feature requirement in the config file:

  • http://developer.samsung.com/feature/sensor.ultraviolet
  • 4. Full WebIDL

    module Sensor {
    
        enum SensorType { "LIGHT", "MAGNETIC", "PRESSURE",  "PROXIMITY", "ULTRAVIOLET" };
    
        enum ProximityState { "FAR", "NEAR" };
    
        enum MagneticSensorAccuracy { "ACCURACY_UNDEFINED", "ACCURACY_BAD", "ACCURACY_NORMAL", "ACCURACY_GOOD", "ACCURACY_VERYGOOD" };
    
        [NoInterfaceObject] interface SensorServiceManagerObject {
            readonly attribute SensorService sensorservice;
        };
        WebAPIs implements SensorServiceManagerObject;
    
        [NoInterfaceObject] interface SensorService {
    
            Sensor getDefaultSensor(SensorType type);
    
            SensorType[] getAvailableSensors();
    
        };
    
        [NoInterfaceObject] interface Sensor {
    
            readonly attribute SensorType sensorType;
    
            void start(SuccessCallback successCallback, 
                                    optional ErrorCallback? errorCallback);
    
            void stop();
    
            void setChangeListener(SensorDataSuccessCallback successCallback);
            
            void unsetChangeListener();
        };
    
        [NoInterfaceObject] interface LightSensor : Sensor {
    
            void getLightSensorData(SensorDataSuccessCallback successCallback,
                                    optional ErrorCallback? errorCallback);
        };
    
        [NoInterfaceObject] interface MagneticSensor : Sensor {
    
            void getMagneticSensorData(SensorDataSuccessCallback successCallback,
                                    optional ErrorCallback? errorCallback);
        };
    
        [NoInterfaceObject] interface PressureSensor : Sensor {
    
            void getPressureSensorData(SensorDataSuccessCallback successCallback,
                                    optional ErrorCallback? errorCallback);
        };
        
        [NoInterfaceObject] interface ProximitySensor : Sensor {
    
            void getProximitySensorData(SensorDataSuccessCallback successCallback,
                                    optional ErrorCallback? errorCallback);
        };
    
        [NoInterfaceObject] interface UltravioletSensor : Sensor {
    
            void getUltravioletSensorData(SensorDataSuccessCallback successCallback,
                                    optional ErrorCallback? errorCallback);
        };
    
        [NoInterfaceObject] interface SensorData {
         };
    
        [NoInterfaceObject] interface SensorLightData : SensorData {
    
            readonly attribute double lightLevel;
        };
    
        [NoInterfaceObject] interface SensorMagneticData : SensorData {
    
            readonly attribute double x;
    
            readonly attribute double y;
    
            readonly attribute double z;
    
            readonly attribute MagneticSensorAccuracy accuracy;        
        };
    
        [NoInterfaceObject] interface SensorPressureData : SensorData {
    
            readonly attribute double pressure;
        };
    
        [NoInterfaceObject] interface SensorProximityData : SensorData {
    
            readonly attribute ProximityState proximityState;
        };
    
        [NoInterfaceObject] interface SensorUltravioletData : SensorData {
    
            readonly attribute long ultravioletLevel;
        };
    
        [Callback=FunctionOnly, NoInterfaceObject] interface SensorDataSuccessCallback {
            void onsuccess(optional SensorData? sensorData);
        };
    };