Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / bt_le_adapter / linux / server.h
index 91dcc26..c4b707e 100644 (file)
 #ifndef CA_BLE_LINUX_SERVER_H
 #define CA_BLE_LINUX_SERVER_H
 
-#include "bluez-glue.h"
+#include "cacommon.h"
 
-#include <stdbool.h>
+#include <stdint.h>
 #include <sys/types.h>
 
+
 /**
- * Information needed to complete a GATT server response send.
+ * Send response/notification to the GATT client.
+ *
+ * Data will be sent to the client through the given response
+ * @a characteristic proxy as a GATT characteristic notification.
+ *
+ * @param[in] characteristic The D-Bus proxy for the response
+ *                           characteristic through which the
+ *                           notification will be sent.
+ * @param[in] data           The byte array to be sent.
+ * @param[in] length         The number of elements in the byte
+ *                           array.
+ *
+ * @return ::CA_STATUS_OK on success, ::CA_STATUS_FAILED otherwise.
  */
-typedef struct _CAGattResponseInfo
-{
-    /**
-     * The BlueZ @c org.bluez.GattCharacteristic1 skeleton object
-     * through which data will be sent.
-     */
-    GattCharacteristic1 * const characteristic;
+CAResult_t CAGattServerSendResponseNotification(
+    char const * address,
+    uint8_t const * data,
+    size_t length);
 
-} CAGattResponseInfo;
 
 /**
- * Send response notification to the GATT client.
+ * Send notification to all connected GATT clients.
+ *
+ * Data will be sent to the client through the given response
+ * @a characteristic proxy as a GATT characteristic notification.
  *
- * @param[in] method_info Pointer to @c GattResponseInfo object that
- *                        contains information necessary to complete
- *                        send of response.
- * @param[in] data        Octet array of response data to be sent.
- * @param[in] length      Length of the @a data octet array.
+ * @param[in] data    The byte array to be sent.
+ * @param[in] length  The number of elements in the byte array.
+ * @param[in] context Object containing mutexes and error reporting
+ *                    callback used on failure to send.
  *
- * @see @c CAGattSendMethod() for further details.
+ * @return ::CA_STATUS_OK on success, ::CA_STATUS_FAILED otherwise.
  */
-bool CAGattServerSendResponse(void const * method_info,
-                              void const * data,
-                              size_t length);
+CAResult_t CAGattServerSendResponseNotificationToAll(
+    uint8_t const * data,
+    size_t length);
 
 
 #endif  /* CA_BLE_LINUX_SERVER_H */