4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 * Girishashok Joshi <girish.joshi@samsung.com>
8 * Chanyeol Park <chanyeol.park@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 #include "bluetooth-api.h"
25 #include "bt-internal-types.h"
27 #include "bt-common.h"
28 #include "bt-request-sender.h"
29 #include "bt-event-handler.h"
31 BT_EXPORT_API int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
35 BT_CHECK_PARAMETER(local_oob_data, return);
36 BT_CHECK_ENABLED(return);
39 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
41 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_OOB_READ_LOCAL_DATA,
42 in_param1, in_param2, in_param3, in_param4, &out_param);
44 if (result == BLUETOOTH_ERROR_NONE) {
45 *local_oob_data = g_array_index(out_param,
49 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
54 BT_EXPORT_API int bluetooth_oob_add_remote_data(
55 const bluetooth_device_address_t *remote_device_address,
56 bt_oob_data_t *remote_oob_data)
60 BT_CHECK_PARAMETER(remote_device_address, return);
61 BT_CHECK_PARAMETER(remote_oob_data, return);
62 BT_CHECK_ENABLED(return);
65 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
67 g_array_append_vals(in_param1, remote_device_address,
68 sizeof(bluetooth_device_address_t));
70 g_array_append_vals(in_param2, remote_oob_data, sizeof(bt_oob_data_t));
72 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_OOB_ADD_REMOTE_DATA,
73 in_param1, in_param2, in_param3, in_param4, &out_param);
75 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
80 BT_EXPORT_API int bluetooth_oob_remove_remote_data(
81 const bluetooth_device_address_t *remote_device_address)
85 BT_CHECK_PARAMETER(remote_device_address, return);
86 BT_CHECK_ENABLED(return);
89 BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
91 g_array_append_vals(in_param1, remote_device_address,
92 sizeof(bluetooth_device_address_t));
94 result = _bt_send_request(BT_BLUEZ_SERVICE, BT_OOB_REMOVE_REMOTE_DATA,
95 in_param1, in_param2, in_param3, in_param4, &out_param);
97 BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);