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=refs%2Ftags%2Fsubmit%2Ftizen_4.0%2F20171010.021147;hp=400f81f7f3d8092df4c306c1b3b25c70adaa92fc;hpb=5b285e73548cac989ef00461e1a96bc60b613ae1;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 400f81f..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,12 +34,27 @@ #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) +/** + * Used to Start Server advertise send data + */ +CAResult_t CAsetServerAdvertisementData(const char *data, int length); + + +/** + * Used to Start Server send response data + */ +CAResult_t CAsetServerSanResponseData(const char *data, int length); +#endif + /** * Used to initialize gatt server. * @@ -78,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. @@ -145,9 +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); + bt_gatt_h gatt_handle, int offset, char *charValue, + int charLen, void *userData); +#endif /** * Setting the connection state changed callback. @@ -155,5 +187,19 @@ void CALEGattRemoteCharacteristicWriteCb(char *remoteAddress, bt_gatt_server_h s */ 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_ */