diff options
author | Nikias Bassen | 2010-05-24 18:00:50 +0200 |
---|---|---|
committer | Nikias Bassen | 2010-05-26 01:39:28 +0200 |
commit | 847eaeba69de3b22e5d65b3a98311655876df80e (patch) | |
tree | 7b54addfcedb6c9bbe0c53d3648984c5ed01dc61 /daemon | |
parent | dab29e73450ca82d6de991db529d39f7d89dd1e8 (diff) | |
download | usbmuxd-847eaeba69de3b22e5d65b3a98311655876df80e.tar.gz usbmuxd-847eaeba69de3b22e5d65b3a98311655876df80e.tar.bz2 |
usbmuxd: rename notify_device to notify_device_add; added notify_device_remove
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/client.c | 13 |
1 files 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; i<count; i++) { - if(notify_device(client, dev++) < 0) { + if(notify_device_add(client, dev++) < 0) { free(devs); return -1; } @@ -402,7 +407,7 @@ void client_device_add(struct device_info *dev) usbmuxd_log(LL_DEBUG, "client_device_add: id %d, location 0x%x, serial %s", dev->id, 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 } |