Home |
Media Transfer Protocol Class Driver Function USBMTPGetFileProperty Function USBMTPSetFileProperty Function USBMTPSetEventCallback |
Function USBMTPSetEventCallbackUSBMTPSetEventCallback instructs the MTP class driver to inform the application of MTP Events: typedef void (RTTAPI * USBMTPEventCallback)(int Dev, WORD EventCode, DWORD * Parameters); int USBMTPSetEventCallback(int Dev, USBMTPEventCallback Callback); ParametersDevIndex of the MTP device. This value should be in range 0 .. RTUSBMTPConfig.MaxDevices - 1. CallbackA pointer to a function to be called when an MTP Event is received from the device specified with parameter Dev. return valueIf successful, a value >= RTU_SUCCESS is returned, otherwise, a negative error code. MTP devices generate events when their state changes in some way, for example when a new file is created or the battery level has dropped below a certain level. After this function has been called, the application's callback is called for each such event. The callback's parameter EventCode specifies what kind of event has occurred. All possible event codes are listed in Appendix G of the USB Media Transfer Protocol Specification, Revision 1.1. Each event may have up to 3 additional parameters which are passed to the callback through parameter Parameters. Function MTP of demo program MTPDemo shows how this function is used.
|