本文整理汇总了C++中IOService::acknowledgeNotification方法的典型用法代码示例。如果您正苦于以下问题:C++ IOService::acknowledgeNotification方法的具体用法?C++ IOService::acknowledgeNotification怎么用?C++ IOService::acknowledgeNotification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOService
的用法示例。
在下文中一共展示了IOService::acknowledgeNotification方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OSDynamicCast
//.........这里部分代码省略.........
}
fDeviceOffline = TRUE; // set flag to reflect shutting down state.
fClientIOBlocked = FALSE;
DLOGPWR("[email protected]%lx device OFFLINE\n------------------\n", fI2CAddress);
}
else
if (newPowerState == kIOI2CPowerState_SLEEP)
{
DLOGPWR("[email protected]%lx transition to SLEEP\n", fI2CAddress);
I2CLOCK; // Wait for pending I2C requests to complete then block any new I2C requests...
fPowerThreadID = current_thread(); // Setup to allow only requests from this thread to be processed.
fClientIOBlocked = TRUE; // All requests from other threads will return offline.
I2CUNLOCK; // Allow blocked threads to proceed so they return offline.
if (fCurrentPowerState == kIOI2CPowerState_ON)
{
DLOGPWR("[email protected]%lx process SLEEP event\n", fI2CAddress);
performFunctionsWithFlags(kIOPFFlagOnSleep);
processPowerEvent(kI2CPowerEvent_SLEEP);
}
fDeviceOffline = TRUE; // set flag to reflect shutting down state.
fClientIOBlocked = FALSE;
DLOGPWR("[email protected]%lx device OFFLINE\n------------------\n", fI2CAddress);
}
else
if (newPowerState == kIOI2CPowerState_DOZE)
{
DLOGPWR("IO[email protected]%lx transition to DOZE\n", fI2CAddress);
processPowerEvent(kI2CPowerEvent_DOZE);
}
else
if (newPowerState == kIOI2CPowerState_ON)
{
DLOGPWR("[email protected]%lx transition to ON\n", fI2CAddress);
I2CLOCK; // Wait for pending I2C requests to complete then block any new I2C requests...
fPowerThreadID = current_thread(); // Setup to allow only requests from this thread to be processed.
fClientIOBlocked = TRUE; // All requests from other threads will return offline.
fDeviceOffline = FALSE; // set flag to reflect we are not shutting down.
I2CUNLOCK; // Allow blocked threads to proceed so they return offline.
if (fCurrentPowerState == kIOI2CPowerState_SLEEP)
{
DLOGPWR("[email protected]%lx process WAKE event\n", fI2CAddress);
performFunctionsWithFlags(kIOPFFlagOnWake);
processPowerEvent(kI2CPowerEvent_WAKE);
}
else
{
// The first power state ON transition is processed as a STARTUP event.
// The fStateFlags.kStateFlags_STARTUP gets set only once...
if (0 == (fStateFlags & kStateFlags_STARTUP))
{
fStateFlags |= kStateFlags_STARTUP;
DLOGPWR("[email protected]%lx process STARTUP event\n", fI2CAddress);
// Perform any functions flagged on init.
performFunctionsWithFlags(kIOPFFlagOnInit);
processPowerEvent(kI2CPowerEvent_STARTUP);
}
else
{
DLOGPWR("[email protected]%lx process power ON event\n", fI2CAddress);
processPowerEvent(kI2CPowerEvent_ON);
}
}
DLOGPWR("[email protected]%lx::setPowerState device ONLINE\n------------------\n", fI2CAddress);
fClientIOBlocked = FALSE; // Allow all threads to access I2C through this device.
}
else
{
DLOGPWR("[email protected]%lx ERROR transition to invalid state:%lu\n", fI2CAddress, newPowerState);
return;
}
fCurrentPowerState = newPowerState;
if (fSysPowerRef)
{
IOService *service = OSDynamicCast(IOService, (OSMetaClassBase *)fSysPowerRef);
if (service)
{
DLOG("[email protected]%lx acknowledgeNotification\n", fI2CAddress);
service->acknowledgeNotification(this, 0);
}
fSysPowerRef = NULL;
}
else
{
DLOG("[email protected]%lx acknowledgeSetPowerState: %lu\n", fI2CAddress, fCurrentPowerState);
acknowledgeSetPowerState();
}
}