From 847eaeba69de3b22e5d65b3a98311655876df80e Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 24 May 2010 18:00:50 +0200 Subject: usbmuxd: rename notify_device to notify_device_add; added notify_device_remove --- daemon/client.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/daemon/client.c b/daemon/client.c index 4f44bcc..194632d 100644 --- a/daemon/client.c +++ b/daemon/client.c @@ -201,7 +201,7 @@ int client_notify_connect(struct mux_client *client, enum usbmuxd_result result) return 0; } -static int notify_device(struct mux_client *client, struct device_info *dev) +static int notify_device_add(struct mux_client *client, struct device_info *dev) { struct usbmuxd_device_record dmsg; memset(&dmsg, 0, sizeof(dmsg)); @@ -213,6 +213,11 @@ static int notify_device(struct mux_client *client, struct device_info *dev) return send_pkt(client, 0, MESSAGE_DEVICE_ADD, &dmsg, sizeof(dmsg)); } +static int notify_device_remove(struct mux_client *client, uint32_t device_id) +{ + return send_pkt(client, 0, MESSAGE_DEVICE_REMOVE, &device_id, sizeof(uint32_t)); +} + static int start_listen(struct mux_client *client) { struct device_info *devs; @@ -235,7 +240,7 @@ static int start_listen(struct mux_client *client) } dev = devs; for(i=0; iid, dev->location, dev->serial); FOREACH(struct mux_client *client, &client_list) { if(client->state == CLIENT_LISTEN) - notify_device(client, dev); + notify_device_add(client, dev); } ENDFOREACH } void client_device_remove(int device_id) @@ -411,7 +416,7 @@ void client_device_remove(int device_id) usbmuxd_log(LL_DEBUG, "client_device_remove: id %d", device_id); FOREACH(struct mux_client *client, &client_list) { if(client->state == CLIENT_LISTEN) - send_pkt(client, 0, MESSAGE_DEVICE_REMOVE, &id, sizeof(uint32_t)); + notify_device_remove(client, id); } ENDFOREACH } -- cgit v1.1-32-gdbae