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.
25 /* The length of manufacturer_name should be less than and equal to 16.
26 * The length of manufacturer_url should be less than and equal to 32. */
27 API int iotcon_register_device_info(iotcon_device_info_s device_info)
31 if (device_info.manuf_name
32 && (IOTCON_MANUFACTURER_NAME_LENGTH_MAX < strlen(device_info.manuf_name))) {
33 ERR("The length of manufacturer_name(%s) is invalid.", device_info.manuf_name);
34 return IOTCON_ERROR_INVALID_PARAMETER;
37 if (device_info.manuf_url
38 && (IOTCON_MANUFACTURER_URL_LENGTH_MAX < strlen(device_info.manuf_url))) {
39 ERR("The length of manufacturer_url(%s) is invalid.", device_info.manuf_url);
40 return IOTCON_ERROR_INVALID_PARAMETER;
44 ret = ic_ioty_register_device_info(device_info);
45 if (IOTCON_ERROR_NONE != ret)
46 ERR("ic_ioty_register_device_info() Fail(%d)", ret);
52 API int iotcon_get_device_info(const char *host_address, iotcon_device_info_cb cb,
56 int ret = IOTCON_ERROR_NONE;
58 RETV_IF(NULL == host_address, IOTCON_ERROR_INVALID_PARAMETER);
59 RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
61 ret = ic_ioty_get_device_info(host_address, cb, user_data);
62 if (IOTCON_ERROR_NONE != ret) {
63 ERR("ic_ioty_get_device_info() Fail(%d)", ret);
67 return IOTCON_ERROR_NONE;