Intermec ck1 Reference Guide
Chapter 2 — Configuring the CK1 System
CK1 SDK Programmer’s Reference Manual
61
Entering Idle Mode
Purpose: Force the system into Idle mode whether the APM is enabled or not. In
Idle mode, the MPU clock frequency is 10 MHz, and the system returns
to Normal mode when you press the keypad.
to Normal mode when you press the keypad.
When the system enters Idle mode:
1
Send signal SIGSUSPEND to every user-space application.
2
Wait 0.25 second. Application is given the opportunity to write
everything to flash disk after receiving this signal.
everything to flash disk after receiving this signal.
3
Flush the file system cache buffers to flash disk.
4
Enter Idle mode.
Syntax:
int devApmIdle( void )
On-CK1 Parameters: None
On-CK1 Return: -1
Function
failed
0 Function
succeeded
On-Host Parameters: None
On-Host Return: Always return 0
Example: Sample program to demonstrate how user-space applications deal with the
signal SIGSUSPEND.
#include <signal.h>
static void write_everything(int);
int main (void)
{
// register the signal service routine
if (signal(SIGSUSPEND, write_everything) == SIG_ERR)
printf(“
static void write_everything(int);
int main (void)
{
// register the signal service routine
if (signal(SIGSUSPEND, write_everything) == SIG_ERR)
printf(“
Can’t register write_everything
() to SIGUSR1\n”);
// write your codes below
}
static void write_everything(int signo)
{
//
write your codes to write everything to flash disk below
devApmFileCopy(“/var/myfile”, “/home/myfile”);
}
}
Entering Standby Mode
Purpose: In Standby mode, MPU clock stops. The system exits Standby mode when
the Power key is pressed, serial data is received (RING from the modem
dock), or an RTC Alarm event occurs.
dock), or an RTC Alarm event occurs.
When the system enters Standby mode:
1
Send signal SIGSLOW to every user-space application.