![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Usb Device Interface, protocol, and programming homework #4 Audio Control device
Dependencies: C12832_lcd USBDevice mbed
Diff: USBAudioControl.h
- Revision:
- 1:948ffad3284f
- Parent:
- 0:69eb9d19fb91
--- a/USBAudioControl.h Tue Jul 30 22:35:10 2013 +0000 +++ b/USBAudioControl.h Wed Jul 31 22:20:00 2013 +0000 @@ -25,7 +25,8 @@ */ USBAudioControl( uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0006, uint16_t product_release = 0x0001): USBHID(1, 1, 1, vendor_id, product_id, product_release, false) - { + { + // NO suspend callback by default. callbackSuspendChange=NULL; }; @@ -37,8 +38,25 @@ */ virtual uint8_t * reportDesc(); + /* + * USBDevice does not ptovide a callback function for connection state changes + * This functions will poll the state + * + * @returns 0/1 for the Connected state + */ unsigned int getConnectState(); + + /* + * User accessable Function pointer for callbacks + */ void (*callbackSuspendChange)(unsigned int connected); + + /* + * + * Provide override function for USBDevice function suspendStateChanged + * USBDevice version of the function does nothing, the HIDAudiControl + * provides a use callback hool. + */ virtual void suspendStateChanged(unsigned int suspend); };