diff options
author | Charles Lohr <lohr85@gmail.com> | 2016-12-11 00:03:40 -0500 |
---|---|---|
committer | Charles Lohr <lohr85@gmail.com> | 2016-12-11 00:03:40 -0500 |
commit | 44d7e56bf6a419104fee5dd2aedc26e00e543d69 (patch) | |
tree | 91567a4cfced76249981f616cf22781995989c58 /src/survive_usb.c | |
parent | 4d5a42768f142c25c2efa6c6fd54e1f0dc484f70 (diff) | |
download | libsurvive-44d7e56bf6a419104fee5dd2aedc26e00e543d69.tar.gz libsurvive-44d7e56bf6a419104fee5dd2aedc26e00e543d69.tar.bz2 |
* Get config from headset.
* Make pretty display.
* Improve disambiguation.
Diffstat (limited to 'src/survive_usb.c')
-rw-r--r-- | src/survive_usb.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/survive_usb.c b/src/survive_usb.c index cfcef17..affcdd5 100644 --- a/src/survive_usb.c +++ b/src/survive_usb.c @@ -298,8 +298,7 @@ int survive_usb_poll( struct SurviveContext * ctx ) return r; } -#if 0 -//XXX THIS DOES NOT WORK!!! WHY??? + int survive_get_config( char ** config, struct SurviveContext * ctx, int devno, int iface ) { int i, ret, count = 0, size = 0; @@ -327,10 +326,10 @@ int survive_get_config( char ** config, struct SurviveContext * ctx, int devno, } size = cfgbuff[1]; - printf( "Tag: " ); - for( i = 0; i < 64; i++ ) - printf( "%02x ", cfgbuff[i] ); - printf( "ret: %d %d\n", ret, size ); +// printf( "Tag: " ); +// for( i = 0; i < 64; i++ ) +// printf( "%02x ", cfgbuff[i] ); +// printf( "ret: %d %d\n", ret, size ); if( !size ) break; @@ -365,13 +364,9 @@ int survive_get_config( char ** config, struct SurviveContext * ctx, int devno, return -5; } - config = malloc( len + 1 ); - memcpy( config, uncompressed_data, len ); + *config = malloc( len + 1 ); + memcpy( *config, uncompressed_data, len ); return len; } -#endif - - - |