Page 2
The information contained herein is proprietary and is provided solely for the purpose of allowing customers to operate and service Intermec-manufactured equipment and is not to be released, reproduced, or used for any other purpose without written permission of Intermec.
Editing Files in a Project...10 Running a Project on a PC ...10 Compiling a Project...10 Debugging a Project ...11 Running a Project...11 Running a Project on a CK1...11 Downloading to a CK1 ...12 Other Tools...13 SDK Environment...13 Project Setting ...13 Compile Result...14...
Page 4
Example Code ...19 Designing the Basic UI ...19 Complete Example Code ...20 Configuring the CK1 System Introducing the CK1 ...24 Scanning Options for the CK1 ...25 System APIs...25 Buzzer APIs ...25 Buzzer Application APIs ...33 Light APIs ...40 Liquid Crystal Display APIs ...45 Advanced Power Management APIs ...51...
Page 5
PPP API Illustrations...80 Writing PPP Configuration Files...82 Reading PPP Configuration Files ...85 Requesting PPP Status...85 Resetting PPP ...86 Dialing the PPP Connection ...86 RTC Alarm API ...87 Example Code ...87 Enabling the Alarm Function ...89 CK1 SDK Programmer’s Reference Manual Contents...
Page 6
Getting Delimiter String...128 Disabling the Alarm Function ...89 Getting the Alarm Value...90 Waiting for the Alarm Arrival ...90 Connecting the CK1 to a PC...91 Remote Upgrade...92 Remote Upgrade APIs ...98 Example Code ...103 Getting the Current Setting of the Boot Flag...105 Setting a New Boot Flag ...105...
Page 18
Booting the Device ...314 Root File System...316 Changes in Programming Interfaces ...319 User Applications ...321 Future of µClinux...321 µClinux on the CK1...322 CK1 Hardware Architecture and Memory Mapping...322 xviii Processes...294 Reentrant Kernel ...296 Interprocess Communication...296 Threads Under Linux ...299 Memory Management in General Purpose Linux ...300 File Systems ...300...
Page 19
PPP Connection ...332 Remote Upgrade...332 Character Fonts ...333 Power Management on CK1 ...333 Mounted Partitions ...335 GUI System on the CK1 ...335 Developing Applications Under the µClinux System ...336 Supported Libraries ...337 C Library...337 Nano-X Library ...337 GDBM Database Library ...337 Device Configuration Files ...338...
Safety Summary Your safety is extremely important. Read and follow all warnings and cautions in this document before handling and operating Intermec equipment. You can be seriously injured, and equipment and data can be damaged if you do not follow the safety warnings and cautions.
Global Services and Support Warranty Information To understand the warranty for your Intermec product, visit the Intermec web site at http://www.intermec.com and click Service & Support. The Intermec Global Sales & Service page appears. From the Service & Support menu, move your pointer over Support, and then click Warranty.
Who Should Read This Document? The manual provides you with information about how to install and use the SDK and relevant APIs to create applications for the CK1 handheld computer. Before you create applications for your CK1, you should be familiar with your network and general networking terms, such as IP address.
Page 24
Before You Begin xxiv CK1 SDK Programmer’s Reference Manual...
• SDK appearance • Creating a new project • Editing a project • Running a project on a PC • Running a project on a CK1 • Downloading to a CK1 • Other tools • Example code CK1 SDK Programmer’s Reference Manual...
• Windows XP Professional • Windows 2000 Professional To install the SDK 1 Place the CK1 SDK Target Wizard CD in your PC CD drive. The installation wizard starts. If the installation wizard does not start, browse to the CD and double- click setup.exe.
Running the SDK Target Wizard • Select Start > Programs > Esfia SDK Wizard 2.0 > CK1 SDK. • Double-click the CK1 SDK target wizard shortcut on your PC desktop. The main window appears. For a description, see the next section.
Edit window (Font). When you click these menu items, dialog boxes appear. You can use the dialog boxes to set the functions. This menu provides help for the SDK wizard and the APIs and an introduction to C programming. CK1 SDK Programmer’s Reference Manual...
2 In the Basic tab, select the type of project such as SDK_Project. 3 In the Name field, enter the name for your project, and click OK. The Create new project dialog box appears. CK1 SDK Programmer’s Reference Manual Chapter 1 — Installing and Using the SDK...
To create a new source file from the File menu 1 Click File > New. A blank source file opens in the edit region. 2 Edit the source code and save it under the project directory. CK1 SDK Programmer’s Reference Manual...
2 Select the source files and click Open. The files are added to the project. 3 To confirm the result of adding files, select Option > Project Setting. CK1 SDK Programmer’s Reference Manual Chapter 1 — Installing and Using the SDK...
Opening a Project You can open a project from the File menu. To open a project from the File menu 1 Select File > Open Project or File. An Esfia SDK Wizard dialog box appears. CK1 SDK Programmer’s Reference Manual...
To remove a file from a project using the Project tab • Right-click the file in the Project tab, and select Remove file. The file is removed from the project and disappears from the Project tab. CK1 SDK Programmer’s Reference Manual Chapter 1 — Installing and Using the SDK...
2 Edit the file, and save it under the project directory. Running a Project on a PC To test your project before loading it onto a CK1, you need to: • compile the project. • debug the project.
When you select Execute > Run in Device, you can see the results of running the project on the CK1. Before you run a project on a CK1, connect the SDK to the CK1 by selecting Execute > Login to Device.
CK1. To download the executable binary file 1 Connect the SDK to the CK1 by selecting Execute > Login to Device. 2 Select Tools > Add Application to Device. The CK1 GUI configuration dialog box appears.
In the Project Setting dialog box, you can set the flags and library options for the project. To open the Project Setting dialog box • Select Option > Project Setting. CK1 SDK Programmer’s Reference Manual Chapter 1 — Installing and Using the SDK...
Compile Result The functions of the compile result area are described in “Running a Project on a PC” on page 10. When you right-click in this area, you can copy or clear the selected message. CK1 SDK Programmer’s Reference Manual...
Icon Editor When you create an application to run on the CK1, the available icon images may not be appropriate for your application. The SDK provides an Icon Editor for you to draw icons. To create an icon 1 Select Tools > Icon Editor.
2 Familiarize yourself with the dialog box: • The left side of the dialog box contains a picture of a CK1 keyboard and drop-down lists for selecting the trigger and navigation keys. • The right side of the dialog box contains all the available characters that can be mapped onto the CK1 keyboard.
Page 41
Assign the selected character to a location on the CK1 keyboard by clicking a key on the left side of the dialog box. 5 Repeat Step 4 until you have mapped every key on the CK1 keyboard. Be aware of these guidelines: •...
• Select View > Terminal. The Terminal dialog box appears. To log into the CK1 • Click Login. If the SDK target wizard has the CK1 IP address, user name, and password, the Terminal dialog box logs into the CK1.
Enter the CK1 IP address, user name, and password and click OK. The Terminal dialog box logs into the CK1. To clear the Terminal dialog box • Click Clear. All of the text in the Terminal dialog box disappears. Example Code This section provides example code for designing a user interface (UI) and for creating the example program hello.c.
GR_TFASCII|GR_TFTOP); Complete Example Code The following code is the complete hello.c code for the sample application. #include <stdio.h> #define MWINCLUDECOLORS #include "Nano-X.h" int main(int argc, char *argv[]) GR_WINDOW_ID win; GR_GC_ID gc; GR_WM_PROPERTIES props; GR_EVENT event; CK1 SDK Programmer’s Reference Manual...
Configuring the CK1 System This chapter provides an overview of the CK1 and its system and explains how to use the SDK functions to configure the CK1. This chapter covers these topics: • Introducing the CK1 • Scanning options for the CK1 •...
The CK1 Handheld Computer is a programmable data collection computer that runs custom or preloaded applications. The computer has a flash drive to store applications and files. The CK1 is designed to make data collection easy and includes these features. Connector...
#define ToneSi #define ScanOk (1800) #define ScanFail (100) CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Description Integrated standard-range laser scanner (650nM) with a scan rate of 39 scans per second Integrated linear imager with a scan rate of 200 scans per second...
BuzzerAdjustSystemVolume(). Since these APIs function both on CK1-execution (when the application that calls the APIs is running on the CK1) and on host-simulation (when the application that calls the APIs running on the host for simulation purpose), you can see the difference between the two environments.
Another way to adjust the volume by hand is to log into the device and type this command. #echo “a 70” > /proc/volume This command temporarily changes the volume. The CK1 reloads the default volume when it reboots. Example Code...
Function succeeded On-Host Parameters: NewVolume On-Host Return: Always return 0 CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System A Serial Music Notes:"); Function failed Current system volume value Value to use as the new volume (the value range is...
Chapter 2 — Configuring the CK1 System Setting System Volume Purpose: Set the system volume with the specified value. This value is the default value after you cold boot the CK1. Syntax: int devBuzzerSetSystemVolume(int NewVolume) On-CK1 Parameters: NewVolume On-CK1 Return: -1...
* How to Use this Program * ----------------------- * According to "Buzzer APP Testing Mode Menu" * According to "Buzzer APP Test Menu " ***************************************************************************/ ///////////////////////////////////////////////////////////////// CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System No action...
Page 58
Chapter 2 — Configuring the CK1 System #include <eslib_buzzer_app.h> #include <eslib_buzzer.h> #define BUZAPPITEMNUM 3 //#define BUZ_APP_TEST_DEBUG 1 int BuzzerAppDumpMsg = 1; //////////////////////////////////////////////////////////////////////////// //delay = 1000 about 1 sec static void Delay(int delay) int i, j; for(i=0; i<delay; i++) for(j=0; j<15000; j++);...
Page 59
Buzzzer WARNING Status = %d\n", getvalue); if(getvalue != BuzzerWarningOn) printf("Error!! Set Buzzer WARNING Failed\n"); else devBuzzerPlaySound(1000, 5, 100); //Get and Set BuzzerWarningOff if(BuzzerAppDumpMsg == 1) printf("\t----> Set to BuzzerWarningOff\n"); envBuzzerSetWarning(BuzzerWarningOff); getvalue = envBuzzerGetWarning(); CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System...
Page 60
Chapter 2 — Configuring the CK1 System if(BuzzerAppDumpMsg == 1) printf("\tCurrent Buzzzer WARNING Status = %d\n", getvalue); if(getvalue != BuzzerWarningOff) printf("Error!! Set Buzzer WARNING Failed\n"); //Recover Buzzer WARNING Original Status if(BuzzerAppDumpMsg == 1) printf("\tRecover Buzzer WARNING Original Status = %d\n", oristatus);...
BuzzerSystemPromptOn On-Host Parameters: None On-Host Return: Always return 0 CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Current warning status is off Current warning status is on Value to use as the new alarm status BuzzerWarningOn...
Blue Since these APIs function both on CK1-execution (when the application that calls the APIs runs on the CK1) and on host-simulation (when the application that calls the APIs run on the host as a simulation), you can see the difference between the two environments.
#include <stdio.h> #include <eslib_led.h> CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Turn on the light Turn on the light and turn off after Z seconds Turn off the light and turn on after Z seconds...
• Add this line to your source file: #include <eslib_lcdbias.h> CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Index number of the light that you want to set Seconds to delay to turn on the light...
Chapter 2 — Configuring the CK1 System There are function calls to let you control the brightness of the CK1 display. After devLcdAdjustBrightness() is called once or many times, you can call devLcdRestoreBrightness(). The brightness of the display CK1 goes back to the value before the adjustment, so you do not have to remember the value before the adjustment.
Page 71
PrintMenu() int i ; printf("\n\n==LCD Brightness Functional Test Menu==\n"); for(i=0; i<(MENUITEMS_NUM); i++) printf(MainMenu[i]); printf("\n"); printf("Your option: "); static void delay(int n) int i; for(i=0; i < n*50000; i++); CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System...
Page 72
Chapter 2 — Configuring the CK1 System int main(int argc,char *argv[]) struct lcd_status lcdinfo; char chi ; char buf[BUF_SIZE]; if((argc > 1) && ( (strncmp(argv[1],"-h",2)==0) || printf("\n*** LCDBIAS Functional Test Program ***\n\n"); return (0); PrintMenu(); while( ((chi = getchar()) != 'q') && (chi != 'Q') ) for(i=0;...
Purpose: Set the brightness of a specified LCD/LCM device. This value is the default value at the next cold boot. Syntax: int devLcdSetBrightness(int SetValue) CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System devLcdGetStatus(&lcdinfo); printf("\tPower = %s\n", printf("\tBacklight = %s\n",...
• Add this line to your source file: #include <eslib_apm.h> The CK1 has four modes of power management, as described in the next table. For more details, see “Power Management of CK1” on page 300. CK1 SDK Programmer’s Reference Manual...
LCD and keypad still. The CK1 returns to Normal mode when you press any key. The applications can run in this mode, but the speed is very low. The CK1 enters this mode when the device is not touched for two seconds when not on cradle.
Turn off the EXT5V Set the voltage to 3.8V for the BIOS to resume from Stop mode CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Send This Command # echo slow > /proc/apm # echo busy > /proc/apm # echo stop >...
Chapter 2 — Configuring the CK1 System Example Codes This section contains the following sample code: • sdk/examples/drv_api/apm_test/apmapi_test.c • sdk/examples/drv_api/apm_test/sigtest.c sdk/examples/drv_api/apm_test/apmapi_test.c /************************************************************************ * ---------- * Purpose * ---------- * To demonstrate how to use the APM driver API. * The APM default is enable, and auto control the system by default setting.
Page 79
Standby: "); devApmStandby(); sleep(2); printf("done.\n"); printf("\nSet apm Manual: "); devApmManual(); CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System auto=\t%d\n", devApmIsAuto()); el off sec=\t%d\n", devApmGetBacklightOffTime()); idle sec=\t%d\n", devApmGetIdleTime()); standby sec=\t%d\n", devApmGetStandbyTime());...
Page 80
Chapter 2 — Configuring the CK1 System sleep(2); printf("done.\n"); printf("Does APM enable? %s\n", (devApmIsAuto() ? "Yes" : "No") ); printf("Set Backlight on? (y/n)"); Ans = getc(stdin); if( Ans == 'y'){ devApmBacklightEnable(); printf("Set Backlight off? (y/n)"); Ans = getc(stdin); }while((Ans != 'y')&&(Ans != 'n'));...
Page 82
Chapter 2 — Configuring the CK1 System scanf("%d", &valueSetting); devApmSetBackupBatteryLow(valueSetting); printf("Set Backup battery good limit(%%) ? (y/n)"); Ans = getc(stdin); }while((Ans != 'y')&&(Ans != 'n')); if( Ans == 'y'){ printf("insert value: "); scanf("%d", &valueSetting); devApmSetBackupBatteryGood(valueSetting); printf("To view the setting value:\n");...
Page 83
-1; while(1){ sleep(10); return 0; CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System /* for signal handling */ /* for use the APM Driver API */ the program. terminate...
Idle/Standby mode. You can use the devApmAuto() function to re-enable the APM. When APM disabled, the Power key still works, so you can let the CK1 enter Standby mode and return to Normal mode by pressing the Power key.
When the system enters Standby mode: 1 Send signal SIGSLOW to every user-space application. CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Can’t register write_everything write your codes to write everything to flash disk below () to SIGUSR1\n”);...
Chapter 2 — Configuring the CK1 System Entering Standby Mode (continued) 2 Wait 2 seconds. Applications should write everything to flash disk after receiving the signal. 3 Flush file system cache buffers to flash disk. 4 Enter Standby mode. Syntax:...
On-Host Parameters: None On-Host Return: -1 Function failed Function succeeded Disabling the EXT5V Output Purpose: Turn off the external 5V output through serial port. Syntax: int devApmExt5vOff( void ) CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System...
On-Host Return: 0 Setting Backlight Timeout Purpose: Set the time for the APM to turn off the backlight of the display CK1 automatically. This value is the default value at next cold boot. When you set this value in APM enable status (after you call the devApmAuto() function ), APM restarts to count the time automatically.
Off Time, then the system goes into Idle mode after Idle Time and then into Standby mode after Standby Time. The CK1 enters Standby mode automatically only when the APM was enabled. This value is the default value at next cold boot.
Chapter 2 — Configuring the CK1 System Setting Main Battery Good Limit (continued) On-CK1 Parameters: GoodValue On-CK1 Return: -1 Setting failed Value failed to save Function succeeded On-Host Parameters: None On-Host Return: Always return 0 Setting Main Battery Low Limit Purpose: Set the main battery power low limit.
Function succeeded On-Host Parameters: None On-Host Return: Always return 0 CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Percentage of battery power for power critical limit (limit: 5-50) Function failed Value failed to save Function succeeded Percentage of battery power for power good limit.
Chapter 2 — Configuring the CK1 System Setting Backup Battery Low Limit Purpose: Set the backup battery power low limit. You can use this function to determine the battery power low warning value. Application can use this value to do something when battery power is low. This value is the default value at next cold boot.
On-Host Return: Always return 0 Getting Backlight Timeout Purpose: Get the time for the APM automatically to turn off the backlight if the CK1 is not in use. The application can use this function to know the value in the system. Syntax:...
Chapter 2 — Configuring the CK1 System Getting Idle Time Purpose: Get the time for the APM to place the system into Idle mode after APM turns off the backlight. The application can use this function to know the value in the system.
Chapter 2 — Configuring the CK1 System Getting Main Battery Very Low Limit Purpose: Get the main battery power very low limit value in the system. The application can use this function to know the value in the system to determine something to do or change this value or not.
) On-CK1 Parameters: None On-CK1 Return: -1 value Percentage of the power critical limit On-Host Parameters: No action On-Host Return: Always return 0 CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Function failed...
Chapter 2 — Configuring the CK1 System Getting AC Line Status Purpose: Get the AC line status. The application can use this function to know the AC line is online or offline now and determine to do something when each AC line status.
On-Host Parameters: None On-Host Return: Always return 0 PPP API Now that ESFIA Linux supports all four Point-to-Point protocol (PPP) connection modes, the CK1 can act as a PPP: • server over modem. • client over modem. • server over null modem.
Chapter 2 — Configuring the CK1 System break; getchar(); //clear stdin buffer exit (0); PPP API Illustrations There are four PPP configuration files for each PPP connect type: • PPP server over modem • PPP client over modem • PPP server over null modem •...
Page 105
Chapter 2 — Configuring the CK1 System If a client mode is configured, the PPP connection is in a client mode and does nothing until a DialPPPConnection( ) is called. Guide to Dialing to a Peer At any status, you can call ResetPPPConnection( ) to disconnect or reset PPP.
If a prefix number is required to dial, use :CK1 acts as PPP server over MODEM :CK1 acts as PPP client over MODEM :CK1 acts as PPP server over null MODEM :CK1 acts as PPP client over null MODEM = 1 : use peer DNS setting = 0 : use DNS setting we configured in /etc/resolv.conf...
Page 107
If a prefix number is needed, use PrefixNo,PhoneNumber as standard AT command. int TTYNumber;=2; Using ttyS2 int BaudRate=115200; CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System = 2 : we always use ttyS2 for CK1 model.
Page 108
Chapter 2 — Configuring the CK1 System int ConnectTimeOut=60; this should cause PPP client to stop connecting attempts after connect timeout. Mode 3 int ConnectType = 3; indicates that we are in mode 3,Device acts as PPP server over NULL MODEM int Mute = 0;...
ReadPPPCurrentType( ) reads active connect type which is set by WritePPPCurrentType( ). Syntax: int ReadPPPConfig(const int ConnectType, const struct structPPPConfig *PPPConfig) int ReadPPPCurrentType(void) On-CK1 Parameters: For details, see “PPP API Illustrations” on page 80. On-CK1 Return: ReadPPPConfig( ) Cannot read PPP configure Function succeeded ReadPPPCurrentType( ) 1 to 4 Connection type On-Host Parameters: For details, see “PPP API Illustrations”...
Chapter 2 — Configuring the CK1 System Requesting PPP Status (continued) PPP_STATE_SERVER_CONNECTED The PPP server is on and the connection is on. PPP_STATE_CLIENT_NOTSTART The PPP is configured as a PPP client. This stage is ready for a dial attempt. The connection is not on.
"Stop alarm next time?(y/n)" if you type 'y' , this program will be terminated. if you type 'n' , this program will continue running. CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System to run this program in SDK's Terminal...
Page 112
Chapter 2 — Configuring the CK1 System * 2. Use type "Ctrl-C" in SDK's Terminal to terminate this program when this program running. * ---------------- * Programming Note * ---------------- * 1. If you want to use alarm to wake up system in Suspend mode at a specified time every day, don't call the devRTCalarmDisable() function after alarm time setting.
On-Host Parameters: None On-Host Return: Always return 0 CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Specified alarm value for hour (limit: 0-23) Specified alarm value for minute (limit: 0-59) Specified alarm value for second (limit:0-59)
Chapter 2 — Configuring the CK1 System Getting the Alarm Value Purpose: Get the alarm time set in the system. This function lets the application change the alarm time. Syntax: int devRTCalarmValueGet( int *a_hour, int *a_min, int *a_sec ) On-CK1 Parameters: a_hour...
• Using a direct connection with PPP over a null modem protocol. • Using a network connection with PPP over a modem protocol. Using a Direct Connection Null Modem Connection: The PC dials up to the CK1 using PPP over a null modem protocol. Using a Network Connection Modem Connection: The PC dials up to the CK1 using PPP over a modem protocol.
This section explains how to configure and perform a remote upgrade. Configuring for Remote Upgrade 1 On the CK1, configure PPP over null modem server and Telnet server. For help, see the CK1 Handheld Computer User’s Manual. 2 On the PC, configure PPP over null modem client and FTP server. For help, see the online help or manual for your PC.
Page 117
PC FTP server is in /images/031008/zImage.031008 (the home directory for the user upgrade). 2 Make sure the image on the FTP server on the PC is right for the CK1 and the version of the image on the FTP server. Use RUGetVendor(kernel), RUGetProduct(kernel), and RUGetVersion(kernel) APIs to get the vendor, product, and version information of the kernel partition on the CK1.
Page 118
Chapter 2 — Configuring the CK1 System Default Setting Configuration Files The factory default setting file is: /etc/default/default_ru_xxxxxx The current setting file is: /etc/config/default_ru_xxxxxx You can call the APIs to change the content of these /etc/config/default_ru_xxxxx, but the device needs to reboot for the changes to take effect.
Page 119
#endif vendor = (char *) RUGetVendor(argv[1]); product = (char *) RUGetProduct(argv[1]); CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System or wrong vendor or wrong product or old version <vendor name>\n"); <product name>\n"); <version serial number...
Chapter 2 — Configuring the CK1 System return 0; if (strcmp(argv[1], product) != 0) { printf(“Product isn’t same, failed!\n”); return 0; if (strcmp(argv[2], version) <= 0) { printf(“Version isn’t newer than image on PC’s FTP server, failed\n”); return 0; result = RUUpgrade(“kernel”);...
Page 123
Purpose: Get the host IP address of the remote upgrade host. Syntax: char *RUGetHostIP(void) On-CK1 Parameters: None On-CK1 Return: Host IP address of the remote upgrade host in the configuration file Config File: /etc/config/default_ru_host On-Host Parameters: None On-Host Return: Always return NULL Setting Host IP Address Purpose: Set the host IP address of the remote upgrade host.
Page 124
Purpose: Get the default user password of the remote upgrade host. Syntax: char *RUGetPassword(void) On-CK1 Parameters: None On-CK1 Return: User login password of the remote upgrade host in the configuration file Config File: /etc/config/default_ru_passwd On-Host Parameters: None On-Host Return: Always return NULL Setting the Default Password Purpose: Set the default user password of the remote upgrade host.
Page 125
On-CK1 Return: Login path of the remote upgrade host in the configuration file Config File: /etc/config/default_ru_path On-Host Parameters: None On-Host Return: Always return NULL Setting the Default Path Purpose: Set the default path of the remote upgrade host. Syntax: int RUSetDefaultPath(char *path)
Page 126
Purpose: Get the vendor information of this image in the specified partition. Syntax: char *RUGetVendor(char *SpecPart) On-CK1 Parameters: SpecPart On-CK1 Return: Vendor information of this image in the specified partition Config File: /etc/config/default_ru_versoin_$(SpecPart) On-Host Parameters: SpecPart On-Host Return: Always return NULL Getting the Product Information of the Image File Purpose: Get the product information of this image in the specified partition.
GetFirmwareVersion(char* whichFirmware, char* Version); On-CK1 Parameters: whichFirmware Version On-CK1 Return: Pointer to the version string if successful; NULL if failed On-Host Return: Always return 0 System Configuration Setting You should include the header file if you want to use the system configuration setting application APIs.
Page 128
Chapter 2 — Configuring the CK1 System printf("Error Write Boot Flag\n"); else printf("Success write boot flag\n"); if (ReadBootFlag(Flag)) printf("Error Read BOOT FLAG\n"); else printf("BootFlag = %s\n",Flag); if (ReadVendorName(Flag)) printf("Error Read Vendor Name\n"); else printf("Vendor Name = %s\n",Flag); if (ReadProductName(Flag)) printf("Error Read product Name\n");...
Getting the Product Name Purpose: Get the product name. ProductName is less than 16 bytes. Syntax: int ReadProductName(char *ProductName) On-CK1 Return: -1 Function failed Function succeeded On-Host Return: ProductName CK1 CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System...
Chapter 2 — Configuring the CK1 System Getting the Version of the Images on NOR Flash Purpose: Get the version of the images. There are four images on NOR flash: bootloader, writer, bios, and diagnostic. The version has to be eight characters.
The disk size must be greater than or equal to 256 and less than or equal to 2048. Syntax: int RamdiskSetSize(int diskSize) On-CK1 Return: -1 Function failed Function succeeded On-Host Return: Always return 0 CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System Function failed...
Page 132
Chapter 2 — Configuring the CK1 System CK1 SDK Programmer’s Reference Manual...
Scanner Support This chapter provides APIs for managing and configuring the CK1 scanner and bar code symbologies. This chapter covers these topics: • Introducing scanner support • General functions • Function structure • Guidelines for the APIs • Member functions of TPT •...
Return Values: Function does not return any value Getting Bar Code Type Name Purpose: Translate the type number to a string. The GetBarcodeTypeName returns a longer string for the type, where the GetBarcodeShortTypeName returns a shorter name. CK1 SDK Programmer’s Reference Manual...
HAMSTER_FUNCTION1 HAMSTER_FUNCTION1 HAMSTER_FUNCTION6 }TPT; TPT Functions Function Name EnableBarcode DisableBarcode CheckBarcode GetBarcode SetBarcodePara GetBarcodePara CK1 SDK Programmer’s Reference Manual Type number that the control program shows to the application EnableBarcode; DisableBarcode; CheckBarcode; GetBarcode; SetBarcodePara; GetBarcodePara; SetToDefault; SetPreamble; GetPreamble; SetPostamble; GetPostamble;...
Get the post-sent characters Dummy Exist Set the delimiter Dummy Exist Get the delimiter Exist Exist Stop current scanning Exist Exist Start scanning bar code Exist Exist Get current setting array Bar Code Type Number CK1 SDK Programmer’s Reference Manual...
If the amble strings are not necessary, the two structures are the same as doing setting. The following table lists the setting type codes for Hamster chip. CK1 SDK Programmer’s Reference Manual Chapter 3 — Scanner Support Bar Code Type Number...
Page 141
Code maximum length Interleaved 2 of 5 Hamster Setting Status Parameters I 2 of 5 all settings I 2 of 5 CK1 SDK Programmer’s Reference Manual Chapter 3 — Scanner Support Type Status Action 0x39 Bit0 = 0 Disable...
Page 142
Disable fix length 0x4A Calculate and send check digit Calculate and do not send check digit Do not calculate check digit 1 ∼ 48 0x4B Default = 4 1 ∼ 48 0x4C Default = 48 CK1 SDK Programmer’s Reference Manual...
Page 143
Telpen character set EAN 128/UCC Hamster Setting Status Parameters EAN 128/UCC all settings EAN 128/UCC EAN 128/UCC Code ID EAN 128/UCC separator for double labels CK1 SDK Programmer’s Reference Manual Chapter 3 — Scanner Support Type Status Action 0x4D Bit0 = 0...
Purpose: Enable the trigger key for scanning. Syntax: int EnableBarcode(); Return Values: -1 Send request failed Cannot open COM Missing setting file Set to default fail CK1 SDK Programmer’s Reference Manual Chapter 3 — Scanner Support Type Status Action 0x8C Bit0 = 0 Disable...
Successfully got the bar code There is no bar code available Bar code type. For help, see the “Bar Code Setting Type Code for the Hamster Chip” table on page 114. Pointer of new status CK1 SDK Programmer’s Reference Manual...
SC_BOOL GetPreamble(char *PreStr); Parameter: PreStr Return Values: SC_TRUE SC_FALSE CK1 SDK Programmer’s Reference Manual Bar code type. For help, see the “Bar Code Setting Type Code for the Hamster Chip” table on page 114. Pointer of the current status Successfully got the bar code parameter...
Successfully got the postamble string Failed to get the postamble string Pointer of the delimiter buffer to set Pointer of the delimiter buffer to get Successfully got the delimiter string Failed to get the delimiter string CK1 SDK Programmer’s Reference Manual...
Syntax: SC_BOOL GetCurrentSetting(void *buffer); Parameter: buffer Return Values: SC_TRUE SC_FALSE CK1 SDK Programmer’s Reference Manual Successfully stopped scanning Failed to stop scanning Start to scan successfully Fail to set to start to scan Point to a more than 54 bytes space...
This chapter provides information on the October widget library for the CK1 SDK. This chapter covers these topics: • Introducing the October widget library • OtkApplication • OtkWidget • OtkArrowIcon • OtkButton • OtkCellBox • OtkCheckButton • OtkCombo • OtkControl •...
OtkApplication. Prototype: void otk_app_remove (OtkControl* contr); Parameter: contr Return: None CK1 SDK Programmer’s Reference Manual Width of the screen Height of the screen Pointer to the specified OtkControl object Pointer to the specified OtkControl object Chapter 4 — SDK Components...
Parameter: None Return: None otk_app_new_window Purpose: Decide the window identification privately in the otk_control_init function, and the otk_app_new_window is called to create a new window in that time. Prototype: OTK_WINDOW_ID otk_app_new_window(); Parameter: None In milliseconds CK1 SDK Programmer’s Reference Manual...
Prototype: OTK_GC otk_app_get_gc (OTK_COLOR color, int font_size, int gc_mode); Parameters: color font_size gc_mode Return: None CK1 SDK Programmer’s Reference Manual Window identification New color of this window Window identification New size Color of this graphics context Font size to use The drawing mode.
Drawing mode Font size Foreground color Background color Should drawing use background color Drawing region identification String containing the name of a built in font to look for Desired height of the font CK1 SDK Programmer’s Reference Manual...
Parameters: fontname font_height otk_app_get_font_size_info Purpose: Retrieve the font size currently set on the CK1. Prototype: void otk_app_get_font_size_info(OTK_GC gc, int* ch_w, int* ch_h); Parameters: gc ch_w ch_h Return: None otk_app_get_root_window_width Purpose: Retrieve the display width for the CK1 in pixels. Prototype: int otk_app_get_root_window_width();...
(OtkWidget* widget, OTK_BOOL visible); OTK_TRUE for show, OTK_FALSE for hide File handle to listen Function to call when fd has input with a type of “void fd_input(int fd)” Pointer to the real instance CK1 SDK Programmer’s Reference Manual...
(OtkWidget* widget, OTK_COLOR fgcolor); Parameters: widget fgcolor Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance OTK_TRUE if the widget is visible Pointer to the real instance OTK_TRUE if the widget is sensitive Pointer to the real instance...
Pointer to the real instance X position relative to its parent window Y position relative to its parent window Pointer to the real instance Maximum width for the specified widget Maximum height for the specified widget CK1 SDK Programmer’s Reference Manual...
(OtkArrowIcon* aicon, OTK_ALIGN align); Parameters: aicon align Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance Pointer to the specified data Pointer to the real instance Pointer to the real instance Pointer to the real instance Direction Chapter 4 —...
(OtkButton* button, OtkWidgetCallback callback); Parameters: button callback Return: None Pointer to the real instance Pointer to the real instance Pointer to the given text Pointer to the real instance Function to call for handling onClick events CK1 SDK Programmer’s Reference Manual...
OtkCellBox was inherited from OtkWidget. The properties are: "user_data"(void*:Read/Write) CK1 SDK Programmer’s Reference Manual Pointer to the real instance Pointer to the specified data Pointer to the real instance...
OtkCell array of cells for the widget. There should be enough cells in the array in accordance with the specified number of columns and rows. Pointer to the real instance Pointer to the real instance CK1 SDK Programmer’s Reference Manual...
Purpose: Initialize the instance to be an OtkCheckButton widget. Prototype: void otk_check_button_init(OtkCheckButton* cbutton); Parameter: cbutton Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance Pointer to the real instance Pointer to the specified data Pointer to the real instance Pointer to the real instance Chapter 4 —...
OTK_TRUE if check box is selected Pointer to the real instance if you select the check box Pointer to the real instance Pointer to the specified data Pointer to the real instance If you select the check box CK1 SDK Programmer’s Reference Manual...
Prototype: void otk_combo_set_user_data (OtkCombo* combo, void* user_data); Parameters: combo user_data Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance Pointer to the real instance Pointer to the real instance Pointer to the real instance Pointer to the specified data...
Purpose: Set the border size of the window of the specified OtkControl widget to the specified size. Prototype: void otk_control_set_border_size (OtkControl* contr, int size); Pointer to the real instance Pointer to the real instance Pointer to the real instance Pointer to the object to be added CK1 SDK Programmer’s Reference Manual...
Purpose: Get user data. Prototype: void* otk_control_get_user_data (OtkControl* contr); Parameter: contr Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance Specified value Pointer to the real instance Pointer to the real instance Pointer to the real instance...
Given 0 if range height relative to the root window. The window is located in the center of the range form given y to y+range_h. Pointer to the real instance Pointer to the specified data CK1 SDK Programmer’s Reference Manual...
NULL. Prototype: OTK_BOOL otk_group_remove (OtkGroup* group, OtkWidget* widget); Parameters: group CK1 SDK Programmer’s Reference Manual Pointer to the real instance Pointer to the real instance Pointer to the real instance Pointer to the object to be added If okay Pointer to the real instance Chapter 4 —...
OTK_BITMAP* bmp); Pointer to the object to be removed If okay Pointer to the real instance Pointer to the specified data If okay Pointer to the real instance Pointer to the real instance CK1 SDK Programmer’s Reference Manual...
Prototype: void otk_list_init (OtkList* list, int col_number); Parameter: list col_number Return: The function returns no value. CK1 SDK Programmer’s Reference Manual Pointer to the real instance Width of the bitmap Height of the bitmap Pointer to the bitmap Pointer to the real instance...
Pointer to the specified OtkScrollBar widget Pointer to the real instance Function specified to call to handle onSelect events Pointer to the real instance Function specified to call to handle onTimeout events Pointer to the real instance True or false CK1 SDK Programmer’s Reference Manual...
(OtkList* list, int col, int width); Parameters: list CK1 SDK Programmer’s Reference Manual Pointer to the real instance A string array. There should be enough strings in the array in accordance with the number of columns of the specified OtkList widget.
Specified OtkItem object of the specified OtkList widget Index to the specified column of the specified OtkItem object Bitmap data should be an array of aligned 16-bit words Width of the bitmap Height of the bitmap CK1 SDK Programmer’s Reference Manual...
(OtkList* list, OtkItem* item); Parameters: list item Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance Specified OtkItem object of the specified OtkList widget Index to the specified column of the specified OtkItem object Text for the cell...
Pointer to the real instance Specified row index of the OtkList Pointer to the real instance Pointer to the real instance Pointer to the real instance Pointer to the real instance Specified row index of the OtkList CK1 SDK Programmer’s Reference Manual...
Parameters: widget x_axis y_axis Return: OTK_FALSE CK1 SDK Programmer’s Reference Manual Pointer to the real instance Pointer to the specified data Pointer to the real instance Object that emits the event X coordinates of the occurrence relative to the window parent...
Given 0 if the range height is relative to the root window. The window is located in the center of the range form given y to y+range_h. Pointer to the real instance Pointer to the specified data CK1 SDK Programmer’s Reference Manual...
Prototype: void otk_radio_group_set_grab_item(OtkRadioGroup* radios, OtkToggleButton* tbutton); Parameters: radios tbutton Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance Pointer to the real instance Pointer to the real instance Pointer to the OtkToggleButton instance which will be grouped...
Purpose: Initialize the instance to be OtkScrollList. Prototype: void otk_scroll_list_init (OtkScrollList* slist); Parameter: slist Return: None Pointer to the real instance Pointer to the real instance Pointer to the specified data Pointer to the real instance Pointer to the real instance CK1 SDK Programmer’s Reference Manual...
Purpose: Initialize the instance to be an OtkTab widget. Prototype: void otk_tab_init(OtkTab* tab); Parameter: tab Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance Pointer to the real instance Pointer to the specified data Pointer to the real instance Pointer to the real instance Chapter 4 —...
OtkGroup. The properties are: "user_data"(void*:Read/Write) Pointer to the real instance Specified text Pointer to the real instance Specified OtkWidget object Pointer to the real instance Pointer to the specified data Pointer to the real instance CK1 SDK Programmer’s Reference Manual...
Purpose: Get user data. Prototype: void* otk_toggle_button_get_user_data (OtkToggleButton* tbutton); CK1 SDK Programmer’s Reference Manual Pointer to the real instance OTK_TRUE if you click the toggle Pointer to the real instance If you click the toggle Pointer to the real instance Pointer to the specified data Chapter 4 —...
Defines the text cursor’s offset position. Defines the start offset of the marked region. If the sellength is 0, the selstart is equal to the cursor_pos. Defines the string length of the marked region. Points to the text buffer. CK1 SDK Programmer’s Reference Manual...
(OtkEditable* oep,OtkWidget* pwidget); Parameters: oep pwidget Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified editable instance Pointer of the specified editable instance X coordinate of the position Y coordinate of the position Pointer of the specified editable instance...
Pointer of the previous widget Pointer of the specified editable instance Pointer of the next widget Pointer of the specified editable instance Pointer of the event handler function Pointer of the specified editable instance Pointer of the drawing function CK1 SDK Programmer’s Reference Manual...
Purpose: Set the auto set property of the specified editable instance. Prototype: void otk_editable_set_autoset (OtkEditable* oep, OTK_BOOL autoset); CK1 SDK Programmer’s Reference Manual Pointer of the specified editable instance Flag Pointer of the specified editable instance Pointer of the parent widget X coordinate of the editable instance’s position...
Pointer of the specified editable instance New value of the modified property Pointer of the specified editable instance New value of the read-only property Pointer of the specified editable instance New value of the focused property CK1 SDK Programmer’s Reference Manual...
Purpose: Set the text content of the specified editable instance with a memory buffer. Prototype: int otk_editable_set_buffer (OtkEditable* oep,char* buffer,int bsize); CK1 SDK Programmer’s Reference Manual Pointer of the specified editable instance New value for the maximum length Pointer of the specified editable instance New value of the text property...
Pointer of the buffer that stores the file name Pointer of the specified editable instance Pointer of the buffer to return the content in Buffer size Pointer of the specified editable instance Pointer of the buffer to return the content in Buffer size CK1 SDK Programmer’s Reference Manual...
(OtkEditable* oep); Parameter: oep Return: 1 If succeeded If failed CK1 SDK Programmer’s Reference Manual Pointer of the specified editable instance Pointer of the specified editable instance Pointer of the specified editable instance Pointer of the specified editable instance...
Pointer of the specified buffer that contains the text Length of the text buffer content Whether the marked region still hold Pointer of the specified editable instance Pointer of the specified editable instance Pointer of the specified editable instance CK1 SDK Programmer’s Reference Manual...
Parameters: oep ref_cursor Return: negative other CK1 SDK Programmer’s Reference Manual Pointer of the specified editable instance Pointer of the buffer with the text content that is inserted Length of the text content that is inserted Specified cursor position to insert the text content...
Defines the alignment style of the text content. Defines the maximum length of the text that can be edited. Defines if the entry is in Password mode. The entry displays all characters as an asterisk (*). CK1 SDK Programmer’s Reference Manual...
(OtkEntry* oep, OTK_COLOR bcolor); Parameters: oep bcolor Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified entry instance Pointer of the specified entry instance New value of the visible state Pointer of the specified entry instance...
Pointer of the specified entry instance X coordinate of the position Y coordinate of the position Pointer of the specified entry instance Width Height Pointer of the specified entry instance Pointer of the parent widget CK1 SDK Programmer’s Reference Manual...
(OtkEntry* oep, OtkWidgetDrawingFunc drawingfunc); Parameters: oep drawingfunc Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified entry instance Pointer of the previous widget Pointer of the specified entry instance Pointer of the next widget Pointer of the specified entry instance...
X coordinate of the entry’s position Y coordinate of the entry’s position Width of the entry Height of the entry Pointer of the specified entry instance Pointer of the previous widget Pointer of the next widget CK1 SDK Programmer’s Reference Manual...
(OtkEntry* oep, OTK_BOOL readonly); Parameters: oep readonly Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified entry instance New foreground color New background color Pointer of the specified entry instance New value of the autoset property...
Pointer of the specified entry instance Pointer of the memory buffer Length of the text string in the memory buffer Pointer of the specified entry instance Pointer of the buffer that stores the file name CK1 SDK Programmer’s Reference Manual...
Return: 1 If succeeded If failed CK1 SDK Programmer’s Reference Manual Pointer of the specified entry instance Pointer of the specified entry instance Pointer of the specified entry instance Pointer of the specified entry instance Pointer of the specified buffer that contains the text...
Pointer of the specified entry instance Pointer of the specified entry instance Pointer of the specified entry instance Font size Pointer of the specified entry instance Value of the align style CK1 SDK Programmer’s Reference Manual...
Purpose: Redraw the specified entry. Prototype: void otk_entry_refresh(OtkEntry* oep); Parameter: oep Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified entry instance Value of the restrict length Pointer of the specified entry instance New value of the pswdmode property...
OtkWidget and OtkEditable. The properties are: Property “mask”(char*:Read) “mask_unentered_char”(char:Read) Pointer of the specified entry that occurs at the OnReturnPress event CK1 SDK Programmer’s Reference Manual Description Points to a buffer with mask format in it. Replaces all the unentered characters in the text buffer.
OTK_COLOR bcolor); Parameters: oep bcolor Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified mask edit instance Pointer of the specified mask edit instance New value of the visible state Pointer of the specified mask edit instance...
Pointer of the specified mask edit instance X coordinate of the position Y coordinate of the position Pointer of the specified mask edit instance Width Height Pointer of the specified mask edit instance Pointer of the parent widget CK1 SDK Programmer’s Reference Manual...
(OtkMaskEdit* oep, OtkWidgetDrawingFunc drawingfunc); Parameters: oep drawingfunc Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified mask edit instance Pointer of the previous widget Pointer of the specified mask edit instance Pointer of the next widget...
X coordinate of the mask edit’s position Y coordinate of the mask edit’s position Width of the mask edit Height of the mask edit Pointer of the specified mask edit instance Pointer of the previous widget Pointer of the next widget CK1 SDK Programmer’s Reference Manual...
(OtkMaskEdit* oep, OTK_BOOL readonly); Parameters: oep readonly Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified mask edit instance New foreground color New background color Pointer of the specified mask edit instance New value of the auto set property...
Pointer of the specified mask edit instance Pointer of the memory buffer Length of text string in the memory buffer Pointer of the specified mask edit instance Pointer of the buffer that stores the file name CK1 SDK Programmer’s Reference Manual...
Return: 1 If succeeded If failed CK1 SDK Programmer’s Reference Manual Pointer of the specified mask edit instance Pointer of the specified mask edit instance Pointer of the specified mask edit instance Pointer of the specified mask edit instance...
Length of the text content that is inserted Specified cursor position to insert the text content Pointer of the specified mask edit instance Specified cursor position to start deleting Specified length to delete to from del_pos CK1 SDK Programmer’s Reference Manual...
Pointer of the specified mask edit Pointer of the buffer with mask format string Pointer of the specified mask edit Unentered character Pointer of the specified mask edit that occurs at the OnReturnPress event CK1 SDK Programmer’s Reference Manual...
Purpose: Set the position of the page. Prototype: void otk_page_set_position (OtkPage* page, int x, int y); Parameters: page Return: None CK1 SDK Programmer’s Reference Manual Description Defines the step of the page. Pointer of the OtkPage instance Pointer of the OtkPage instance...
Maximum value of the page Minimum value of the page Current value of the page Pointer of the OtkPage instance Step value of the page Pointer of the OtkPage instance Pointer of the OtkPage instance CK1 SDK Programmer’s Reference Manual...
OtkPage page2; OtkToggleButton enable_tog; int main() otk_app_init(160, 142); CK1 SDK Programmer’s Reference Manual Pointer of the OtkPage instance Maximum value of the page Pointer of the OtkPage instance Minimum value of the page Pointer of the OtkPage instance Current value of the page...
Page 226
OTK_BOOL range_callback (OtkWidget* sb, int x, int y) OtkRange* range = OTK_RANGE(sb); printf("__________range value______%d_______\n", range->value); return OTK_TRUE; OTK_BOOL togglebutton_callback (OtkWidget* enable_tog_btn, int x, int y) OtkToggleButton* tp = OTK_TOGGLE_BUTTON(enable_tog_btn); otk_widget_set_sensitive(OTK_WIDGET(&page1),tp->value); return OTK_TRUE; CK1 SDK Programmer’s Reference Manual...
(OtkRange *range); Parameter: range Return: OTK_FALSE Maximum value of the range CK1 SDK Programmer’s Reference Manual Description Defines the maximum of the range. Defines the minimum of the range. Defines the value of the range (min ≤ value ≥ max).
If failed If succeeded Pointer of the OtkRange instance If failed If succeeded Pointer of the OtkRange instance Value of the range If failed If succeeded Pointer of the OtkRange instance If failed If succeeded CK1 SDK Programmer’s Reference Manual...
*range, OtkWidgetCallback callback); Parameters: range callback Return: OTK_FALSE OTK_TRUE CK1 SDK Programmer’s Reference Manual otk_range_set_range (OtkRange *range, int max, int Pointer of the OtkRange instance Maximum value of the range Minimum value of the range If failed If succeeded...
If succeeded Description Defines the orientation kind of the scrollbar (vertical: 0, horizontal: 1). Defines the step of the scrollbar. Pointer of the OtkScrollBar instance Pointer of the OtkScrollBar instance Orientation kind of the scrollbar CK1 SDK Programmer’s Reference Manual...
Purpose: Set the step value of the scrollbar. Prototype: void otk_scrollbar_set_step (OtkScrollBar* scrollbar, int stepvalue); Parameters: scrollbar CK1 SDK Programmer’s Reference Manual Pointer of the OtkScrollBar instance Width of the scrollbar Height of the scrollbar Pointer of the OtkScrollBar instance...
Pointer of the OtkScrollBar instance Pointer of the OtkScrollBar instance Maximum value of the scrollbar Pointer of the OtkScrollBar instance Minimum value of the scrollbar Pointer of the OtkScrollBar instance Current value of the scrollbar CK1 SDK Programmer’s Reference Manual...
Purpose: Initialize the OtkScrollBar2 instance. Prototype: void otk_scrollbar2_init (OtkScrollBar2* scrollbar); Parameter: scrollbar Description Defines the orientation of the scrollbar (vertical: 0, horizontal: 1). Defines the step of the scrollbar. Pointer of the OtkScrollBar2 instance CK1 SDK Programmer’s Reference Manual...
Purpose: Set the range of the scrollbar. Prototype: void otk_scrollbar2_set_range (OtkScrollBar2* scrollbar, int max, int min, int value); Parameters: scrollbar CK1 SDK Programmer’s Reference Manual Pointer of the OtkScrollBar2 instance Orientation of the scrollbar Pointer of the OtkScrollBar2 instance Width of the scrollbar...
Minimum value of the scrollbar Current value of the scrollbar Pointer of the OtkScrollBar2 instance Step value of the scrollbar Pointer of the OtkScrollBar2 instance Pointer of the OtkScrollBar2 instance Maximum value of the scrollbar CK1 SDK Programmer’s Reference Manual...
131, 0, 70); otk_scrollbar2_set_step(&scrollbar1, 10); otk_control_add_child (&contr1, OTK_WIDGET(&scrollbar1)); otk_scrollbar2_refresh (&scrollbar1); otk_widget_set_sensitive(OTK_WIDGET(&scrollbar1), enable_tog.value); otk_range_set_change_callback (OTK_RANGE(&scrollbar1), range_callback); CK1 SDK Programmer’s Reference Manual Pointer of the OtkScrollBar2 instance Minimum value of the scrollbar Pointer of the OtkScrollBar2 instance Current value of the scrollbar //VERTICAL_SCROLLBAR =...
Page 238
OTK_BOOL range_callback (OtkWidget* sb, int x, int y) OtkRange* range = OTK_RANGE(sb); printf("__________range value______%d_______\n", range->value); return OTK_TRUE; OTK_BOOL togglebutton_callback (OtkWidget* enable_tog_btn, int x, int y) OtkToggleButton* tp = OTK_TOGGLE_BUTTON(enable_tog_btn); otk_widget_set_sensitive(OTK_WIDGET(&scrollbar1),tp->value); otk_widget_set_visible(OTK_WIDGET(&scrollbar2),tp->value); otk_widget_redraw (OTK_WIDGET(&scrollbar2)); return OTK_TRUE; //VERTICAL_SCROLLBAR = CK1 SDK Programmer’s Reference Manual...
(OtkSpin* spin, int width, int height); Parameters: spin width height Return: None CK1 SDK Programmer’s Reference Manual Description Defines the orientation of the spin (vertical: 0, horizontal: 1). Pointer of the OtkSpin instance Pointer of the OtkSpin instance...
Pointer of the OtkSpin instance Maximum value of the spin Minimum value of the spin Current value of the spin Pointer of the OtkSpin instance Pointer of the OtkSpin instance Maximum value of the spin CK1 SDK Programmer’s Reference Manual...
HORIZONTAL_SPIN = 1 otk_spin_set_size (&spin1, 30, 30); otk_spin_set_position (&spin1, 0, 30); otk_spin_set_range(&spin1, 131, 0, 70); CK1 SDK Programmer’s Reference Manual Pointer of the OtkSpin instance Minimum value of the spin Pointer of the OtkSpin instance Current value of the spin //VERTICAL_SPIN = 0, Chapter 4 —...
Page 242
OTK_BOOL range_callback (OtkWidget* sb, int x, int y) OtkRange* range = OTK_RANGE(sb); printf("__________range value______%d_______\n", range->value); return OTK_TRUE; OTK_BOOL togglebutton_callback (OtkWidget* enable_tog_btn, int x, int y) OtkToggleButton* tp = OTK_TOGGLE_BUTTON(enable_tog_btn); otk_widget_set_sensitive(OTK_WIDGET(&spin1),tp->value); otk_widget_set_visible(OTK_WIDGET(&spin2),tp->value); otk_widget_redraw (OTK_WIDGET(&spin2)); return OTK_TRUE; //VERTICAL_SPIN = 0, CK1 SDK Programmer’s Reference Manual...
(OtkSlider* slider, int width, int height); Parameters: slider width height Return: None CK1 SDK Programmer’s Reference Manual Description Defines the orientation of the slider (vertical: 1, horizontal: 0). Defines the step of the slider. Pointer of the OtkSlider instance...
Pointer of the OtkSlider instance Maximum value of the slider Minimum value of the slider Current value of the slider Pointer of the OtkSlider instance Step value of the slider Pointer of the OtkSlider instance CK1 SDK Programmer’s Reference Manual...
OtkSlider slider1; OtkSlider slider2; OtkToggleButton enable_tog; int main() CK1 SDK Programmer’s Reference Manual Pointer of the OtkSlider instance Maximum value of the slider Pointer of the OtkSlider instance Minimum value of the slider Pointer of the OtkSlider instance Current value of the slider...
Purpose: Set the position of the selection. Prototype: void otk_selection_set_position (OtkSelection* selection, int x, int y); Parameters: selection CK1 SDK Programmer’s Reference Manual Pointer of the OtkSelection instance Pointer of the OtkSelection instance Width of the selection Height of the selection Pointer of the OtkSelection instance Chapter 4 —...
Number of label of the selection for selecting Pointer of the OtkSelection instance Label of the selection for selecting // from 1 to the number that you set before Pointer of the OtkSelection instance Chosen selection CK1 SDK Programmer’s Reference Manual...
Purpose: Set the size of the selection2. Prototype: void otk_selection2_set_size (OtkSelection2* selection2, int width, int height); Parameters: selection2 width height Return: None Pointer of the OtkSelection2 instance Pointer of the OtkSelection2 instance Width of the selection2 Height of the selection2 CK1 SDK Programmer’s Reference Manual...
Parameters: selection2 value Return: None CK1 SDK Programmer’s Reference Manual Pointer of the OtkSelection2 instance X coordinate on the top left point of the selection2 Y coordinate on the top left point of the selection2 //the minimum is 2, the maximum is 15...
Parameter: opp Return: None Specified OtkTabgroup widget Value for the width of button Value for the height of button Pointer to the real instance Pointer to the specified data Pointer of the OtkCustomPopupMenu instance CK1 SDK Programmer’s Reference Manual...
OtkWidget* otk_custompopupmenu_get_child_item(OtkCustomPopupMenu* opp, int itemnum); Parameters: opp itemnum CK1 SDK Programmer’s Reference Manual Pointer of the OtkCustomPopupMenu instance Pointer of the item that is added Pointer of the specified OtkCustomPopupMenu instance Pointer of the OtkCustomPopupMenu instance that is the opp’s owner...
* opp, OtkCustomPopupMenu* submenu); If failed If succeeded Pointer of the specified OtkCustomPopupMenu instance X coordinate to show the specified OtkCustomPopupMenu Y coordinate to show the specified OtkCustomPopupMenu Pointer of the specified OtkCustomPopupMenu Pointer of the specified OtkCustomPopupMenu CK1 SDK Programmer’s Reference Manual...
Prototype: OTK_BOOL user_function(OtkWidget* widget, int x, int y); Parameters: widget Return: OTK_TRUE CK1 SDK Programmer’s Reference Manual Pointer of the specified OtkCustomPopupMenu instance Pointer of the specified OtkCustomPopupMenu instance that is set as opp’s active submenu Pointer of the specified OtkCustomPopupMenu instance...
Pointer of the OtkPopupMenu instance Pointer of the OtkPopupMenu instance Pointer of the OtkMenuItem instance that is added Pointer of the OtkPopupMenu instance X coordinate to show the OtkPopupMenu Y coordinate to show the OtkPopupMenu CK1 SDK Programmer’s Reference Manual...
OtkCustomPopupMenu* owner); Parameters: opp owner Return: None CK1 SDK Programmer’s Reference Manual Pointer of the OtkPopupMenu instance Pointer of the OtkPopupMenu instance Pointer of the function that is called when the OnPopup event occurs Pointer of the OtkPopupMenu instance...
(OTK_WIDGET(&btn), 30, 50); otk_widget_set_gc_background_color (OTK_WIDGET(&btn), OTK_COL_WHITE); otk_widget_set_gc_foreground_color (OTK_WIDGET(&btn), OTK_COL_BLACK); otk_control_add_child (&contr1, OTK_WIDGET(&btn)); Pointer of the OtkPopupMenu instance Pointer of the submenu instance that is shown X coordinate to show the submenu Y coordinate to show the submenu CK1 SDK Programmer’s Reference Manual...
Defines the identifier used to distinguish the checkable group. Defines the label of the menu item. Pointer of the specified menu item Pointer of the specified menu item Pointer of the label string Length of the label string CK1 SDK Programmer’s Reference Manual...
GR_BITMAP* icon, OtkWidgetCallback on_clicked,OTK_BOOL cascade, otkCustomPopupMenu* submenu); Parameters: omp label labelsize CK1 SDK Programmer’s Reference Manual Pointer of the specified menu item Enabled state (OTK_TRUE or OTK_FALSE) Pointer of the specified menu item Checked state Pointer of the specified menu item...
Pointer of the specified menu item Pointer of the callback function Pointer of the specified menu item Value of the height to be set Pointer of the specified menu item Value of the width to be set CK1 SDK Programmer’s Reference Manual...
Purpose: Occur when you click the menu item. Prototype: OTK_BOOL user_function(OtkWidget* widget_ptr, int x, int Parameters: widget_ptr Return: OTK_TRUE always CK1 SDK Programmer’s Reference Manual Pointer of the specified menu item Foreground color to be set Background color to be set Pointer of the specified menuitem...
Graphical User Interface. This chapter covers these topics: • General API • Window API • Graphics API • Events API • Fonts API • Pointer API • Colors API • Regions API • Selections API • Miscellaneous API CK1 SDK Programmer’s Reference Manual...
Window API The name of this API is: window — Synopsis GR_WINDOW_ID GrNewWindow GR_WINDOW_ID GrNewPixmap GR_WINDOW_ID GrNewInputWindow CK1 SDK Programmer’s Reference Manual GrGetScreenInfo Pointer to a GR_SCREEN_INFO structure Function to call to handle error events GrDefaultErrorHandler (GR_WINDOW_ID parent, GR_COORD x,...
GR_COLOR background, GR_COLOR bordercolor); Identification of the parent window X coordinate of the new window relative to the parent window Y coordinate of the new window relative to the parent window Width of the new window CK1 SDK Programmer’s Reference Manual...
GR_WINDOW_ID GrNewInputWindow Parameters: parent width height Return: Identification of the newly created window CK1 SDK Programmer’s Reference Manual Height of the new window Width of the window border Color of the window background Color of the window border Width of the pixmap...
Identification of the window to map GrUnmapWindow Identification of the window to unmap GrRaiseWindow Identification of the window to raise GrLowerWindow Identification of the window to lower CK1 SDK Programmer’s Reference Manual (GR_WINDOW_ID wid); (GR_WINDOW_ID wid); (GR_WINDOW_ID wid); (GR_WINDOW_ID wid); (GR_WINDOW_ID wid);...
Syntax: void Parameters: wid infoptr CK1 SDK Programmer’s Reference Manual GrMoveWindow Identification of the window to move X coordinate to move the window to relative to its parent Y coordinate to move the window to relative to its parent...
Identification of the window to retrieve the WM properties of Pointer to a GR_WM_PROPERTIES structure to fill in GrSetFocus Identification of the window to set the focus GrSetBorderColor CK1 SDK Programmer’s Reference Manual (GR_WINDOW_ID wid, GR_WM_PROPERTIES *props); (GR_WINDOW_ID wid, GR_WM_PROPERTIES *props);...
Syntax: void Parameter: wid CK1 SDK Programmer’s Reference Manual Identification of the window to set the border color Color for the border GrSetBackgroundPixmap Identification of the window to set the background...
Identification of the graphics context to use when drawing the point X coordinate to draw the point at relative to the drawable Y coordinate to draw the point at relative to the drawable CK1 SDK Programmer’s Reference Manual (GR_GC_ID gc); (GR_DRAW_ID id, GR_GC_ID gc,...
Purpose: Draw a filled rectangle of the specified dimensions and position on the specified drawable using the specified graphics context. Syntax: void Parameters: id CK1 SDK Programmer’s Reference Manual GrPoints Identification of the drawable to draw a point on Identification of the graphics context to use when drawing the point...
Identification of the drawable to draw the polygon on Identification of the graphics context to use when drawing the polygon Number of points in the point array CK1 SDK Programmer’s Reference Manual (GR_DRAW_ID id, GR_GC_ID gc, GR_COUNT count, GR_POINT *pointtable);...
Purpose: Draw an arc with the specified dimensions at the specified position on the specified drawable using the specified graphics context. The type specifies the fill type. Possible values include GR_ARC and GR_PIE. Syntax: void CK1 SDK Programmer’s Reference Manual GrEllipse GrFillEllipse GrArc Chapter 5 — Nano-X APIs...
X coordinate to draw the arc at relative to the drawable Y coordinate to draw the arc at relative to the drawable Radius of the arc on the X axis CK1 SDK Programmer’s Reference Manual GR_COORD y, GR_SIZE rx, GR_SIZE ry,...
Purpose: Change the drawing mode (SET, XOR, OR, AND, etc.) of the specified graphics context to the specified mode. Syntax: void CK1 SDK Programmer’s Reference Manual Radius of the arc on the Y axis Angle of the start of the arc Angle of the end of the arc...
Pointer to the variable the width will be returned in Pointer to the variable the height will be returned in Pointer to the variable the baseline height will be returned in CK1 SDK Programmer’s Reference Manual (GR_GC_ID gc, GR_FONT_ID font);...
Format of the pixel data CK1 SDK Programmer’s Reference Manual GrReadArea Identification of the drawable to read an area from X coordinate to read the area from relative to the drawable Y coordinate to read the area from relative to the drawable...
Y coordinate to copy the area from within the source drawable ROP codes to pass to the blitter when performing the copy GrBitmap Identification of the drawable to draw the bitmap on CK1 SDK Programmer’s Reference Manual (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x,...
Syntax: void CK1 SDK Programmer’s Reference Manual Identification of the graphics context to use when drawing the bitmap X coordinate to draw the bitmap at relative to the drawable...
String containing the file name of the image to load Flags specific to the particular image loader GrDrawImageToFit Identification of the drawable to draw the image on CK1 SDK Programmer’s Reference Manual (char *path, int flags); (GR_DRAW_ID id, GR_GC_ID gc,...
ASCII encoding and baseline alignment. Syntax: void Parameters: id CK1 SDK Programmer’s Reference Manual Identification of the graphics context to use when drawing the image X coordinate to draw the image at relative to the drawable Y coordinate to draw the image at relative to the drawable...
Y coordinate of the end of the line relative to the drawable GrLines Identification of the drawable to draw the line on Identification of the graphics context to use when drawing the line CK1 SDK Programmer’s Reference Manual (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x1, GR_COORD y1,...
Purpose: Select the event types that should be returned for the specified window. Syntax: void Parameters: wid eventmask CK1 SDK Programmer’s Reference Manual Number of lines contained in the line table Points for each dash Spacing for every dash; 0 for solid lines GrDrawLines...
Purpose: Get the next event from the event queue and places it in the specified GR_EVENT structure. If the queue is currently empty, the CK1 sleeps until the next event arrives from the server or input is read on a file descriptor previously specified by GrRegisterInput().
Syntax: GR_FONT_ID Parameters: name height plogfont Returns: Font identification number that you can use to refer to the font CK1 SDK Programmer’s Reference Manual (GR_CHAR *name, GR_COORD height, GR_LOGFONT *plogfont); (GR_FONT_ID fontid, GR_COORD size); (GR_FONT_ID fontid, int tenthsdegrees);...
Amount of rotation in tenths of a degree GrSetFontAttr Identification of the font that you want to change GrDestroyFont Identification of the font to destroy CK1 SDK Programmer’s Reference Manual (GR_FONT_ID fontid, GR_COORD size); (GR_FONT_ID fontid, int tenthsdegrees); (GR_FONT_ID fontid, int setflags, int clrflags);...
Points in the bitmap that have neither the foreground or background bits set are not painted. Syntax: void CK1 SDK Programmer’s Reference Manual GrGetFontInfo Pointer to a GR_FONT_INFO structure GrFontSetCFontSize Identification number of the font that you want to change...
Pointer to the bitmap data specifying the foreground of the pointer Pointer to the bitmap data specifying the background of the pointer GrMoveCursor GrInjectPointerEvent CK1 SDK Programmer’s Reference Manual GR_SIZE width, GR_SIZE height, GR_COORD hotx, GR_COORD hoty, GR_COLOR foreground, GR_COLOR background, GR_BITMAP *fbbitmap, GR_BITMAP *bgbitmap);...
The values before the specified first value are not set. Syntax: void Parameters: first CK1 SDK Programmer’s Reference Manual X coordinate of the pointer event relevant to the root window Y coordinate of the pointer event relevant to the root window Pointer button status Whether to display the pointer after the event (GR_PALETTE *pal);...
GrUnionRegion () Purpose: Make a union of the specified source regions and places the result in the specified destination region. Syntax: void CK1 SDK Programmer’s Reference Manual GR_COORD y, GR_COORD w, GR_COORD h); (GR_REGION_ID region); (GR_REGION_ID rgn1, GR_REGION_ID rgn2);...
Identification of the destination region GrSubtractRegion Identification of the destination region GrXorRegion Identification of the destination region GrIntersectRegion Identification of the destination region CK1 SDK Programmer’s Reference Manual (GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1, GR_REGION_ID src_rgn2); (GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1, GR_REGION_ID src_rgn2);...
Parameters: region the identification of the region to examine Return: GR_RECT_PARTIN If it is partially contained within the region GR_RECT_ALLIN GR_RECT_OUT CK1 SDK Programmer’s Reference Manual GrSetGCRegion Identification of the graphics context to set the clip mask to. GrPointInRegion X coordinate of the point to test for...
Identification of the region to offset Distance to offset the region by in the X axis Distance to offset the region by in the Y axis GrGetRegionBox Pointer to a rectangle structure CK1 SDK Programmer’s Reference Manual (GR_REGION_ID region); (GR_REGION_ID rgn1, GR_REGION_ID rgn2); (GR_REGION_ID region, GR_SIZE dx, GR_SIZE dy);...
At least one type must be specified unless you are disowning the selection (typically text/plain for plain ASCII text or text/uri-list for a filename). CK1 SDK Programmer’s Reference Manual GR_POLY_WINDING) (GR_WINDOW_ID wid, GR_CHAR *typelist);...
Syntax: void GrSetSelectionOwner Identification of the window to set the selection owner to Pointer used to return the list of available mime types GrRequestClientData CK1 SDK Programmer’s Reference Manual (GR_WINDOW_ID wid, GR_CHAR *typelist); (GR_CHAR **typelist); (GR_WINDOW_ID wid, GR_WINDOW_ID rid, GR_SERIALNO serial,...
GrReqShmCmds void GrInjectKeyboardEvent void GrRegisterInput CK1 SDK Programmer’s Reference Manual Identification of the window requesting the data Identification of the window to request the data from Serial number of the request GrSendClientData Identification of the window sending the data...
Apart from the initial allocation of the area using this call, the use of shared memory is completely transparent. Additionally, if the allocation fails, the CK1 silently and automatically falls back on socket communication. It is safe to call this function even if shared memory support is not compiled;...
Syntax: void Parameters: rfdset Pointer to the file descriptor set to monitor fncb CK1 SDK Programmer’s Reference Manual 32-bit Unicode keystroke value to inject 8-bit ASCII keystroke value to inject Special keys to inject Mask specifying which arguments are valid...
Identification of the window to send the event to or 0 Type of window manager event GrInjectKeypadEvent Identification of the window to send the event to, or 0 Buttons of changed pressed buttons Buttons that changed CK1 SDK Programmer’s Reference Manual (void); (GR_TIMEOUT timeout); (GR_WINDOW_ID wid, int type, int status);...
Parameters: sMappingFile GrSetKeyboardMappingDefault() Purpose: Set the entire keyboard mapping to default settings. Syntax: void CK1 SDK Programmer’s Reference Manual GrSelectPadKeys Identification of the window to select keys Pad keys to accept GrSetTriggerEnabled Enable or disable the Scan button GrSetKeyMapping (GR_KEYMAPPING new_mapping);...
Parameters: cp the code page number to translate Return: Pointer to a character string that relates to the code page GrSetCodepage (GR_CODEPAGE codepage); Codepage number refers to GR_CODEPAGE enumeration GrGetCurrentCodepage GrTranslateCodepageToName CK1 SDK Programmer’s Reference Manual (void); (GR_CODEPAGE cp);...
• Introducing the µClinux system • Linux kernel • µClinux • µClinux on the CK1 • GUI system on the CK1 • Developing applications under the µClinux system • Supported libraries • Device configuration files CK1 SDK Programmer’s Reference Manual...
Appendix A — Clinux System Introducing the µClinux System This appendix is an overview of the CK1 µClinux system. The barrier between the CK1 embedded operating system and the general purpose system is becoming more blurred as embedded devices are evolving to meet the market’s requirements.
The advantages that the general purpose Linux offers can also be found from the CK1 embedded µClinux. The open nature of Linux provides for quick modifications against the physical requirements, while still providing a reliable and standardized base system for the developers. The Linux community also provides a variety of freely available open source applications, which can also be used with the CK1 embedded µClinux...
Page 316
This action starts the high-level environment initialization by creating the first process 0 to set up the Kernel mode stack setup. The function also initializes the interrupt CK1 SDK Programmer’s Reference Manual...
The microkernel version also tends to have more complex structure than in monolithic ones. Monolithic Kernel Versus Microkernel CK1 SDK Programmer’s Reference Manual Hardware Operating System...
Each different process can act as if it is the only process on the computer, with exclusive use of main memory and other hardware resources. The processes in monolithic systems are also written in such CK1 SDK Programmer’s Reference Manual...
Page 319
The static real-time processes are always with higher priority than the dynamic ones so the scheduler starts running the processes with dynamic priorities only when there is no real-time process in running state. CK1 SDK Programmer’s Reference Manual...
Interprocess Communication Processes in Linux communicate with each other and with the kernel via a mechanism called interprocess communication (IPC). It enables the process to send and receive messages from other processes, share memory CK1 SDK Programmer’s Reference Manual...
Page 321
It supports the three kinds of different mechanisms: message queues, semaphores, and shared memory, which are all implemented via the kernel system call. The user mode process can access these system calls by passing a unique identifier to the resource, which is CK1 SDK Programmer’s Reference Manual...
Page 322
Shared memory allows one or more processes to access a common data structure by placing them into a memory segment shared by all of them. The pages of the shared memory are referenced by page table entries in CK1 SDK Programmer’s Reference Manual...
Although this functionality reduces a little of the overhead, the over all time beaten is rather small. In Linux the kernel threads are used in a very limited way to execute a few kernel functions. CK1 SDK Programmer’s Reference Manual...
Linux source tree denotes directory names containing information about the files beneath it. Usually Linux contains at least directories for executable programs (./bin), directory for physical devices (./dev), a directory for configuration files (./etc), and a specific directory for libraries (./lib). CK1 SDK Programmer’s Reference Manual...
Internet protocol (IP) being at the heart of it. When an application generates network traffic, it sends packets through the socket layers to a transport layer (TCP or UDP), which forwards them to the IP layer. In CK1 SDK Programmer’s Reference Manual...
Page 326
Linux supports several different socket domains with the most common UNIX for internal and INET for BSD Socket INET Socket Ethernet CK1 SDK Programmer’s Reference Manual Kernel...
The MMU-less is a quite common factor for low-cost microprocessors, where component prices are crucial. This part of the work explains the general scope of µClinux. CK1 SDK Programmer’s Reference Manual µ Appendix A — Clinux System...
In general µClibc tries to provide a glibc like library, which also means that most documentation written for functions in glibc also apply to µClibc functions. It also can be compiled as a shared CK1 SDK Programmer’s Reference Manual...
Configuration for setting up the µClinux files system. It is used to drive the vendor configuration. ROM based file system structure. It includes user application binaries and device nodes and been created after the compilation. CK1 SDK Programmer’s Reference Manual...
Page 331
µClinux platform. With bad software design, you can completely freeze an MMU-less processor. CK1 SDK Programmer’s Reference Manual Description Vendor specific build instructions. It includes subdirectories for all the support platforms.
The first step is to modify the file Boards.mk under the /arch/PROCESSOR_TYPE folder, in the CK1 case the armnommu. This file includes the definitions for platforms and boards and needs the following lines.
The linker and loader locate the application and install it to the system memory space in such a way that they can work from the place that they are installed in. CK1 SDK Programmer’s Reference Manual Appendix A — Description A collection of binary tools (ld, as, etc.).
Page 334
• ELF header, which gives an information about the file • Program header, which is part of the execution view • Section headers and contents of the file, which are part of the linking view • Data CK1 SDK Programmer’s Reference Manual...
This is called a relocation constant, which equals the starting address of the object. The actual relocation process is transparent to the user program. CK1 SDK Programmer’s Reference Manual µ Appendix A —...
Page 336
The disadvantages of XIP is that compression cannot be used. If the data is in compressed format, it cannot be used directly in place. CK1 SDK Programmer’s Reference Manual...
/.../uClinux-dist/tools/cksum -b -o 2 /.../uClinux-dist/images/image.bin >>/.../uClinux-dist/images/image.bin The image is then placed in the image folder, which eventually also contains the file system image and other files that are created in the process. CK1 SDK Programmer’s Reference Manual µ Appendix A — Clinux System...
With this solution, the footprint of the Flash is considerably smaller compared to the image by itself. -rw-r--r-- 1 root root 1.6M Oct 16 19:06 image.bin -rw-r--r-- 1 root root 712k Oct 16 19:06 image.bin.gz CK1 SDK Programmer’s Reference Manual...
Page 339
To finalize the boot process, the µClinux runs the rc script, which contains the commands that need to be run for the device to work. The script normally mounts the necessary file systems and assigns the network addresses. CK1 SDK Programmer’s Reference Manual...
Communications AB. The CRAMFS was originally developed by Linus Torvalds and was added to the kernel source of the 2.4 series. It was designed to be a simple read-only file system that uses compression in each CK1 SDK Programmer’s Reference Manual...
Page 341
The changes to the files may make part of the used space obsolete. These dirty spaces are then marked for the JFFS garbage collector to be recycled. CK1 SDK Programmer’s Reference Manual...
Page 342
At the time, five full erase blocks are required in order to perform a new write for the user space. The compression that the JFFS2 uses also causes unnecessary overhead to files that are already compressed. CK1 SDK Programmer’s Reference Manual...
The process created by this system call shares all of its memory space including the stack. To prevent the parent from overriding the data needed by the child process, the parent is suspended until the child exists. CK1 SDK Programmer’s Reference Manual µ Appendix A — Clinux System...
RAM in order for the process to run by the illusion that they have all the physical memory available although some of their pages are stored away and retrieved again when needed. In µClinux this method is not possible CK1 SDK Programmer’s Reference Manual...
The community also releases the latest µClibc version through the µClinux support pages. The distribution also evolves to provide support for new MMU-less microprocessor architectures as they appear. CK1 SDK Programmer’s Reference Manual µ Appendix A — Clinux System...
MMU-less processors. µClinux on the CK1 The µClinux on the CK1 is from the µClinux source tree version 2.4.19 customized for deeply embedded products, aimed to be compatible with general purpose Linux. The problem with Linux is that it is quite complex.
Page 347
The CK1 provides 1MB NOR Flash, 8MB NAND Flash, and 16MB of SDRAM. The CK1 also adds additional TI TL16C550 full RS232 chip and barcode decoder chip. These chips are configured to use a 16-bit wide bus. The system layout is shown in the following illustration.
µ Appendix A — Clinux System CK1 Memory Mapping The memory mapping of the CK1 is described in the following illustration. 1Mbyte NOR FLASH 576K Free FONT Flash Writer 192K DIAGNOSTIC BIOS Boot Loader Size, Layout, and Position of Memory The NOR Flash stores the Bootloader, BIOS, Diagnostic Program, and Flash Writer programs.
Program and Flash Writer are copied to SDRAM to execute. The following illustration shows the flow that links these programs. The following illustration also shows a flow chart of a cold boot. CK1 SDK Programmer’s Reference Manual Blocks 401 … 431 User configuration 432 …...
Page 350
9 EXIT check battery cover & battery value press "f1", then press "3" to keep ramdisk keep ramdisk enter check PC BIOS TAB key Boot kernel CK1 SDK Programmer’s Reference Manual DRAM & Run) enter BIOS command mode...
CK1. To send commands to the CK1 from a PC, connect the serial dock to the PC and place the CK1 in the dock. For help, see the CK1 Serial Dock Quick Start Guide (P/N 073772).
After checking the above status, if it does not go to any other application or Menu mode, the CK1 enters stop until you press the Power key. And then the BIOS is executed if the battery voltage is safe and the battery shell is closed.
The boot command boots the device from the source. The only supported source is ROM in the CK1 since there is no Ethernet or other device in the CK1. The sysconf command does the configure process. The actions are set, manualset, view, and clear.
The gdbserver is a user application that is included and compiled to run on the CK1. It provides user application debugging with features similar to GDB-stub. To the host machine, it communicates through a ptrace call.
RAMdisk does not get lost during warm boot. The mount point for the file system is /var, but the CK1 µClinux also has the /tmp directory in the root connected via a symbolic link to point to the /var/tmp.
JFFS2 file system periodically. Kernel Block Drivers In the CK1, the RAM disk is mounted at the boot to the /var folder. Another common file system in the CK1 µClinux is the blkmem driver, which is the oldest driver and specially designed for µClinux. It supports only a few different Flash devices as well as the root file systems in RAM.
Mode Normal Idle Slow Suspend For 1050 mA battery, the CK1 could last for 13 hours during normal scanning operation. The following illustration shows how the CK1 moves through the modes of power management. CK1 SDK Programmer’s Reference Manual Speed...
Page 358
0.) devApmIdle() called No user actions after IdleTime Idle No user actions called after StandbyTime Suspend CK1 SDK Programmer’s Reference Manual User actions BackLight Off No user actions after BackLightOffTime devApmStandby() called No user actions after StandbyTime...
Flash. GUI System on the CK1 Because the processors in the CK1 only run in 66MHz, the CK1 has its own widget, the October or OTK widget, which could be superior in performance in simpler microprocessors. The OTK widget set is similar in use to the GTK toolkit.
Clinux System Configuration of Nano-X includes free type font and bmp support. Regarding font support, the font directory of free type font in the CK1 is /home/fonts. To use the downloaded fonts, for example a.ttf, calling GrCreateFont(“FT,a”, 12, NULL) or GrCreateFont(“a”, 12, NULL) has the a.ttf loaded to the server, and an application can use it.
The Nano-X version that the CK1 uses is microwindows-0.87. For more information, see Chapter 5, “Nano-X APIs.” GDBM Database Library The GDBM is supported by CK1. For the detail description, please refer to http://www.mit.edu:8001/afs/athena.mit.edu/project/gnu/doc/html /gdbm_toc.html. The following content introduces the database named GDBM, which is included in the Esfia embedded Linux package.
This is the options of PPP daemon. The PAP secret file of PPP dial-up. Stop and Start PPP scripts. Add remarks to resolve.conf. Current PPP connect type. PPP configuration files of null modem client/server and Modem client/server. CK1 SDK Programmer’s Reference Manual...
Page 363
CK1 SDK Programmer’s Reference Manual µ Appendix A — Clinux System Description Host resolve files to mapping hostnames with IP address. The init table of current. The init table of starting PPP or console getty.
All these files are generated by the keyboard remapping program. After the files are generated users can download the new configuration files to this place. Description The keyboard mapping file. The definition of lock mode. The definition of stripped keys. CK1 SDK Programmer’s Reference Manual...
Page 382
10 information on open project, 13 opening, 8 removing files from, 9 running, 11 running on a CK1, 11 running on a PC, 10 testing, 10 Project menu adding source file, 7 removing files from a project, 9...
Page 383
280 point, testing if in, 279 polygon, 281 rectangle, testing if in, 279 subtracting, 278 union with rectangle, 277 CK1 SDK Programmer’s Reference Manual with region, 277 registering event timeout, 136 fd_input, 140 file descriptor, 285 remote upgrade, 332...
Need help?
Do you have a question about the CK1 and is the answer not in the manual?
Questions and answers