diff --git a/src/mgmt.c b/src/mgmt.c
index 9e75389..dbebdc8 100644
--- a/src/mgmt.c
+++ b/src/mgmt.c
static struct controller_info {
gboolean valid;
uint32_t current_settings;
- GSList *connections;
uint8_t discov_type;
} *controllers = NULL;
strerror(errno), errno);
}
-static void get_connections(uint16_t index)
-{
- struct mgmt_hdr hdr;
-
- DBG("index %u", index);
-
- memset(&hdr, 0, sizeof(hdr));
- hdr.opcode = htobs(MGMT_OP_GET_CONNECTIONS);
- hdr.index = htobs(index);
-
- if (write(mgmt_sock, &hdr, sizeof(hdr)) < 0)
- error("Unable to send get_connections command: %s (%d)",
- strerror(errno), errno);
-}
-
static void mgmt_index_added(uint16_t index)
{
DBG("index %u", index);
DBG("hci%u settings", index);
DBG("hci%u name %s", index, (char *) rp->name);
DBG("hci%u short name %s", index, (char *) rp->short_name);
-
- if (mgmt_powered(rp->current_settings))
- get_connections(index);
}
static void disconnect_complete(uint16_t index, uint8_t status,
bonding_complete(index, &rp->addr, status);
}
-static void get_connections_complete(uint16_t index, void *buf, size_t len)
-{
- struct mgmt_rp_get_connections *rp = buf;
- struct controller_info *info;
- int i;
-
- if (len < sizeof(*rp)) {
- error("Too small get_connections complete event");
- return;
- }
-
- if (len < (sizeof(*rp) + (rp->conn_count * sizeof(bdaddr_t)))) {
- error("Too small get_connections complete event");
- return;
- }
-
- if (index > max_index) {
- error("Unexpected index %u in get_connections complete",
- index);
- return;
- }
-
- info = &controllers[index];
-
- for (i = 0; i < rp->conn_count; i++) {
- struct mgmt_addr_info *addr;
-
- addr = g_memdup(&rp->addr[i], sizeof(*addr));
-
- info->connections = g_slist_append(info->connections, addr);
- }
-}
-
static void read_local_oob_data_complete(uint16_t index, void *buf, size_t len)
{
struct mgmt_rp_read_local_oob_data *rp = buf;
disconnect_complete(index, ev->status, ev->data, len);
break;
case MGMT_OP_GET_CONNECTIONS:
- get_connections_complete(index, ev->data, len);
+ DBG("get_connections complete");
break;
case MGMT_OP_PIN_CODE_REPLY:
DBG("pin_code_reply complete");
return 0;
}
-int mgmt_get_conn_list(int index, GSList **conns)
-{
- struct controller_info *info = &controllers[index];
-
- DBG("index %d", index);
-
- *conns = info->connections;
- info->connections = NULL;
-
- return 0;
-}
-
int mgmt_disconnect(int index, const bdaddr_t *bdaddr, uint8_t bdaddr_type)
{
char buf[MGMT_HDR_SIZE + sizeof(struct mgmt_cp_disconnect)];
diff --git a/src/mgmt.h b/src/mgmt.h
index 8fe149a..5fa214f 100644
--- a/src/mgmt.h
+++ b/src/mgmt.h
int mgmt_block_device(int index, const bdaddr_t *bdaddr, uint8_t bdaddr_type);
int mgmt_unblock_device(int index, const bdaddr_t *bdaddr, uint8_t bdaddr_type);
-int mgmt_get_conn_list(int index, GSList **conns);
-
int mgmt_disconnect(int index, const bdaddr_t *bdaddr, uint8_t bdaddr_type);
int mgmt_unpair_device(int index, const bdaddr_t *bdaddr, uint8_t bdaddr_type);