1 /******************************************************************
3 * Copyright 2015 Intel Corporation All Rights Reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 ******************************************************************/
19 #ifndef CA_BLE_LINUX_CLIENT_H
20 #define CA_BLE_LINUX_CLIENT_H
26 * Initialize the GATT client.
30 * @return @c CA_STATUS_OK on success, @c CA_STATUS_FAILED otherwise.
32 CAResult_t CAGattClientInitialize(CALEContext * context);
35 * Destroy the GATT client.
37 void CAGattClientDestroy();
40 * Send request data through a single user-specified BLE connection.
42 * @param[in] address MAC address of the BLE peripheral running the
43 * OIC Transport Profile GATT server to which the
45 * @param[in] data Octet array of request data to be sent.
46 * @param[in] length Length of the @a data octet array.
47 * @param[in] context Object containing mutexes and error reporting
48 * callback used on failure to send.
50 * @return @c CA_STATUS_OK on success, @c CA_STATUS_FAILED otherwise.
52 CAResult_t CAGattClientSendData(char const * address,
55 CALEContext * context);
58 * Send request data through all BLE connections.
60 * Send the @a data to the GATT server found in all discovered LE
63 * @param[in] data Octet array of request data to be sent.
64 * @param[in] length Length of the @a data octet array.
65 * @param[in] context Object GATT request characteristic map.
67 * @return @c CA_STATUS_OK on success, @c CA_STATUS_FAILED otherwise.
69 CAResult_t CAGattClientSendDataToAll(uint8_t const * data,
71 CALEContext * context);
74 #endif /* CA_BLE_LINUX_CLIENT_H */