USB attach detach events

I wanna capture USB attach and detach events. With a high level reading of Driverkit appears that it is to control the actual device.

In that case did not find anything related to attach/ detach events.


Is DriverKit the right extension to achieve this or any other System extension has to be used ??

Folks:: any pointers in this regard would help . Thank you. SJ

Hi ShanonJ,

as you may have noticed, there is precious little activity on these forums, there are other places on the Internet which are more active. The forums are full of posts without answers.

That being said, you want to look at https://developer.apple.com/library/archive/samplecode/USBPrivateDataSample/Introduction/Intro.html#//apple_ref/doc/uid/DTS10000456 to begin with. It is ancient but still relevant.

Unfortunately, this is how Apple's documentation works - the shiny new is presented and the old is shoved into an "no longer updated" box, even when it is still perfectly usable, without any indication of where the new documentation is to be found (often there is no newer documentation!)


DriverKit provides a way to write what used to be an in-kernel driver outside the kernel. But many USB devices can be supported with user-level code; most USB devices that require kernel drivers use standard class interfaces and can be supported by Apple's system drivers. DriverKit (or kernel extensions) are for those cases where the device is not supported by standard class drivers but most nevertheless be made available to the whole OS, not just a single app.


hope this helps, Stuart

USB attach detach events
 
 
Q