diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-03-16 10:57:59 -0600 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-03-16 10:57:59 -0600 |
commit | dbc6a598d2511847c1de1a39a732d07d8670854f (patch) | |
tree | 8d8a8350f0d0002794bfeb42b00336d3f7e6de9d /src/survive_vive.c | |
parent | e5cc00096e7b0700c75160c62f598a8af412c082 (diff) | |
download | libsurvive-dbc6a598d2511847c1de1a39a732d07d8670854f.tar.gz libsurvive-dbc6a598d2511847c1de1a39a732d07d8670854f.tar.bz2 |
Added usb packet statistics
Diffstat (limited to 'src/survive_vive.c')
-rwxr-xr-x | src/survive_vive.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/survive_vive.c b/src/survive_vive.c index f250c22..256b70b 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -142,6 +142,7 @@ struct SurviveUSBInterface usb_callback cb; int which_interface_am_i; //for indexing into uiface const char * hname; //human-readable names + size_t packet_count; }; struct SurviveViveData @@ -155,6 +156,7 @@ struct SurviveViveData og_thread_t servicethread[MAX_USB_DEVS]; #else struct libusb_context* usbctx; + size_t read_count; #endif }; @@ -214,6 +216,7 @@ static void handle_transfer(struct libusb_transfer* transfer) iface->actual_len = transfer->actual_length; iface->cb( iface ); + iface->packet_count++; if( libusb_submit_transfer(transfer) ) { @@ -776,6 +779,7 @@ int survive_vive_usb_poll( SurviveContext * ctx, void * v ) return 0; #else SurviveViveData * sv = v; + sv->read_count++; int r = libusb_handle_events( sv->usbctx ); if( r ) { |