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)
{
case BT_PROPERTY_UUIDS: {
event_dev_services_t *services_info;
bt_uuid_t *uuids = (bt_uuid_t *) properties[0].val;
- BT_INFO("Properties len [%d] event structure size [%d]", properties[0].len, sizeof(event_dev_services_t));
+ BT_INFO("Properties len [%d] event structure size [%zu]", properties[0].len, sizeof(event_dev_services_t));
services_info = g_malloc(sizeof(event_dev_services_t) + properties[0].len);
services_info->address = dev_info->address;
memcpy(conn_status->address.addr, bd_addr->address, 6);
+#ifdef TIZEN_BT_HAL
+ conn_status->status = convert_to_oal_status(status);
+#else
if (BT_STATUS_SUCCESS != status) {
/* At present only timeout will cause non-success status, later we can add more */
conn_status->status = OAL_STATUS_CONN_TIMEOUT;
conn_status->status = OAL_STATUS_SUCCESS;
memcpy(conn_status->address.addr, bd_addr->address, 6);
+#endif
+
+ BT_INFO("ACL STATE :%d, conn_status->status :%d, BT_ACL_STATE: %d", status, conn_status->status, state);
+
switch (state) {
case BT_ACL_STATE_CONNECTED:
event = OAL_EVENT_DEVICE_ACL_CONNECTED;
BT_DBG("LE conn status:%d, state: %d", status, state);
memcpy(conn_status->address.addr, bd_addr->address, 6);
- if (BT_STATUS_SUCCESS != status)
- /* At present only timeout will cause non-success status, later we can add more */
- conn_status->status = OAL_STATUS_CONN_TIMEOUT;
- else
- conn_status->status = OAL_STATUS_SUCCESS;
+ conn_status->status = convert_to_oal_status(status);
switch (state) {
case BT_LE_CONN_STATE_CONNECTED:
}
#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