From: pr.jung Date: Thu, 14 Jan 2016 05:04:23 +0000 (+0900) Subject: Add IR apis. X-Git-Tag: accepted/tizen/ivi/20160223.231452~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ebbfd62baffae44e516573c93a0fcf118363d5a;p=platform%2Fcore%2Fapi%2Fdevice.git Add IR apis. - device_ir_is_available : Check whether ir is available - device_ir_transmit : Send IR command Change-Id: I0b312e00fd10f8f23aee5f578530490276f6cf70 Signed-off-by: pr.jung --- diff --git a/doc/device_doc.h b/doc/device_doc.h index eef11de..7c82ccd 100755 --- a/doc/device_doc.h +++ b/doc/device_doc.h @@ -30,6 +30,7 @@ * \#include \n * \#include \n * \#include + * \#include * * @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 */ /** @@ -106,11 +108,11 @@ * * 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 Feature Element. + * More details on featuring your application can be found from Feature Element. * */ @@ -147,4 +149,28 @@ * - 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 \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 Feature Element. + * + */ + #endif /* __TIZEN_SYSTEM_DEVICE_DOC_H__ */ diff --git a/include/ir.h b/include/ir.h new file mode 100755 index 0000000..1c8bea0 --- /dev/null +++ b/include/ir.h @@ -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 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 +#include + +#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