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 * Information needed to when sending a request through a GATT
29 typedef struct _CAGattRequestInfo
32 * Proxy or list of proxies to @c org.bluez.GattCharacteristic1
33 * object(s) through which request data will be sent to the GATT
36 * In the case of a unicast-style send, @c info will be a
37 * @c GDBusProxy* to an @c org.bluez.GattCharacteristic1 object.
38 * For a multicast-style send, @c info will be a * @c GList* of
39 * @c GDBusProxy* to @c GattCharacterstic1 objects on all GATT
40 * servers to which a connection exists.
42 void * const characteristic_info;
45 * Context containing additional information that may be needed
46 * when sending a request.
48 CALEContext * const context;
53 * Send request data through a single user-specified BLE connection.
55 * @param[in] method_info Information necessary to send request.
56 * @param[in] data Octet array of request data to be sent.
57 * @param[in] length Length of the @a data octet array.
59 * @see @c CAGattSendMethod() for further details.
61 bool CAGattSendRequest(void const * method_info,
65 // ---------------------------------------------------------------
66 // Multicast-style Request Send
67 // ---------------------------------------------------------------
69 * Send request data through all BLE connections.
71 * Send the @a data to the GATT server found in all discovered LE
74 * @param[in] method_info Information necessary to send request.
75 * @param[in] data Octet array of request data to be sent.
76 * @param[in] length Length of the @a data octet array.
78 * @note Since a multicast-like operation is being performed, an
79 * assumption is made that a GATT client is sending data to a
80 * server. It makes no sense to multicast a response from a
81 * single GATT server to multiple GATT clients in IoTivity's
84 * @return @c CA_STATUS_OK on success, @c CA_STATUS_FAILED otherwise.
86 CAResult_t CAGattClientSendDataToAll(void const * method_info,
91 #endif /* CA_BLE_LINUX_CLIENT_H */