obexapp print stream statistics after transfer

Iain Hibbert plunky at rya-online.net
Wed Oct 20 08:04:31 UTC 2010


On Tue, 19 Oct 2010, Maksim Yevmenkin wrote:

> thanks for all the patches! could you please try the combined patch
> (attached) and make sure it still works for you?

yes, its still working fine thanks

- in retrospect I wasn't sure about the last one, if using printf() is ok?

one more patch attached, with two parts

- not really important as they won't be called but later versions of
  openobex (using 1.5) provide some more event hooks might be interesting
  for somebody :)

- I never have seen the spinner, fflush(stdout) to force visibility

I was trying to get back to another thing I was working on earlier this
year, to split up the OPUSH and FTRN services so that I could have
different settings. I've not got far with it though, maybe next week :)

iain
-------------- next part --------------
--- event.c.orig	2010-10-20 08:39:18.000000000 +0100
+++ event.c	2010-10-20 08:59:45.000000000 +0100
@@ -60,7 +60,9 @@ static obexapp_event_handler_t * const	s
 	obexapp_event_stub,		/* 6 - OBEX_EV_ACCEPTHINT */ 
 	obexapp_event_abort,		/* 7 - OBEX_EV_ABORT */
 	obexapp_stream_write,		/* 8 - OBEX_EV_STREAMEMPTY */
-	obexapp_stream_read		/* 9 - OBEX_EV_STREAMAVAIL */
+	obexapp_stream_read,		/* 9 - OBEX_EV_STREAMAVAIL */
+	obexapp_event_stub,		/* 10 - OBEX_EV_UNEXPECTED */
+	obexapp_event_stub,		/* 11 - OBEX_EV_REQCHECK */
 };
 #define	server_eh_size	((int)(sizeof(server_eh)/sizeof(server_eh[0])))
 
@@ -75,7 +77,9 @@ static obexapp_event_handler_t * const	c
 	obexapp_event_stub,		/* 6 - OBEX_EV_ACCEPTHINT */ 
 	obexapp_event_abort,		/* 7 - OBEX_EV_ABORT */
 	obexapp_stream_write,		/* 8 - OBEX_EV_STREAMEMPTY */
-	obexapp_stream_read		/* 9 - OBEX_EV_STREAMAVAIL */
+	obexapp_stream_read,		/* 9 - OBEX_EV_STREAMAVAIL */
+	obexapp_event_stub,		/* 10 - OBEX_EV_UNEXPECTED */
+	obexapp_event_stub,		/* 11 - OBEX_EV_REQCHECK */
 };
 #define	client_eh_size	((int)(sizeof(client_eh)/sizeof(client_eh[0])))
 
@@ -137,6 +141,7 @@ obexapp_event_progress(obex_t *handle, _
 		static uint32_t	spinner_idx = 0;
 
 		printf("%c\b", spinner[spinner_idx ++]);
+		fflush(stdout);
 		if (spinner_idx == sizeof(spinner)/sizeof(spinner[0]) - 1)
 			spinner_idx = 0;
 	}


More information about the freebsd-bluetooth mailing list