How to implement macOS sleep and wake for USB serial drivers using USBSerialDriverKit.

Development environment: Xcode Version 15.1 (15C65), macOS 14.2.1 (23C71) Run-time configuration: macOS 14.2.1 (23C71)

DESCRIPTION OF PROBLEM 1.The device supports sleep and wake functionality, and sleep/wake can be achieved on both Linux and Windows.

2.Does macOS's USBSerialDriverKit support sleep and wake? If so, how can I implement it?

3.Is it necessary to modify system permissions on macOS to use a USB serial device for sleep and wake functionality?

STEPS TO REPRODUCE I don't know how macOS performs power management for serial devices. The sleep wake function fails to pass the test on macOS

Answered by DTS Engineer in 803191022

2.Does macOS's USBSerialDriverKit support sleep and wake? If so, how can I implement it?

Yes, though that support is part of DriverKit more broadly, not specific to USBSerialDriverKit. Take a look at the "Responding to Power-Level Changes" section of IOService to see the specific methods.

3.Is it necessary to modify system permissions on macOS to use a USB serial device for sleep and wake functionality?

No, not inherently.

STEPS TO REPRODUCE

I don't know how macOS performs power management for serial devices. The sleep wake function fails to pass the test on macOS

The place I would start here is with "Managing Power" section of "IOKit Fundamentals". Architecturally, DriverKit is built as an extension of IOKit and it's power management support is a somewhat simplified variant of how IOKit works.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

2.Does macOS's USBSerialDriverKit support sleep and wake? If so, how can I implement it?

Yes, though that support is part of DriverKit more broadly, not specific to USBSerialDriverKit. Take a look at the "Responding to Power-Level Changes" section of IOService to see the specific methods.

3.Is it necessary to modify system permissions on macOS to use a USB serial device for sleep and wake functionality?

No, not inherently.

STEPS TO REPRODUCE

I don't know how macOS performs power management for serial devices. The sleep wake function fails to pass the test on macOS

The place I would start here is with "Managing Power" section of "IOKit Fundamentals". Architecturally, DriverKit is built as an extension of IOKit and it's power management support is a somewhat simplified variant of how IOKit works.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

How to implement macOS sleep and wake for USB serial drivers using USBSerialDriverKit.
 
 
Q