Add IR apis. 74/56974/14
authorpr.jung <pr.jung@samsung.com>
Thu, 14 Jan 2016 05:04:23 +0000 (14:04 +0900)
committerpr.jung <pr.jung@samsung.com>
Wed, 17 Feb 2016 00:06:26 +0000 (09:06 +0900)
- device_ir_is_available : Check whether ir is available
- device_ir_transmit : Send IR command

Change-Id: I0b312e00fd10f8f23aee5f578530490276f6cf70
Signed-off-by: pr.jung <pr.jung@samsung.com>
doc/device_doc.h
include/ir.h [new file with mode: 0755]
src/ir.c [new file with mode: 0644]

index eef11de..7c82ccd 100755 (executable)
@@ -30,6 +30,7 @@
  *   \#include <device/haptic.h> \n
  *   \#include <device/led.h> \n
  *   \#include <device/power.h>
+ *   \#include <device/ir.h>
  *
  * @section CAPI_SYSTEM_DEVICE_MODULE_OVERVIEW Overview
  * The DEVICE API provides functions to control devices or to get status of devices.
@@ -40,6 +41,7 @@
  * - Haptic
  * - LED
  * - Power
+ * - IR
  */
 
 /**
  *
  * It is recommended to design feature related codes in your application for reliability.\n
  *
- * You can check if a devrice supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
  *
  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
  *
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
  *
  */
 
  * - Flash led state
  */
 
+/**
+ * @ingroup CAPI_SYSTEM_DEVICE_MODULE
+ * @defgroup CAPI_SYSTEM_DEVICE_IR_MODULE IR
+ * @brief The IR API provides functions to control a IR transmitter.
+ *
+ * @section CAPI_SYSTEM_DEVICE_IR_MODULE_HEADER Required Header
+ *   \#include <device/ir.h> \n
+ *
+ * @section CAPI_SYSTEM_DEVICE_IR_MODULE_OVERVIEW Overview
+ * The IR API provides the way to get the information whether IR is available and transmit IR command.
+ * @section CAPI_SYSTEM_DEVICE_IR_MODULE_FEATURE Related Features
+ * This API is related with the following feature:\n
+ *  - http://tizen.org/feature/consumer_ir\n
+ *
+ * It is recommended to design feature related codes in your application for reliability.\n
+ *
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
+ *
+ * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
+ *
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
+ *
+ */
+
 #endif /* __TIZEN_SYSTEM_DEVICE_DOC_H__ */
diff --git a/include/ir.h b/include/ir.h
new file mode 100755 (executable)
index 0000000..1c8bea0
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 __TIZEN_SYSTEM_IR_H__
+#define __TIZEN_SYSTEM_IR_H__
+
+#include "device-error.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * @addtogroup CAPI_SYSTEM_DEVICE_IR_MODULE
+ * @{
+ */
+
+/**
+ * @brief Gets the information whether IR module is available.
+ *
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/use_ir
+ *
+ * @param[out] available The information whether IR is available.
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value.
+ *
+ * @retval #DEVICE_ERROR_NONE               Successful
+ * @retval #DEVICE_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #DEVICE_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval #DEVICE_ERROR_OPERATION_FAILED   Operation failed
+ * @retval #DEVICE_ERROR_NOT_SUPPORTED      Not supported device
+ */
+int device_ir_is_available(bool *available);
+
+/**
+ * @brief Transmits IR command.
+ *
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/use_ir
+ *
+ * @param[in] carrier_frequency Carrier frequency to transmit IR command. (Hertz)
+ * @param[in] pattern Integer array of IR command.
+ * @param[in] size Size of IR command pattern.
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value.
+ *
+ * @retval #DEVICE_ERROR_NONE               Successful
+ * @retval #DEVICE_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #DEVICE_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval #DEVICE_ERROR_OPERATION_FAILED   Operation failed
+ * @retval #DEVICE_ERROR_NOT_SUPPORTED      Not supported device
+ */
+int device_ir_transmit(int carrier_frequency, int *pattern, int size);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* __TIZEN_SYSTEM_IR_H__ */
diff --git a/src/ir.c b/src/ir.c
new file mode 100644 (file)
index 0000000..faf7dc1
--- /dev/null
+++ b/src/ir.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <stdbool.h>
+
+#include "ir.h"
+
+int device_ir_is_available(bool *available)
+{
+       *available = false;
+       return DEVICE_ERROR_NONE;
+}
+
+int device_ir_transmit(int carrier_frequency, int *pattern, int size)
+{
+       return DEVICE_ERROR_NONE;
+}
\ No newline at end of file