return OAL_STATUS_SUCCESS;
}
-oal_status_t device_create_bond(bt_address_t *addr, connection_type_e transport)
+oal_status_t device_create_bond(bt_address_t *addr, oal_conn_type_e transport)
{
int res;
bdstr_t bdstr;
return res;
}
-oal_status_t device_set_osp_server(oal_osp_server_type_e type, int enable)
+oal_status_t device_register_osp_server(oal_osp_server_type_e type, char *uuid, char *path, int fd)
{
int res;
uint32_t server_type;
case OAL_OSP_SERVER_OBEX:
server_type = BT_OSP_SERVER_OBEX;
break;
+ case OAL_OSP_SERVER_RFCOMM:
+ server_type = BT_OSP_SERVER_RFCOMM;
+ break;
+ default:
+ BT_ERR("unknown type: %d", type);
+ return OAL_STATUS_INVALID_PARAM;
+ }
+
+ res = blued_api->register_agent_osp_server(server_type, uuid, path, fd);
+ if (res != BT_STATUS_SUCCESS) {
+ BT_ERR("register_agent_osp_server error: [%s]", status2string(res));
+ return convert_to_oal_status(res);
+ }
+
+ return OAL_STATUS_SUCCESS;
+#else
+ BT_ERR("Not supported");
+ res = OAL_STATUS_NOT_SUPPORT;
+ return res;
+#endif
+}
+
+oal_status_t device_unregister_osp_server(oal_osp_server_type_e type, char *uuid)
+{
+ int res;
+ uint32_t server_type;
+
+ CHECK_OAL_INITIALIZED();
+
+ API_TRACE("type: %d", type);
+
+#ifdef TIZEN_BT_HAL
+ switch (type) {
+ case OAL_OSP_SERVER_OBEX:
+ server_type = BT_OSP_SERVER_OBEX;
+ break;
+ case OAL_OSP_SERVER_RFCOMM:
+ server_type = BT_OSP_SERVER_RFCOMM;
+ break;
default:
BT_ERR("unknown type: %d", type);
return OAL_STATUS_INVALID_PARAM;
}
- res = blued_api->set_agent_osp_server(server_type, enable);
+ res = blued_api->unregister_agent_osp_server(server_type, uuid);
if (res != BT_STATUS_SUCCESS) {
- BT_ERR("set_agent_osp_server error: [%s]", status2string(res));
+ BT_ERR("unregister_agent_osp_server error: [%s]", status2string(res));
return convert_to_oal_status(res);
}
#endif
}
+oal_status_t device_disconnect(bt_address_t * addr)
+{
+ int res;
+ bdstr_t bdstr;
+
+ CHECK_OAL_INITIALIZED();
+
+ OAL_CHECK_PARAMETER(addr, return);
+
+ API_TRACE("[%s]", bdt_bd2str(addr, &bdstr));
+
+ res = blued_api->device_disconnect((bt_bdaddr_t *)addr);
+ if (res != BT_STATUS_SUCCESS) {
+ BT_ERR("device_disconnect error: [%s]", status2string(res));
+ return convert_to_oal_status(res);
+ }
+
+ return OAL_STATUS_SUCCESS;
+}
+
void cb_device_properties(bt_status_t status, bt_bdaddr_t *bd_addr,
int num_properties, bt_property_t *properties)
{
}
#ifdef TIZEN_BT_HAL
-void cb_socket_conn_authorize_request(bt_bdaddr_t *bd_addr, bt_uuid_t *uuid)
+void cb_socket_conn_authorize_request(bt_bdaddr_t *bd_addr, bt_uuid_t *uuid, uint8_t *name, uint8_t *path, uint32_t fd)
{
event_socket_authorize_req_t *auth_req = g_new0(event_socket_authorize_req_t, 1);
memcpy(auth_req->address.addr, bd_addr->address, 6);
memcpy(auth_req->uuid.uuid, uuid->uu, 16);
+ memcpy(auth_req->name, name, sizeof(auth_req->name) - 1);
+ memcpy(auth_req->path, path, sizeof(auth_req->path) - 1);
+ auth_req->fd = fd;
send_event_bda_trace(OAL_EVENT_SOCKET_AUTHORIZE_REQUEST, auth_req, sizeof(event_socket_authorize_req_t), (bt_address_t*)bd_addr);
}
ev, sizeof(event_dev_rssi_info_t), (bt_address_t*)bd_addr);
BT_DBG("-");
}
+
#endif