#include<stdint.h>
#include "bt-common.h"
+#include "bt-internal-types.h"
#define NUMBER_OF_FLAGS 10
BT_EXPORT_API int bluetooth_gatt_register_service(
const char *svc_path)
{
+ if (_bt_check_privilege(BT_CHECK_PRIVILEGE, BT_GATT_REGISTER_SERVICE)
+ == BLUETOOTH_ERROR_PERMISSION_DEINED) {
+ BT_ERR("Don't have aprivilege to use this API");
+ return BLUETOOTH_ERROR_PERMISSION_DEINED;
+ }
+
register_pending_cnt++;
if (__bt_gatt_get_service_state(svc_path)) {
{
GDBusProxy *proxy = NULL;
+ if (_bt_check_privilege(BT_CHECK_PRIVILEGE, BT_GATT_REGISTER_APPLICATION)
+ == BLUETOOTH_ERROR_PERMISSION_DEINED) {
+ BT_ERR("Don't have aprivilege to use this API");
+ return BLUETOOTH_ERROR_PERMISSION_DEINED;
+ }
+
proxy = __bt_gatt_gdbus_get_manager_proxy("org.bluez",
"/org/bluez/hci0", GATT_MNGR_INTERFACE);
if (proxy == NULL || app_path == NULL)
{
struct gatt_req_info *req_info = NULL;
+ if (_bt_check_privilege(BT_CHECK_PRIVILEGE, BT_GATT_SEND_RESPONSE)
+ == BLUETOOTH_ERROR_PERMISSION_DEINED) {
+ BT_ERR("Don't have aprivilege to use this API");
+ return BLUETOOTH_ERROR_PERMISSION_DEINED;
+ }
+
req_info = __bt_gatt_find_request_info(request_id);
if (req_info) {
case BT_GATT_SET_PROPERTY_REQUEST:
case BT_GATT_READ_CHARACTERISTIC:
case BT_GATT_DISCOVER_CHARACTERISTICS_DESCRIPTOR:
+ case BT_GATT_REGISTER_APPLICATION:
+ case BT_GATT_REGISTER_SERVICE:
+ case BT_GATT_SEND_RESPONSE:
case BT_PBAP_CONNECT:
case BT_PBAP_DISCONNECT:
case BT_PBAP_GET_PHONEBOOK_SIZE:
BT_GATT_WATCH_CHARACTERISTIC,
BT_GATT_UNWATCH_CHARACTERISTIC,
#endif
+ BT_GATT_REGISTER_APPLICATION,
+ BT_GATT_REGISTER_SERVICE,
+ BT_GATT_SEND_RESPONSE,
BT_LE_IPSP_INIT = BT_FUNC_IPSP_BASE,
BT_LE_IPSP_DEINIT,
BT_LE_IPSP_CONNECT,