MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

MeeGo::QmSystemState Class Reference

QmSystemState provides information and actions on device state. More...

Inheritance diagram for MeeGo::QmSystemState:
Inheritance graph
[legend]
Collaboration diagram for MeeGo::QmSystemState:
Collaboration graph
[legend]

List of all members.

Public Types

enum   NextState { Powerup = 0, Reboot, ShuttingDown }
 

States the user can set.

More...
enum   StateIndication {
  Shutdown = 0, ThermalStateFatal, BatteryStateEmpty, SaveData,
  RebootDeniedUSB, ShutdownDeniedUSB
}
 

State indication.

More...
enum   RunState {
  RunState_User = 0, RunState_ActDead, RunState_Test, RunState_Local,
  RunState_Malf, RunState_Flash, RunState_Shutdown, RunState_Unknown
}
enum   BootReason {
  BootReason_Unknown = -1, BootReason_SwdgTimeout = 0, BootReason_SecViolation, BootReason_Wdg32kTimeout,
  BootReason_PowerOnReset, BootReason_PowerKey, BootReason_MBus, BootReason_Charger,
  BootReason_Usb, BootReason_SWReset, BootReason_RTCAlarm, BootReason_NSU
}

Signals

void  systemStateChanged (MeeGo::QmSystemState::StateIndication what)
  Sent when device state indication has been received.

Public Member Functions

  QmSystemState (QObject *parent=0)
  Constructor.
  ~QmSystemState ()
bool  set (NextState nextState)
  Requests the system to move into state nextState. The system state change may not actually change when the function returns; use the systemStateChanged(MeeGo::QmSystemState::StateIndication) signal to track the system state changes.
RunState  getRunState ()
  Gets the current run state.
BootReason  getBootReason ()
  Gets the current boot reason.
unsigned int  getPowerOnTimeInSeconds ()
  Gets the accumulated value of the power on counter in seconds, which represents the total time the device has been powered on.

Protected Member Functions

void  connectNotify (const char *signal)
void  disconnectNotify (const char *signal)

Detailed Description

QmSystemState provides information and actions on device state.

Scope:
Nokia Meego

Member Enumeration Documentation

Enumerator:
BootReason_Unknown 
BootReason_SwdgTimeout 

Security watchdog timeout.

BootReason_SecViolation 

Security violation.

BootReason_Wdg32kTimeout 

32k watchdog timeout

BootReason_PowerOnReset 

Power on reset issued by the HW.

BootReason_PowerKey 

Power key pressed.

BootReason_MBus 

MBus.

BootReason_Charger 

Charger plugged in.

BootReason_Usb 

Usb charger plugged in.

BootReason_SWReset 

SW reset issued by the system.

BootReason_RTCAlarm 

Real Time Clock Alarm.

BootReason_NSU 

Software update.

States the user can set.

Enumerator:
Powerup 

Powerup from acting dead.

Reboot 

Reboot.

ShuttingDown 

Shutdown.

Enumerator:
RunState_User 
RunState_ActDead 
RunState_Test 

Similar to Local, but CMT tests are run differently.

RunState_Local 

Used when the device is mounted to a jig for R&D purposes.

RunState_Malf 
RunState_Flash 
RunState_Shutdown 
RunState_Unknown 

State indication.

Enumerator:
Shutdown 

Normal shutdown.

ThermalStateFatal 

Shutdown due to thermal state.

BatteryStateEmpty 

Shutdown due battery empty within few seconds.

SaveData 

Save data.

RebootDeniedUSB 

Reboot denied because USB is connected in mass storage mode.

ShutdownDeniedUSB 

Shutdown denied because USB is connected in mass storage mode.


Constructor & Destructor Documentation

MeeGo::QmSystemState::QmSystemState ( QObject parent = 0  ) 

Constructor.

Parameters:
parent  The possible parent object
MeeGo::QmSystemState::~QmSystemState (  ) 

Member Function Documentation

void MeeGo::QmSystemState::connectNotify ( const char *  signal  )  [protected, virtual]

Reimplemented from QObject.

void MeeGo::QmSystemState::disconnectNotify ( const char *  signal  )  [protected, virtual]

Reimplemented from QObject.

BootReason MeeGo::QmSystemState::getBootReason (  ) 

Gets the current boot reason.

Returns:
The current boot reason
unsigned int MeeGo::QmSystemState::getPowerOnTimeInSeconds (  ) 

Gets the accumulated value of the power on counter in seconds, which represents the total time the device has been powered on.

Returns:
The total time in seconds the device has been powered on
RunState MeeGo::QmSystemState::getRunState (  ) 

Gets the current run state.

Returns:
The current run state
bool MeeGo::QmSystemState::set ( NextState  nextState  ) 

Requests the system to move into state nextState. The system state change may not actually change when the function returns; use the systemStateChanged(MeeGo::QmSystemState::StateIndication) signal to track the system state changes.

Credential:
dsme::DeviceStateControl Resource token required to set the device state (shutdown/reboot/powerup).
Parameters:
nextState  New state
Returns:
True if a valid state was requested, false otherwise
void MeeGo::QmSystemState::systemStateChanged ( MeeGo::QmSystemState::StateIndication  what  )  [signal]

Sent when device state indication has been received.

Parameters:
what  Received state indication type

(C) 2009-2011 Nokia Corporation
LGPL Lesser General Public License
MeeGo 1.2 Harmattan API