diff --git a/emulator/main.c b/emulator/main.c
index 6a30c8c..807c663 100644
--- a/emulator/main.c
+++ b/emulator/main.c
struct server *server1;
struct server *server2;
struct server *server3;
+ struct server *server4;
sigset_t mask;
mainloop_init();
if (!server3)
fprintf(stderr, "Failed to open LE server channel\n");
+ server4 = server_open_unix(SERVER_TYPE_MONITOR, "/tmp/bt-server-mon");
+ if (!server4)
+ fprintf(stderr, "Failed to open monitor server channel\n");
+
return mainloop_run();
}
diff --git a/emulator/server.c b/emulator/server.c
index 841c2b3..e4c4570 100644
--- a/emulator/server.c
+++ b/emulator/server.c
return;
}
+ if (!client->btdev)
+ return;
+
count = client->pkt_offset + len;
while (count > 0) {
case SERVER_TYPE_AMP:
type = BTDEV_TYPE_AMP;
break;
+ case SERVER_TYPE_MONITOR:
+ goto done;
}
client->btdev = btdev_create(type, server->id);
btdev_set_send_handler(client->btdev, client_write_callback, client);
+done:
if (mainloop_add_fd(client->fd, EPOLLIN, client_read_callback,
client, client_destroy) < 0) {
btdev_destroy(client->btdev);
diff --git a/emulator/server.h b/emulator/server.h
index e63e2b2..b99b210 100644
--- a/emulator/server.h
+++ b/emulator/server.h
SERVER_TYPE_BREDR,
SERVER_TYPE_LE,
SERVER_TYPE_AMP,
+ SERVER_TYPE_MONITOR,
};
struct server;