X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Fsrc%2Fbt_le_adapter%2Ftizen%2Fcaleserver.h;h=f310885a68b3fcb93b89253e9943da27a5236297;hb=8229635f6d207516ccbbdf23b13be164e0fc1787;hp=100ea9b262c399eb08c74925c07eef07ee168df4;hpb=e1dffdd55cd2a6f3e18c5bf5eb6a348e3bfef9fc;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.h b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.h index 100ea9b..f310885 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.h +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.h @@ -34,20 +34,26 @@ #include #include #include - +#ifdef BLE_MCD +#include +#endif #include "caadapterinterface.h" #include "logger.h" #include "cathreadpool.h" #include "caleinterface.h" +#if defined(__TIZEN__) && defined(LE_ADAPTER) && defined(BLE_CUSTOM_ADVERTISE) /** - * This is thread which will be used for creating ble service and advertise ble service. - * 1. Create New OIC Service 2. Add read & write characteristics to service. - * 3. Register Service 4. Advertise service. - * - * @param[in] data Currently it will be NULL. + * Used to Start Server advertise send data + */ +CAResult_t CAsetServerAdvertisementData(const char *data, int length); + + +/** + * Used to Start Server send response data */ -void CAStartLEGattServerThread(void *data); +CAResult_t CAsetServerSanResponseData(const char *data, int length); +#endif /** * Used to initialize gatt server. @@ -87,7 +93,17 @@ CAResult_t CAInitGattServerMutexVariables(); * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments. * @retval ::CA_STATUS_FAILED Operation failed. */ -CAResult_t CALEStartAdvertise(const char *serviceUUID); +CAResult_t CALEStartAdvertise(); + +/** + * Used to start advertising with service UUID. + * + * @return ::CA_STATUS_OK or Appropriate error code. + * @retval ::CA_STATUS_OK Successful. + * @retval ::CA_STATUS_INVALID_PARAM Invalid input arguments. + * @retval ::CA_STATUS_FAILED Operation failed. + */ +CAResult_t CALEStartAdvertiseImpl(const char *serviceUUID); /** * Used to stop advertising. @@ -154,18 +170,16 @@ CAResult_t CAAddNewCharacteristicsToGattServer(const bt_gatt_h svcPath, const ch * @param[in] len The length of @a value * @param[in] user_data The user data passed from the registration function */ +#ifdef BLE_TIZEN_30 +void CALEGattRemoteCharacteristicWriteCb(const char *remoteAddress, int request_id, + bt_gatt_server_h server, bt_gatt_h gatt_handle, + bool response_needed, int offset, const char *charValue, + int charLen, void *userData); +#else void CALEGattRemoteCharacteristicWriteCb(char *remoteAddress, bt_gatt_server_h server, - bt_gatt_h charPath, int offset, char *charValue, - int charValueLen, void *userData); - -/** - * This is the callback which will be called whenever there is change in gatt connection - * with Client(Connected/Disconnected). - * - * @param[in] connected State of connection. - * @param[in] remoteAddress Mac address of the remote device in which we made connection. - */ -void CALEGattServerConnectionStateChanged(bool connected, const char *remoteAddress); + bt_gatt_h gatt_handle, int offset, char *charValue, + int charLen, void *userData); +#endif /** * Setting the connection state changed callback. @@ -173,5 +187,19 @@ void CALEGattServerConnectionStateChanged(bool connected, const char *remoteAddr */ void CASetLEConnectionStateChangedCallback(CALEConnectionStateChangedCallback connStateCb); +/** + * check connection status. + * @param[in] address the address of the remote device. + * @return true or false. + */ +bool CALEServerIsConnected(const char* address); + +/** + * get MTU size. + * @param[in] address the address of the remote device. + * @return mtu size negotiated from remote device. + */ +uint16_t CALEServerGetMtuSize(const char* address); + #endif /* TZ_BLE_SERVER_H_ */