• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
PCMCIA : Sleep + Eject + Wake up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PCMCIA : Sleep + Eject + Wake up


  • Subject: PCMCIA : Sleep + Eject + Wake up
  • From: Alain Crétet <email@hidden>
  • Date: Tue, 18 Mar 2003 11:20:42 +0100
  • Thread-topic: PCMCIA : Sleep + Eject + Wake up

Hi,

With the following code the Sleep and Eject routines work better.
When I ask for eject my card, with the eject menu bar, I have the following trace :
message() : card services event CS_EVENT_EJECTION_REQUEST
message() : card services event CS_EVENT_CARD_REMOVAL
IOPCCard: shutting down socket 0.
IOPCCard: calling terminate on socket 0 function 0 nub 0x18f2d00.
stop() : * STOP (myAudioDevice) 0x18f2d00
free() : * FREE (myAudioDevice)

When I insert my card :
IOPCCard16Device: binding socket 0 function 0 to card services.
initHardware() : * INIT HARDWARE (myAudioDevice)

But when I go to Sleep state and I Eject my card I did not receive the CS_EVENT_CARD_REMOVAL event.
What could I do when the computer is wake up ?
What can I do to call "IOPCCard: shutting down socket 0".


IOReturn
myAudioDevice::performPowerStateChange(IOAudioDevicePowerState oldPowerState,
IOAudioDevicePowerState newPowerState,
UInt32 *microsecondsUntilComplete)
{
...
// ******************************************
// WAKE UP
// ******************************************
if( oldPowerState == kIOAudioDeviceSleep )
{
// ******************************************
// PCCard is present
// ******************************************
if( nubPCCard16Device->getState() == (DEV_CONFIG | DEV_PRESENT) ) {
....
// Reinitialize
...
// ******************************************
// PCCard is not present
// ******************************************
} else {
DOUT( DBG_POWER_MODE, ("%s() : The card was removed while sleeping \n", __FUNCTION__ ));

// What can I do in this case ???
// I try the following function, but It does not wake up ...
scheduleStop( nubPCCard16Device ); // Call Stop and Free

}
}
...
return result;
}


IOReturn
myAudioDevice::message( UInt32 type, IOService * provider, void * argument )
{
...
switch(type) {
case kIOPCCardCSEventMessage: {

case CS_EVENT_EJECTION_REQUEST:
DOUT( DBG_POWER_MODE, ("%s() : card services event CS_EVENT_EJECTION_REQUEST.\n", __FUNCTION__ ));

case CS_EVENT_CARD_REMOVAL:
DOUT( DBG_POWER_MODE, ("%s() : card services event CS_EVENT_CARD_REMOVAL.\n", __FUNCTION__ ));

case CS_EVENT_EJECTION_COMPLETE:
DOUT( DBG_POWER_MODE, ("%s() : card services event CS_EVENT_EJECTION_COMPLETE.\n", __FUNCTION__ ));
}
}
...
return kIOReturnSuccess;
}

Thanks in advance for all replies...


Alain CRETET
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: AudioUnits and Cocoa UI
  • Next by Date: Re: AudioUnits and Cocoa UI
  • Previous by thread: [OT?] DP3 and AudioUnits
  • Next by thread: Welcome & SDK
  • Index(es):
    • Date
    • Thread