1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et ft=cpp : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef __HAL_SENSOR_H_
8 #define __HAL_SENSOR_H_
10 #include "mozilla/Observer.h"
16 * Enumeration of sensor types. They are used to specify type while
17 * register or unregister an observer for a sensor of given type.
24 SENSOR_LINEAR_ACCELERATION
,
32 typedef Observer
<SensorData
> ISensorObserver
;
35 * Enumeration of sensor accuracy types.
37 enum SensorAccuracyType
{
38 SENSOR_ACCURACY_UNKNOWN
= -1,
39 SENSOR_ACCURACY_UNRELIABLE
,
43 NUM_SENSOR_ACCURACY_TYPE
48 typedef Observer
<SensorAccuracy
> ISensorAccuracyObserver
;
53 #include "IPC/IPCMessageUtils.h"
57 * Serializer for SensorType
60 struct ParamTraits
<mozilla::hal::SensorType
>:
61 public EnumSerializer
<mozilla::hal::SensorType
,
62 mozilla::hal::SENSOR_UNKNOWN
,
63 mozilla::hal::NUM_SENSOR_TYPE
> {
67 struct ParamTraits
<mozilla::hal::SensorAccuracyType
>:
68 public EnumSerializer
<mozilla::hal::SensorAccuracyType
,
69 mozilla::hal::SENSOR_ACCURACY_UNKNOWN
,
70 mozilla::hal::NUM_SENSOR_ACCURACY_TYPE
> {
75 #endif /* __HAL_SENSOR_H_ */