RxUsbDeregisterNotification: Difference between revisions
Appearance
Created page with "==Description== Removes the registration of attach/detach notification semaphores. ==Syntax== <pre> rc = RxUsbDeregisterNotification(NotifyID) </pre> ==Parameters== ; Notif..." |
added return codes and remarks and corrected example code |
||
Line 11: | Line 11: | ||
==Return Code== | ==Return Code== | ||
<pre> | |||
0x0000 - NO_ERROR | |||
</pre> | |||
===Errors=== | ===Errors=== | ||
<pre> | |||
0x0006 - ERROR_INVALID_HANDLE | |||
0x001F - ERROR_GEN_FAILURE | |||
0x0057 - ERROR_INVALID_PARAMETER | |||
0x005F - ERROR_INTERRUPT | |||
0x0064 - ERROR_TOO_MANY_SEMAPHORES | |||
0x0067 - ERROR_TOO_MANY_SEM_REQUESTS | |||
0x0069 - ERROR_SEM_OWNER_DIED | |||
0x1B58 - USB_NOT_INIT | |||
0xFF1F - ERROR_GEN_FAILURE | |||
0xFF57 - ERROR_INVALID_PARAMETER | |||
0xFFBB - ERROR_SEM_NOT_FOUND | |||
</pre> | |||
==Remarks== | ==Remarks== | ||
Device attach/detach notifications may be obtained by registering event | |||
semaphores to be posted upon attach/detach of USB devices. | |||
The RexxUtil library provides functions to work with event semaphores. | |||
Some of these are used in the example code. | |||
==Example Code== | ==Example Code== | ||
<pre> | <pre> | ||
/* add | /* add RxUsbDeregisterNotification */ | ||
rc = RxFuncAdd(' | rc = RxFuncAdd('RxUsbDeregisterNotification','usbcalls','RxUsbDeregisterNotification') | ||
say '+RxUsbDeregisterNotification(),RC=0x'd2x(rc) | |||
say '+ | |||
/* invoke | /* invoke RxUsbDeregisterNotification */ | ||
rc = RxUsbDeregisterNotification(NotifyID) | |||
say '*RxUsbDeregisterNotification(),RC=0x'd2x(rc) | |||
rc = | |||
say '* | |||
/* drop | /* drop RxUsbDeregisterNotification */ | ||
rc = RxFuncDrop(' | rc = RxFuncDrop('RxUsbDeregisterNotification') | ||
say '- | say '-RxUsbDeregisterNotification(),RC=0x'd2x(rc) | ||
/* add | /* add SysCloseEventSem */ | ||
rc = RxFuncAdd(' | rc = RxFuncAdd('SysCloseEventSem','RexxUtil','SysCloseEventSem') | ||
say '+ | say '+SysCloseEventSem(),RC=0x'd2x(rc) | ||
/* invoke | /* invoke SysCloseEventSem() */ | ||
rc = SysCloseEventSem(hSemAttach) | |||
rc = | say '*SysCloseEventSem(),RC=0x'd2x(rc) | ||
say '* | rc = SysCloseEventSem(hSemDetach) | ||
say '*SysCloseEventSem(),RC=0x'd2x(rc) | |||
rc = | |||
say '* | |||
/* drop | /* drop SysCloseEventSem */ | ||
rc = RxFuncDrop(' | rc = RxFuncDrop('SysCloseEventSem') | ||
say '- | say '-SysCloseEventSem(),RC=0x'd2x(rc) | ||
</pre> | </pre> | ||
Revision as of 18:32, 23 January 2017
Description
Removes the registration of attach/detach notification semaphores.
Syntax
rc = RxUsbDeregisterNotification(NotifyID)
Parameters
- NotifyID
- the NotifyID received from RxUsbChangeNotification or RxUsbDeviceNotification.
Return Code
0x0000 - NO_ERROR
Errors
0x0006 - ERROR_INVALID_HANDLE 0x001F - ERROR_GEN_FAILURE 0x0057 - ERROR_INVALID_PARAMETER 0x005F - ERROR_INTERRUPT 0x0064 - ERROR_TOO_MANY_SEMAPHORES 0x0067 - ERROR_TOO_MANY_SEM_REQUESTS 0x0069 - ERROR_SEM_OWNER_DIED 0x1B58 - USB_NOT_INIT 0xFF1F - ERROR_GEN_FAILURE 0xFF57 - ERROR_INVALID_PARAMETER 0xFFBB - ERROR_SEM_NOT_FOUND
Remarks
Device attach/detach notifications may be obtained by registering event semaphores to be posted upon attach/detach of USB devices. The RexxUtil library provides functions to work with event semaphores. Some of these are used in the example code.
Example Code
/* add RxUsbDeregisterNotification */ rc = RxFuncAdd('RxUsbDeregisterNotification','usbcalls','RxUsbDeregisterNotification') say '+RxUsbDeregisterNotification(),RC=0x'd2x(rc) /* invoke RxUsbDeregisterNotification */ rc = RxUsbDeregisterNotification(NotifyID) say '*RxUsbDeregisterNotification(),RC=0x'd2x(rc) /* drop RxUsbDeregisterNotification */ rc = RxFuncDrop('RxUsbDeregisterNotification') say '-RxUsbDeregisterNotification(),RC=0x'd2x(rc) /* add SysCloseEventSem */ rc = RxFuncAdd('SysCloseEventSem','RexxUtil','SysCloseEventSem') say '+SysCloseEventSem(),RC=0x'd2x(rc) /* invoke SysCloseEventSem() */ rc = SysCloseEventSem(hSemAttach) say '*SysCloseEventSem(),RC=0x'd2x(rc) rc = SysCloseEventSem(hSemDetach) say '*SysCloseEventSem(),RC=0x'd2x(rc) /* drop SysCloseEventSem */ rc = RxFuncDrop('SysCloseEventSem') say '-SysCloseEventSem(),RC=0x'd2x(rc)