From 8eaac0513bfb238edec22d46320669f5c9c76542 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 18 May 2009 22:29:39 +0200 Subject: Make use of usbmuxd and remove libusb dependencies Signed-off-by: Matt Colyer --- dev/main.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'dev/main.c') diff --git a/dev/main.c b/dev/main.c index 510c75f..5c9a5a7 100644 --- a/dev/main.c +++ b/dev/main.c @@ -42,7 +42,7 @@ void perform_notification(iphone_device_t phone, iphone_lckd_client_t control, c iphone_lckd_start_service(control, "com.apple.mobile.notification_proxy", &nport); if (nport) { printf("::::::::::::::: np was started ::::::::::::\n"); - iphone_np_new_client(phone, 3555, nport, &np); + iphone_np_new_client(phone, nport, &np); if (np) { printf("::::::::: PostNotification %s\n", notification); iphone_np_post_notification(np, notification); @@ -98,12 +98,12 @@ int main(int argc, char *argv[]) if (port) { iphone_afc_client_t afc = NULL; - iphone_afc_new_client(phone, 3432, port, &afc); + iphone_afc_new_client(phone, port, &afc); if (afc) { iphone_lckd_start_service(control, "com.apple.mobile.notification_proxy", &npp); if (npp) { printf("Notification Proxy started.\n"); - iphone_np_new_client(phone, 3756, npp, &gnp); + iphone_np_new_client(phone, npp, &gnp); } else { printf("ERROR: Notification proxy could not be started.\n"); } @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) NULL }; iphone_np_observe_notifications(gnp, nspec); - //iphone_np_set_notify_callback(gnp, notifier); + iphone_np_set_notify_callback(gnp, notifier); } perform_notification(phone, control, NP_SYNC_WILL_START); @@ -209,15 +209,16 @@ int main(int argc, char *argv[]) if (gnp && lockfile) { char *noti; + /* noti = NULL; iphone_np_get_notification(gnp, ¬i); if (noti) { printf("------> received notification '%s'\n", noti); free(noti); - } + }*/ printf("XXX sleeping\n"); - for (i = 0; i < 5; i++) { + /*for (i = 0; i < 5; i++) { noti = NULL; printf("--- getting notification\n"); iphone_np_get_notification(gnp, ¬i); @@ -229,6 +230,8 @@ int main(int argc, char *argv[]) } sleep(1); } + */ + sleep(5); //perform_notification(phone, control, NP_SYNC_DID_FINISH); -- cgit v1.1-32-gdbae