typedef enum
{
STATE_DISCONNECTED, /**< State is Disconnected. */
- STATE_CONNECTED /**< State is Connected. */
+ STATE_CONNECTED /**< State is Connected. */
} CAConnectedState_t;
-typedef struct connected_state
+typedef struct connected_device
{
uint8_t address[CA_MACADDR_SIZE];
CAConnectedState_t state;
-} state_t;
+ uint8_t *recvData;
+ size_t recvDataLen;
+ size_t totalDataLen;
+} CAConnectedDeviceInfo_t;
/**
* Enum for defining different server types.
typedef struct
{
CAEndpoint_t *remoteEndpoint; /**< Remote Endpoint. */
- void *data; /**< Data to be sent. */
+ uint8_t *data; /**< Data to be sent. */
uint32_t dataLen; /**< Length of the data to be sent. */
} CAEDRData;
* @param[in] data Data received.
* @param[in] dataLength Length of the Data received.
* @param[out] sentLength Length of the sent data.
+ * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
* @pre Callback must be registered using CAEDRSetPacketReceivedCallback().
*/
-typedef void (*CAEDRDataReceivedCallback)(const char *remoteAddress, const void *data,
- uint32_t dataLength, uint32_t *sentLength);
+typedef CAResult_t (*CAEDRDataReceivedCallback)(const char *remoteAddress, const uint8_t *data,
+ uint32_t dataLength, uint32_t *sentLength);
/**
* This will be used during change in network status.
/**
* Callback to notify the error in the EDR adapter.
* @param[in] remoteAddress Remote EDR Address.
- * @param[in] serviceUUID Service UUID of the device.
* @param[in] data data containing token, uri and coap data.
* @param[in] dataLength length of data.
* @param[in] result error code as defined in ::CAResult_t.
* @pre Callback must be registered using CAEDRSetPacketReceivedCallback().
*/
-typedef void (*CAEDRErrorHandleCallback)(const char *remoteAddress, const char *serviceUUID,
- const void *data, uint32_t dataLength, CAResult_t result);
+typedef void (*CAEDRErrorHandleCallback)(const char *remoteAddress,
+ const uint8_t *data,
+ uint32_t dataLength,
+ CAResult_t result);
/**
* Initialize the network monitor module
/**
* Used to initialize the EDR client module where mutex is initialized.
+ * @return ::CA_STATUS_OK or Appropriate error code.
*/
-void CAEDRInitializeClient(ca_thread_pool_t handle);
+CAResult_t CAEDRClientInitialize();
/**
* Destroys the Device list and mutex.
*
* @return ::CA_STATUS_OK or Appropriate error code.
* @retval ::CA_STATUS_OK Successful.
- * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
* @retval ::CA_STATUS_FAILED Operation failed.
*
* @see CALocalConnectivity_t
/**
* Start RFCOMM server for given service UUID
*
- * @param[in] serviceUUID The UUID of service with which RFCOMM server
- * needs to be started.
- * @param[in] serverFD The RFCOMM server socket file descriptor.
- * @param[in] handle Threadpool Handle.
- *
* @return ::CA_STATUS_OK or Appropriate error code.
* @retval ::CA_STATUS_OK Successful.
- * @retval ::CA_STATUS_INVALID_PARAM Invalid input argumets.
+ * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments.
* @retval ::CA_STATUS_FAILED Operation failed.
*
*/
-CAResult_t CAEDRServerStart(const char *serviceUUID, int *serverFD, ca_thread_pool_t handle);
+CAResult_t CAEDRServerStart();
/**
* Stop RFCOMM server
*
- * @param[in] serverFD The RFCOMM server socket file descriptor which
- * needs to be stopped.
- *
* @return ::CA_STATUS_OK or Appropriate error code.
* @retval ::CA_STATUS_OK Successful.
* @retval ::CA_STATUS_FAILED Operation failed.
*/
-CAResult_t CAEDRServerStop(int serverFD);
+CAResult_t CAEDRServerStop();
+
+/**
+ * Used to initialize the EDR server module where mutex is initialized.
+ * @param[in] threadPool Threadpool Handle.
+ * @return ::CA_STATUS_OK or Appropriate error code.
+ */
+CAResult_t CAEDRServerInitialize(ca_thread_pool_t handle);
/**
* Terminate server for EDR.
/**
* This function sends data to specified remote bluetooth device.
* @param[in] remoteAddress Remote EDR Address.
- * @param[in] serviceUUID Service UUID of the device.
* @param[in] data Data to be sent.
* @param[in] dataLength Length of the data to be sent.
- * @param[out] sentLength Length of the actual sent data.
* @return ::CA_STATUS_OK or Appropriate error code.
*/
-CAResult_t CAEDRClientSendUnicastData(const char *remoteAddress, const char *serviceUUID,
- const void *data, uint32_t dataLength, uint32_t *sentLength);
+CAResult_t CAEDRClientSendUnicastData(const char *remoteAddress,
+ const uint8_t *data,
+ uint32_t dataLength);
/**
* This function sends data to all bluetooth devices running OIC service.
- * @param[in] serviceUUID Service UUID of the device.
* @param[in] data Data to be sent.
* @param[in] dataLength Length of the data to be sent.
- * @param[out] sentLength Length of the actual sent data.
* @return ::CA_STATUS_OK or Appropriate error code.
*/
-CAResult_t CAEDRClientSendMulticastData(const char *serviceUUID, const void *data,
- uint32_t dataLength, uint32_t *sentLength);
+CAResult_t CAEDRClientSendMulticastData(const uint8_t *data,
+ uint32_t dataLength);
/**
* This function gets bonded bluetooth device list
*/
CAResult_t CAEDRGetBondedDeviceList();
+#ifdef __TIZEN__
+/**
+ * This function starts device discovery.
+ */
+CAResult_t CAEDRStartDeviceDiscovery(void);
+#endif
+
#ifdef __cplusplus
} /* extern "C" */
#endif