2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
26 #ifdef DEVICE_INFO_IMPL /* not implemented in iotivity 0.9.1 */
27 /* The length of manufacturer_name should be less than and equal to 16.
28 * The length of manufacturer_url should be less than and equal to 32. */
29 int iotcon_register_device_info(iotcon_device_info_s device_info)
33 if (device_info.manuf_name
34 && (IOTCON_MANUFACTURER_NAME_LENGTH_MAX < strlen(device_info.manuf_name))) {
35 ERR("The length of manufacturer_name(%s) is invalid.", device_info.manuf_name);
36 return IOTCON_ERROR_INVALID_PARAMETER;
39 if (device_info.manuf_url
40 && (IOTCON_MANUFACTURER_URL_LENGTH_MAX < strlen(device_info.manuf_url))) {
41 ERR("The length of manufacturer_url(%s) is invalid.", device_info.manuf_url);
42 return IOTCON_ERROR_INVALID_PARAMETER;
45 ret = icl_dbus_register_device_info(device_info);
46 if (IOTCON_ERROR_NONE != ret)
47 ERR("icl_dbus_register_device_info() Fail(%d)", ret);
52 int iotcon_get_device_info(const char *host_address, iotcon_device_info_cb cb,
55 int ret = IOTCON_ERROR_NONE;
57 RETV_IF(NULL == host_address, IOTCON_ERROR_INVALID_PARAMETER);
58 RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
60 ret = icl_dbus_get_device_info(host_address, cb, user_data);
61 if (IOTCON_ERROR_NONE != ret) {
62 ERR("icl_dbus_get_device_info() Fail(%d)", ret);
66 return IOTCON_ERROR_NONE;
70 API int iotcon_register_platform_info(iotcon_platform_info_s platform_info)
74 ret = icl_dbus_register_platform_info(platform_info);
75 if (IOTCON_ERROR_NONE != ret)
76 ERR("ic_ioty_register_platform_info() Fail(%d)", ret);
82 API int iotcon_get_platform_info(const char *host_address, iotcon_platform_info_cb cb,
85 int ret = IOTCON_ERROR_NONE;
87 RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
89 ret = icl_dbus_get_platform_info(host_address, cb, user_data);
90 if (IOTCON_ERROR_NONE != ret) {
91 ERR("ic_ioty_get_platform_info() Fail(%d)", ret);
95 return IOTCON_ERROR_NONE;