#include <asm/byteorder.h>
#include <talloc/talloc.h>
+#include <waiter/waiter.h>
+#include <log/log.h>
-#include "ui/common/device.h"
#include "pb-protocol/pb-protocol.h"
#include "list/list.h"
-#include "log.h"
-#include "waiter.h"
#include "device-handler.h"
+#include "discover-server.h"
struct discover_server {
int socket;
client->fd);
}
-static int client_write_message(struct discover_server *server,
+static int client_write_message(
+ struct discover_server *server __attribute__((unused)),
struct client *client, struct pb_protocol_message *message)
{
int rc;
return 0;
}
+void discover_server_notify_add(struct discover_server *server,
+ struct device *device)
+{
+ struct client *client;
+
+ list_for_each_entry(&server->clients, client, list)
+ write_add_message(server, client, device);
+
+}
+
+void discover_server_notify_remove(struct discover_server *server,
+ struct device *device)
+{
+ struct client *client;
+
+ list_for_each_entry(&server->clients, client, list)
+ write_remove_message(server, client, device->id);
+
+}
+
void discover_server_set_device_source(struct discover_server *server,
struct device_handler *handler)
{