summaryrefslogtreecommitdiff
path: root/include/device-node.h
blob: cf1d059f91369ff3a587bb14e3b2cbf6acead0c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
 * device-node
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


#ifndef __DEVICE_NODE_H__
#define __DEVICE_NODE_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "devman_plugin_intf.h"

#ifndef API
#define API __attribute__ ((visibility("default")))
#endif

/**
 * @file        device-node.h
 * @ingroup     FRAMEWORK/SYSTEM
 * @brief       This file contains the API for the status of devices
 * @author      TIZEN
 * @date        2013-02-15
 * @version     0.1
 */

/**
 * @addtogroup DEVICE_NODE
 * @{
 */

/**
 * @par Description:
 * 	device type enum
 */
enum device_type
{
	DEVICE_TYPE_DISPLAY,            /**< display */
	DEVICE_TYPE_EXTCON,             /**< extcon - Micro USB, 3.5 pi jack etc */
	DEVICE_TYPE_LED,                /**< LED */
	DEVICE_TYPE_POWER,              /**< battery, PMIC, etc about power */
	DEVICE_TYPE_MAX,
};

/**
 * @par Description:
 * 	DEVICE_TYPE_DISPLAY property for generic APIs
 */
enum {
	PROP_DISPLAY_DISPLAY_COUNT,
	PROP_DISPLAY_MAX_BRIGHTNESS,
	PROP_DISPLAY_BRIGHTNESS,
	PROP_DISPLAY_ACL_CONTROL,
	PROP_DISPLAY_ONOFF,
	PROP_DISPLAY_BRIGHTNESS_BY_LUX,
	PROP_DISPLAY_FRAME_RATE,
	PROP_DISPLAY_IMAGE_ENHANCE_MODE,
	PROP_DISPLAY_IMAGE_ENHANCE_SCENARIO,
	PROP_DISPLAY_IMAGE_ENHANCE_TONE,
	PROP_DISPLAY_IMAGE_ENHANCE_OUTDOOR,
	PROP_DISPLAY_IMAGE_ENHANCE_TUNE,
	PROP_DISPLAY_IMAGE_ENHANCE_INFO,
};

/**
 * @par Description:
 * 	DEVICE_TYPE_JACK property for generic APIs
 */
enum {
	PROP_EXTCON_TA_ONLINE,        /**< Travel Adapter(Charger) */
	PROP_EXTCON_EARJACK_ONLINE,   /**< Earjack */
	PROP_EXTCON_EARKEY_ONLINE,    /**< Earkey */
	PROP_EXTCON_HDMI_ONLINE,      /**< HDMI */
	PROP_EXTCON_USB_ONLINE,       /**< USB connection */
	PROP_EXTCON_CRADLE_ONLINE,    /**< Cradle connection */
	PROP_EXTCON_TVOUT_ONLINE,     /**< analog tvout */
	PROP_EXTCON_KEYBOARD_ONLINE,  /**< Microphone */
	PROP_EXTCON_HDMI_SUPPORT,     /**< Support HDMI*/
	PROP_EXTCON_UART_PATH,
	PROP_EXTCON_USB_PATH,
};

/**
 * @par Description:
 *  DEVICE_TYPE_LED property for generic APIs
 */
enum {
	PROP_LED_BRIGHTNESS,
	PROP_LED_MAX_BRIGHTNESS,
	PROP_LED_IR_COMMAND,
	PROP_LED_HARDKEY,
};

/**
 * @par Description:
 * 	DEVICE_TYPE_POWER property for generic APIs
 */
enum {
	PROP_POWER_CAPACITY,                    /**< Current remaining battery */
	PROP_POWER_CAPACITY_RAW,                /**< Current remaining battery expressed 1/10000 */
	PROP_POWER_CHARGE_FULL,                 /**< Battery is full-charged.*/
	PROP_POWER_CHARGE_NOW,                  /**< Battery is being charged now */
	PROP_POWER_STATE,
	PROP_POWER_WAKEUP_COUNT,
	PROP_POWER_PRESENT,
	PROP_POWER_HEALTH,                      /**< Battery status about cahrge */
	PROP_POWER_INSUSPEND_CHARGING_SUPPORT,
};

/**
 * @fn int device_get_property(enum device_type devtype, int property, int *value)
 * @par Description:
 * 	This generic API is used to get the property values of supported devices.\n
 * 	If the caller process does not have permission, it returns failure.
 * @param[in] devtype device type that you want to get the value
 * @param[in] property value property that you want to get the value
 * @param[out] *value current value of device property
 * @return 0 on success, -1 if failed
 * @see device_set_property()
 * @par Example:
 * @code
 * 	...
 * 	if( device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &val) < 0 )
 * 		printf("Fail to get property\n");
 * 	else
 * 		printf("Property is %d\n", val);
 * 	...
 * @endcode
 */
int device_get_property(enum device_type devtype, int property, int *value);

/**
 * @fn int device_set_property(enum device_type devtype, int property, int value)
 * @par Description:
 * 	This generic API is used to set the property values of supported devices.\n
 * 	If the caller process does not have permission, it returns failure.
 * @param[in] devtype device type that you want to set the value
 * @param[in] property value property that you want to set the value
 * @param[in] value value that you want to set
 * @return 0 on success, -1 if failed
 * @see device_get_property()
 * @par Example
 * @code
 *	...
 *	if( device_set_property(DEVICE_TYPE_DISPLAY, PROP_DISPLAY_BRIGHTNESS, val) < 0 )
 *		printf("Fail to set property\n");
 *	else
 *		printf("Property is set %d\n", val);
 *	...
 * @endcode
 */
int device_set_property(enum device_type devtype, int property, int value);

/**
 * @}
 */

#ifdef __cplusplus
}
#endif
#endif