Intermec CK1 Programmer's Reference Manual

Intermec CK1 Programmer's Reference Manual

Intermec ck1: reference guide
Hide thumbs Also See for CK1:
Table of Contents

Advertisement

Programmer's
Reference Manual
CK1 SDK

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CK1 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Intermec CK1

  • Page 1 Programmer's Reference Manual CK1 SDK...
  • 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.
  • Page 3: Table Of Contents

    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 7 ...138 otk_app_get_font_size_info...139 otk_app_get_root_window_width...139 otk_app_get_root_window_height ...139 otk_app_exit...139 otk_app_set_title ...139 otk_app_set_showfamily ...140 otk_app_register_fd...140 OtkWidget ...140 otk_widget_init ...140 otk_widget_set_visible...140 otk_widget_set_sensitive...141 otk_widget_set_gc_background_color...141 otk_widget_set_gc_foreground_color ...141 otk_widget_set_gc_font_size ...142 otk_widget_set_gc_font...142 otk_widget_set_position...142 otk_widget_set_size ...142 otk_widget_set_user_data...143 otk_widget_get_user_data ...143 OtkArrowIcon ...143 otk_arrow_icon_init...143 otk_arrow_icon_set_align...143 CK1 SDK Programmer’s Reference Manual Contents...
  • Page 8 ...150 OtkControl ...150 otk_control_init ...150 otk_control_add_child ...150 otk_control_set_border_size ...150 otk_control_show...151 otk_control_hide ...151 otk_control_set_user_data...151 otk_control_get_user_data ...151 OtkDialog ...152 otk_dialog_init ...152 otk_dialog_show...152 otk_dialog_set_user_data...152 otk_dialog_get_user_data ...153 OtkGroup ...153 otk_group_init ...153 otk_group_append ...153 otk_group_remove ...153 otk_group_set_user_data...154 otk_group_get_user_data ...154 viii CK1 SDK Programmer’s Reference Manual...
  • Page 9 OnSelect Event...161 OnTimeout Event ...161 OtkPopupWindow...162 otk_popup_window_init ...162 otk_popup_window_show ...162 otk_popup_window_set_user_data...162 otk_popup_window_get_user_data ...163 OtkRadioGroup ...163 otk_radio_group_init ...163 otk_radio_group_append ...163 otk_radio_group_set_grab_item ...163 otk_radio_group_get_grab_item ...164 otk_radio_group_set_user_data...164 otk_radio_group_get_user_data ...164 OtkScrollList ...164 otk_scroll_list_init...164 otk_scroll_list_get_list ...165 otk_scroll_list_set_user_data ...165 otk_scroll_list_get_user_data...165 CK1 SDK Programmer’s Reference Manual Contents...
  • Page 10 ...172 otk_editable_set_maxlength...172 otk_editable_set_textptr ...173 otk_editable_set_popupmenu...173 otk_editable_show_popupmenu ...173 otk_editable_set_buffer ...173 otk_editable_load_from_file...174 otk_editable_get_sel_buffer ...174 otk_editable_get_text_buffer ...174 otk_editable_cut_to_clipboard ...175 otk_editable_copy_to_clipboard...175 otk_editable_paste_from_clipboard...175 otk_editable_clear_selection ...175 otk_editable_set_seltextbuf ...176 otk_editable_clear...176 otk_editable_select_all ...176 otk_editable_get_text_length...176 otk_editable_insert ...177 otk_editable_delete...177 otk_editable_calcursor ...177 otk_editable_next_cursorpos ...178 otk_editable_prev_cursorpos ...178 CK1 SDK Programmer’s Reference Manual...
  • Page 11 ...187 otk_entry_show ...187 otk_entry_hide ...187 otk_entry_refresh...187 OnReturnPress Event ...188 Example Code ...188 OtkMaskEdit...188 otk_maskedit_init...189 otk_maskedit_set_visible ...189 otk_maskedit_set_sensitive ...189 otk_maskedit_set_gc_background_color ...189 otk_maskedit_set_gc_foreground_color ...190 otk_maskedit_set_position ...190 otk_maskedit_set_size...190 otk_maskedit_set_parent ...190 otk_maskedit_set_prev_sibling ...191 otk_maskedit_set_next_sibling ...191 otk_maskedit_set_event_handler ...191 otk_maskedit_set_drawing_func...191 CK1 SDK Programmer’s Reference Manual Contents...
  • Page 12 ...199 otk_page_set_range ...200 otk_page_set_step...200 otk_page_show_value_ratio...200 otk_page_refresh...200 otk_page_set_max ...201 otk_page_set_min...201 otk_page_set_value...201 Example Code ...201 OtkRange ...203 otk_range_init ...203 otk_range_set_max ...203 otk_range_get_max ...203 otk_range_set_min ...204 otk_range_get_min...204 otk_range_set_value ...204 otk_range_get_value ...204 otk_range_set_range ...205 otk_range_get_range...205 otk_range_set_change_callback ...205 OnChange Event...206 CK1 SDK Programmer’s Reference Manual...
  • Page 13 ...216 otk_spin_refresh ...216 otk_spin_set_max...216 otk_spin_set_min ...217 otk_spin_set_value ...217 Example Code ...217 OtkSlider...219 otk_slider_init ...219 otk_slider_set_typeflag ...219 otk_slider_set_size ...219 otk_slider_set_position...220 otk_slider_set_range ...220 otk_slider_set_step ...220 otk_slider_refresh ...220 otk_slider_set_max ...221 otk_slider_set_min ...221 otk_slider_set_value...221 Example Code ...221 CK1 SDK Programmer’s Reference Manual Contents xiii...
  • Page 14 ...231 otk_custompopupmenu_set_on_popup ...231 otk_custompopupmenu_get_child_item ...231 otk_custompopupmenu_show...232 otk_custompopupmenu_hide ...232 otk_custompopupmenu_hide_all ...232 otk_custompopupmenu_set_active_submenu...232 otk_custompopupmenu_hide_submenu...233 otk_custompopupmenu_check_visible_chain_wid ...233 OnPopup Event ...233 OtkPopupMenu ...234 otk_popupmenu_init...234 otk_popupmenu_add_item ...234 otk_popupmenu_show ...234 otk_popupmenu_hide ...235 otk_popupmenu_set_on_popup...235 otk_popupmenu_set...235 otk_popupmenu_set_owner ...235 otk_popupmenu_show_submenu...236 Example Code ...236 CK1 SDK Programmer’s Reference Manual...
  • Page 15 GrLowerWindow ()...248 GrMoveWindow ()...249 GrResizeWindow () ...249 GrReparentWindow ()...249 GrGetWindowInfo () ...249 GrSetWMProperties () ...250 GrGetWMProperties () ...250 GrSetFocus () ...250 GrGetFocus () ...250 GrSetBorderColor ()...250 GrSetBackgroundPixmap ()...251 GrClearWindow () ...251 GrCloseWindow ()...251 GrKillWindow ()...252 CK1 SDK Programmer’s Reference Manual Contents...
  • Page 16 GrDashLine () ...268 GrLines ()...268 GrDrawLines () ...269 Events API...269 Synopsis...269 GrSelectEvents () ...269 GrGetNextEvent ()...270 GrGetNextEventTimeout () ...270 GrCheckNextEvent ()...270 GrPeekEvent ()...270 Fonts API ...271 Synopsis...271 GrCreateFont ()...271 GrSetFontSize ()...272 GrSetFontRotation () ...272 GrSetFontAttr ()...272 CK1 SDK Programmer’s Reference Manual...
  • Page 17 GrGetSelectionOwner ()...282 GrRequestClientData ()...282 GrSendClientData () ...283 Miscellaneous API ...283 Synopsis...283 GrReqShmCmds ()...284 GrInjectKeyboardEvent () ...284 GrRegisterInput () ...285 GrPrepareSelect ()...285 GrServiceSelect () ...285 GrBell () ...286 GrSetScreenSaverTimeout () ...286 GrInjectNanowmEvent ()...286 GrInjectKeypadEvent ()...286 CK1 SDK Programmer’s Reference Manual Contents xvii...
  • 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...
  • Page 20 Contents CK1 SDK Programmer’s Reference Manual...
  • Page 21: Before You Begin

    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.
  • Page 22: Safety Icons

    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.
  • Page 23: Who Should Read This Document

    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...
  • Page 25: Installing And Using The Sdk

    • 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...
  • Page 26: What Is The Sdk Target Wizard

    • 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.
  • Page 27: Running The Sdk Target Wizard

    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.
  • Page 28: Understanding The Menus

    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...
  • Page 29: Edit Region

    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...
  • Page 30: Creating A Source File

    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...
  • Page 31: Adding The Source File To The Project

    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...
  • Page 32: Editing A Project

    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...
  • Page 33: Removing Files From A Project

    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...
  • Page 34: Editing Files In A Project

    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.
  • Page 35: Debugging A 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.
  • Page 36: Downloading To A Ck1

    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.
  • Page 37: Other Tools

    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...
  • Page 38: Compile Result

    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...
  • Page 39: Icon Editor

    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.
  • Page 40: Keyboard Remapping

    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: •...
  • Page 42: Terminal

    • 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.
  • Page 43: Example Code

    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.
  • Page 44: Complete Example Code

    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...
  • Page 45 = GrNewGC(); GrSetGCBackground(gc, WHITE); GrSetGCForeground(gc, BLACK); while ( 1 ) GrGetNextEvent(&event); switch ( event.type ) case GR_EVENT_TYPE_CLOSE_REQ: break; case GR_EVENT_TYPE_EXPOSURE: GrRect(win, gc, 10, 20, 80, 20); GrText(win, gc, 15, 23, "Hello", 5, GR_TFASCII|GR_TFTOP); break; return 0; CK1 SDK Programmer’s Reference Manual...
  • Page 46 Chapter 1 — Installing and Using the SDK CK1 SDK Programmer’s Reference Manual...
  • Page 47: Configuring The Ck1 System

    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 •...
  • Page 48: Introducing 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...
  • Page 49: Scanning Options For The Ck1

    #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...
  • Page 50: Changing The Default Volume By Command Line Operation

    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.
  • Page 51: Changing The Volume By /Proc

    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...
  • Page 52 Chapter 2 — Configuring the CK1 System "D+", "F+", "G+", "A+"} ; //char Chr_Freq[NUM_cnt] = {'C', 'D', 'E', 'F', 'G', 'A', 'B', '1', '2', '3', '4', '5'} ; char Chr_Freq[NUM_cnt] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '='} ;...
  • Page 53 == playstr[i]) break; for(idxNum=0; idxNum<=NUM_cnt; idxNum++) if(Chr_Freq[idxNum] == chi) break; if(idxNum < NUM_cnt) printf("\t--------------> %s\n", Str_Freq[idxNum]); buzzer_config.freq = Num_Freq[idxNum] * frq_bias; CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System //// from 0 to NUM_cnt-1 is meanful...
  • Page 54 Chapter 2 — Configuring the CK1 System buzzer_config.length = 32 / len_bias ; buzzer_config.volume = 30 + vol_bias ; devBuzzerPlaySound((buzzer_config.freq), frq_bias = 1.0 ; len_bias = 1.0 ; return (buzzer_config.length * 2) ; int main(int argc,char *argv[]) int ReturnCode = 0,i,frq,length,volume,sysvolume;...
  • Page 55: Reading System Volume

    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...
  • Page 56: Setting System Volume

    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...
  • Page 57: Buzzer Application Apis

    * 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);...
  • Page 61 }else if(argc == 3){ if(strncmp(argv[1],"R",1)==0){ BuzzerAppDumpMsg = 0; RepeatTime = abs(atoi(argv[2])); }else if(strncmp(argv[1],"P",1)==0){ BuzzerAppDumpMsg = 1; RepeatTime = abs(atoi(argv[2])); }else{ PrintMsg(filename); return; CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System //adjust buzzer system volume first continue ;...
  • Page 62: Getting Buzzer Keyclick Status

    Chapter 2 — Configuring the CK1 System for(i=0; i<RepeatTime; i++) printf("\t***** Buzzer APP Test %d Times *****\n",i+1); for(j = 1; j <= BUZAPPITEMNUM; j++ ){ chi = '0' + j; #ifdef BUZ_APP_TEST_DEBUG printf("chi = %c\n",chi); #endif SelectOpt(chi); }else{ PrintMsg(filename); return;...
  • Page 63: Getting Buzzer Warning Status

    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...
  • Page 64: Setting Buzzer System-Prompt Status

    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.
  • Page 65: Example Code

    #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...
  • Page 66 Chapter 2 — Configuring the CK1 System #define LEDRTEST_DEBUG 1 #define LED_NUM #define MENUITEMS_NUM #define R_LED #define G_LED #define B_LED enum {OFF, ON}; char* ReadStatus[2] = { "-", "+" } ; char* IdentLEDStr[LED_NUM][2] = { { "Red", "r "}, { "Green", "g "},...
  • Page 67 Enter Delay Time\n"); scanf("%d",&sec); devLEDDelayOff(light, sec); break; case 's': case 'S': printf("\nRed ReadStatus[devLEDReadStatus(R_LED)]); printf("\nGreen LED status: %s", ReadStatus[devLEDReadStatus(G_LED)]); printf("\nBlue ReadStatus[devLEDReadStatus(B_LED)]); printf("\n"); break; default: break; CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System LED status: %s", LED status: %s",...
  • Page 68: Reading Light Status

    Chapter 2 — Configuring the CK1 System int main(int argc,char *argv[]) char chi ; //functional test PrintMenu(); while(((chi = getchar()) != 'q') && (chi != 'Q') ) if (chi == 10) continue ; SelOpt(chi); PrintMenu(); return 0; Reading Light Status Purpose: Get the specified light state.
  • Page 69: Delaying Turning On Light

    • 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...
  • Page 70: Changing The Default Brightness By Command Line Operation

    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;...
  • Page 73: Getting Lcd Status

    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",...
  • Page 74: Adjusting Brightness

    Chapter 2 — Configuring the CK1 System Setting Brightness (continued) On-CK1 Parameters: SetValue On-CK1 Return: -1 Function failed Function succeeded On-Host Parameters: None On-Host Return: Always return 0 Adjusting Brightness Purpose: Adjust the brightness of a specified LCD/LCM device for temporary test.
  • Page 75: Turning Off The Lcd

    • 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...
  • Page 76: Changing The Apm Function By Command Line Operation

    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.
  • Page 77: Changing The Apm Function By /Proc

    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 >...
  • Page 78: Example Codes

    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 81 "); scanf("%d", &valueSetting); devApmSetBackupBatteryVeryLow(valueSetting); printf("Set Backup battery low limit(%%) ? (y/n)"); Ans = getc(stdin); }while((Ans != 'y')&&(Ans != 'n')); if( Ans == 'y'){ printf("insert value: "); CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System...
  • 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...
  • Page 84: Enabling Apm

    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.
  • Page 85: Entering Idle Mode

    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”);...
  • Page 86: Enabling Backlight Control

    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:...
  • Page 87: Disabling Backlight Control

    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...
  • Page 88: Setting Backlight Timeout

    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.
  • Page 89: Setting Standby Time

    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.
  • Page 90: Setting Main Battery Low Limit

    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.
  • Page 91: Setting Main Battery Critical 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.
  • Page 92: Setting Backup Battery Low 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.
  • Page 93: Making Sure Apm Is Working

    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:...
  • Page 94: Getting Idle Time

    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.
  • Page 95: Getting Backup Battery Life

    ) On-CK1 Parameters: None On-CK1 Return: -1 Function failed Otherwise return the percentage of power low limit setting value. On-Host Parameters: None On-Host Return: Always return 0 CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System...
  • Page 96: Getting Main Battery Very Low Limit

    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.
  • Page 97: Getting Backup Battery Low Limit

    ) 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...
  • Page 98: Getting Ac Line Status

    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.
  • Page 99: Getting Adc Value From The Main Battery Only Once

    ( void ) On-CK1 Parameters: None On-CK1 Return: None 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 Unit resolution 5 mV, 800 units is 4 volts.
  • Page 100: Getting All Apm Information

    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.
  • Page 101: Example Code

    %s\n", PPPConfig->PPPPassword); printf("usepeerdns %d\n", PPPConfig->UsePeerDNS); printf("usepeerdefaultroute %d\n", PPPConfig->UsePeerDefaultRoute); printf("host addr %s\n", PPPConfig->HostAddr); printf("peer addr %s\n", PPPConfig->PeerAddr); printf("mute %d\n", PPPConfig->Mute); static void PrintPPPConfig(int ConnectType, struct structPPPConfig CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System in advance. <eslib_ppp.h> release...
  • Page 102 Chapter 2 — Configuring the CK1 System *PPPConfig) printf("\n-- PPP Configuration --\n"); printf("Connect Type = %d\n",ConnectType); printf("Mute = %d\n",PPPConfig->Mute); printf("ARP Proxy Support = %d\n",PPPConfig->ARPProxySupport); printf("USE Peer DNS = %d\n",PPPConfig->UsePeerDNS); printf("Use Peer Default Route = %d\n",PPPConfig->UsePeerDefaultRoute); printf("Host Addr = %s\n",PPPConfig->HostAddr); printf("Peer Addr = %s\n",PPPConfig->PeerAddr);...
  • Page 103 (WritePPPCurrentType(ConnectType)) printf("fail to write file pppconf.current\n"); else printf("current ppp Connect Mode = %d\n",ReadPPPCurrentType()); break; case 'q' case 'Q' : Choice = 0; break; default : printf("\nWrong selection\n"); CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System...
  • Page 104: Ppp Api Illustrations

    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.
  • Page 106: Writing Ppp Configuration Files

    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;...
  • Page 109: Reading Ppp Configuration Files

    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”...
  • Page 110: Resetting Ppp

    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.
  • Page 111: Rtc Alarm Api

    "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.
  • Page 113: Enabling The Alarm Function

    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)
  • Page 114: Getting The Alarm Value

    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...
  • Page 115: Remote Upgrade

    • 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.
  • Page 116: Remote Upgrade

    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...
  • Page 120 Chapter 2 — Configuring the CK1 System version = (char *) RUGetVersion(argv[1]); if(strncmp(argv[2], vendor, strlen(vendor)-1) != 0) { printf("vendor check error %s, %s\n", argv[2], vendor); return 1; if(strncmp(argv[3], product, strlen(product)-1) != 0) { printf("product check error %s, %s\n", argv[3], product);...
  • Page 121 = (char *) RUGetVendor(“kernel”); product = (char *) RUGetProduct(“kernel”); version = (char *) RUGetVersion(“kernel”); if (strcmp(argv[0], vendor) != 0) { printf(“Vendor isn’t same, failed\n”); CK1 SDK Programmer’s Reference Manual Chapter 2 — Configuring the CK1 System char *vendor, *product, *version; vendor = NULL;...
  • Page 122: Remote Upgrade Apis

    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.
  • Page 127: System Configuration Setting

    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");...
  • Page 129: Getting The Current Setting Of The Boot Flag

    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...
  • Page 130: Getting The Version Of The Images On Nor Flash

    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.
  • Page 131: Getting The Current Setting Of Ramdisk Size

    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...
  • Page 133: Scanner Support

    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 •...
  • Page 134: Introducing Scanner Support

    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...
  • Page 135: Function Structure

    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;...
  • Page 136: Guideline For The Apis

    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...
  • Page 137: Scanning By Pressing Scan Button

    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 138 0x48 Fix Length 0x49 Check Digit 0x4a Minimum Length 0x4b Maximum Length 0x4c 0x4d Enable 0x4e Send Leading Character 0x4f Send Trailing Character 0x50 0x51 Enable 0x52 Charset 0x53 0x54 Enable 0x55 0x56 Func1 0x57 CK1 SDK Programmer’s Reference Manual...
  • Page 139 Bar Code Setting Type Code for Hamster Chip (continued) Bar Code Type Code 128 MSI Plessey Code 93 Code 11 Codabar Label UPC A CK1 SDK Programmer’s Reference Manual Chapter 3 — Scanner Support Command Code Number Enable 0x58 Minimum Length 0x59 Maximum Length...
  • Page 140 0x85 Send Check Digit 0x86 0x87 Enable Supplement Two 0x88 Enable Supplement Five 0x89 Transmit MH 0x8a 0x8b 0x8c Enable 0x8d Calculate Check Digit 0x8e Send Check Digit 0x8f Get Version 0x90 Dump Setting 0x91 CK1 SDK Programmer’s Reference Manual...
  • 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...
  • Page 144 Check digit module 10 1 ∼ 64 0x5F Default = 1 1 ∼ 64 0x60 Default = 64 Type Status Action 0x61 Disable Enable 1 ∼ 48 0x62 Default = 1 1 ∼ 48 0x63 Default = 48 CK1 SDK Programmer’s Reference Manual...
  • Page 145 Code 11 maximum length Codabar Hamster Setting Status Parameters Codabar all settings Codabar Codabar SS Codabar check digit Codabar CLSI format CK1 SDK Programmer’s Reference Manual Chapter 3 — Scanner Support Type Status Action 0x64 Bit0 = 0 Disable Bit0 = 1...
  • Page 146 Bit2 = 0 Send check digit Bit2 = 1 Do not send check digit 0x75 Disable Enable 0x76 Send leading digit Do not send leading digit 0x77 Send check digit Do not send check digit CK1 SDK Programmer’s Reference Manual...
  • Page 147 UPC E NSC EAN 13 Hamster Setting Status Parameters EAN 13 all settings EAN 13 EAN 13 leading digit EAN 13 check digit CK1 SDK Programmer’s Reference Manual Chapter 3 — Scanner Support Type Status Action 0x78 Bit0 = 0...
  • Page 148 Bit1 = 1 Enable supplement five Bit2 = 0 Transmit if present Bit2 = 1 Must present 0x88 Disable Enable 0x89 Disable Enable 0x8A Transmit if present Must present 0x8B Space separator inserted No insert CK1 SDK Programmer’s Reference Manual...
  • Page 149: Getting The Settings

    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...
  • Page 150: Disabling Trigger

    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...
  • Page 151: Getting Bar Code Symbology Setting From Decoder Chip

    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...
  • Page 152: Setting Postamble String

    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...
  • Page 153: Starting Scanning

    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...
  • Page 154: Example Code

    } TFmBarcodeReader; static int Hamster_Handle = -1; static void TFmBarcodeReaderCreate(TFmBarcodeReader*); static TFmBarcodeReader fmBarcodeReader; #undef ENABLE_NLS #ifdef ENABLE_NLS #define _(x) gettext(x); #else #define _(x) (x) #endif #define N_(x) (x) static OtkWidgetEventHandler prev_handler = NULL; CK1 SDK Programmer’s Reference Manual...
  • Page 155 OtkWidget *fmMain = OTK_WIDGET(&fmBarcodeReader.cntlMain); otk_app_init(160, 142); otk_app_set_title("Barcode"); Hamster_Handle = ScOpen(); if (Hamster_Handle<0) printf("Initialize hamster failed.\n"); else otk_app_register_fd(Hamster_Handle, OnScanned); CK1 SDK Programmer’s Reference Manual Chapter 3 — Scanner Support...
  • Page 156 OTK_TRUE); otk_widget_set_position(OTK_WIDGET(&self->lblType), 10, 20); otk_widget_set_size(OTK_WIDGET(&self->lblType), 140, 20); otk_label_set_value(&self->lblType, "Type:"); otk_group_append(OTK_GROUP(&self->cntlMain), OTK_WIDGET(&self->lblType)); otk_label_set_align(&self->lblType, OTK_ALIGN_LEFT); otk_entry_init(&self->edtBarcode); otk_entry_set_visible(&self->edtBarcode, OTK_TRUE); otk_entry_set_sensitive(&self->edtBarcode, OTK_TRUE); otk_entry_set_readonly(&self->edtBarcode, OTK_FALSE); otk_group_append(OTK_GROUP(&self->cntlMain), OTK_WIDGET(&self- >edtBarcode)); otk_entry_set_position(&self->edtBarcode, 10, 40); otk_entry_set_size(&self->edtBarcode, 140, 20); self->cntlMain.ancestor.node.grab = OTK_WIDGET(&self->edtBarcode); otk_app_add(&self->cntlMain); CK1 SDK Programmer’s Reference Manual...
  • Page 157: Sdk Components

    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 •...
  • Page 158: Introducing The October Widget Library

    +--OtkControl +--OtkPopupWindow +--OtkCustomPopupMenu +--OtkPopupMenu +--OtkDialog +--OtkRadioGroup +--OtkTabGroup +--OtkScrollList +--OtkArrowIcon +--OtkCheckButton +--OtkIcon +--OtkTab +--OtkToggleButton +--OtkCombo +--OtkPage +--OtkScrollBar +--OtkScrollBar2 +--OtkSlider +--OtkSpin +--OtkSelection +--OtkSelection2 +--OtkEntry +--OtkMaskEdit CK1 SDK Programmer’s Reference Manual...
  • Page 159: Otk_App_Init

    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...
  • Page 160: Otk_App_Redraw

    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...
  • Page 161: Otk_App_Set_Window_Background_Color

    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.
  • Page 162: Otk_App_Get_Gc_User_Defined

    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...
  • Page 163: Otk_App_Get_Font_Size_Info

    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();...
  • Page 164: Otk_App_Set_Showfamily

    (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...
  • Page 165: Otk_Widget_Set_Sensitive

    (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...
  • Page 166: Otk_Widget_Set_Gc_Font_Size

    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...
  • Page 167: Otk_Widget_Set_User_Data

    (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 —...
  • Page 168: Otkbutton

    (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...
  • Page 169: Otk_Button_Set_User_Data

    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...
  • Page 170: Otk_Cell_Box_Init

    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...
  • Page 171: Otk_Cell_Box_Get_Selected_Row

    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 —...
  • Page 172: Otk_Check_Button_Set_Value

    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...
  • Page 173: Otkcombo

    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...
  • Page 174: Otk_Combo_Get_User_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...
  • Page 175: Otk_Control_Show

    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...
  • Page 176: Otkdialog

    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...
  • Page 177: Otk_Dialog_Get_User_Data

    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 —...
  • Page 178: Otk_Group_Set_User_Data

    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...
  • Page 179: Otk_Icon_Set_User_Data

    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...
  • Page 180: Otk_List_Set_Scrollbar

    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...
  • Page 181: Otk_List_Set_Column_Titles

    (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.
  • Page 182: Otk_List_New_Item

    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...
  • Page 183: Otk_List_Set_Text_And_Bitmap

    (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...
  • Page 184: Otk_List_Remove_Row

    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...
  • Page 185: Otk_List_Set_User_Data

    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...
  • Page 186: Otkpopupwindow

    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...
  • Page 187: Otk_Popup_Window_Get_User_Data

    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...
  • Page 188: Otk_Radio_Group_Get_Grab_Item

    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...
  • Page 189: Otk_Scroll_List_Get_List

    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 —...
  • Page 190: Otk_Tab_Set_Label

    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...
  • Page 191: Otk_Toggle_Button_Init

    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 —...
  • Page 192: Otkeditable

    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...
  • Page 193: Otk_Editable_Init

    (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...
  • Page 194: Otk_Editable_Set_Prev_Sibling

    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...
  • Page 195: Otk_Editable_Set_Flag

    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...
  • Page 196: Otk_Editable_Set_Modified

    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...
  • Page 197: Otk_Editable_Set_Textptr

    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...
  • Page 198: Otk_Editable_Load_From_File

    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...
  • Page 199: Otk_Editable_Cut_To_Clipboard

    (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...
  • Page 200: Otk_Editable_Set_Seltextbuf

    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...
  • Page 201: Otk_Editable_Insert

    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...
  • Page 202: Otk_Editable_Next_Cursorpos

    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...
  • Page 203: Otk_Entry_Init

    (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...
  • Page 204: Otk_Entry_Set_Gc_Foreground_Color

    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...
  • Page 205: Otk_Entry_Set_Prev_Sibling

    (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...
  • Page 206: Otk_Entry_Set_Flag

    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...
  • Page 207: Otk_Entry_Set_Autoset

    (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...
  • Page 208: Otk_Entry_Set_Focused

    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...
  • Page 209: Otk_Entry_Cut_To_Clipboard

    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...
  • Page 210: Otk_Entry_Clear

    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...
  • Page 211: Otk_Entry_Set_Pswdmode

    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...
  • Page 212: Onreturnpress Event

    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.
  • Page 213: Otk_Maskedit_Init

    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...
  • Page 214: Otk_Maskedit_Set_Gc_Foreground_Color

    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...
  • Page 215: Otk_Maskedit_Set_Prev_Sibling

    (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...
  • Page 216: Otk_Maskedit_Set_Flag

    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...
  • Page 217: Otk_Maskedit_Set_Color

    (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...
  • Page 218: Otk_Maskedit_Set_Focused

    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...
  • Page 219: Otk_Maskedit_Cut_To_Clipboard

    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...
  • Page 220: Otk_Maskedit_Clear

    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...
  • Page 221: Otk_Maskedit_Set_Font_Size

    Purpose: Redraw the specified mask edit. Prototype: void otk_maskedit_refresh(OtkMaskEdit* oep); Parameter: oep Return: None CK1 SDK Programmer’s Reference Manual Pointer of the specified mask edit instance Font size Pointer of the specified mask edit instance Pointer of the specified mask edit instance Pointer of the specified mask edit instance Chapter 4 —...
  • Page 222: Otk_Maskedit_Set_Mask

    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...
  • Page 223: Otkpage

    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...
  • Page 224: Otk_Page_Set_Range

    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...
  • Page 225: Otk_Page_Set_Max

    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...
  • Page 227: Otkrange

    (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).
  • Page 228: Otk_Range_Set_Min

    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...
  • Page 229: Otk_Range_Set_Range

    *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...
  • Page 230: Onchange Event

    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...
  • Page 231: Otk_Scrollbar_Set_Size

    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...
  • Page 232: Otk_Scrollbar_Refresh

    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...
  • Page 233: Example Code

    100, 0, 70); otk_scrollbar_set_step(&scrollbar2, 10); otk_control_add_child (&contr1, OTK_WIDGET(&scrollbar2)); otk_scrollbar_refresh (&scrollbar2); //otk_widget_set_visible(OTK_WIDGET(&scrollbar2), enable_tog.value); otk_range_set_change_callback (OTK_RANGE(&scrollbar2), range_callback); //enable_tog otk_toggle_button_init (&enable_tog); otk_button_set_label (OTK_BUTTON(&enable_tog), "Enable"); otk_widget_set_size (OTK_WIDGET(&enable_tog), 60, 15); CK1 SDK Programmer’s Reference Manual Chapter 4 — SDK Components //VERTICAL_SCROLLBAR = 0, //VERTICAL_SCROLLBAR = 0,...
  • Page 234: Otkscrollbar2

    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...
  • Page 235: Otk_Scrollbar2_Set_Typeflag

    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...
  • Page 236: Otk_Scrollbar2_Set_Step

    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...
  • Page 237: Otk_Scrollbar2_Set_Value

    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...
  • Page 239: Otkspin

    (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...
  • Page 240: Otk_Spin_Set_Position

    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...
  • Page 241: Otk_Spin_Set_Min

    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...
  • Page 243: Otkslider

    (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...
  • Page 244: Otk_Slider_Set_Position

    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...
  • Page 245: Otk_Slider_Set_Max

    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...
  • Page 246 (OTK_WIDGET(&enable_tog), OTK_COL_BLACK); otk_control_add_child (&contr1, OTK_WIDGET(&enable_tog)); otk_toggle_button_set_value(&enable_tog, OTK_FALSE); otk_button_set_click_callback(OTK_BUTTON(&enable_tog), togglebutton_callback); printf("RUN loop\n"); return otk_app_loop(); OTK_BOOL range_callback (OtkWidget* sb, int x, int y) OtkRange* range = OTK_RANGE(sb); printf("__________range value______%d_______\n", range->value); //VERTICAL_SLIDER = 1, //VERTICAL_SLIDER = 1, CK1 SDK Programmer’s Reference Manual...
  • Page 247: Otkselection

    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 —...
  • Page 248: Otk_Selection_Set_Label_Number

    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...
  • Page 249: Example Code

    (OTK_BUTTON(&enable_tog), "Enable"); otk_widget_set_size (OTK_WIDGET(&enable_tog), 60, 15); otk_widget_set_position(OTK_WIDGET(&enable_tog), 0, 0); otk_widget_set_gc_background_color (OTK_WIDGET(&enable_tog), OTK_COL_WHITE); otk_widget_set_gc_foreground_color (OTK_WIDGET(&enable_tog), OTK_COL_BLACK); otk_control_add_child (&contr1, OTK_WIDGET(&enable_tog)); otk_toggle_button_set_value(&enable_tog, OTK_FALSE); otk_button_set_click_callback(OTK_BUTTON(&enable_tog), togglebutton_callback); printf("RUN loop\n"); return otk_app_loop(); CK1 SDK Programmer’s Reference Manual Pointer of the OtkSelection instance Chapter 4 — SDK Components...
  • Page 250: Otkselection2

    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...
  • Page 251: Otk_Selection2_Set_Position

    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...
  • Page 252: Otk_Selection2_Refresh

    (&selection2, 3); otk_control_add_child (&contr1, OTK_WIDGET(&selection2)); otk_selection2_refresh (&selection2); otk_range_set_change_callback (OTK_RANGE(&selection2), range_callback); otk_widget_set_sensitive(OTK_WIDGET(&selection2), enable_tog.value); //enable_tog otk_toggle_button_init (&enable_tog); otk_button_set_label (OTK_BUTTON(&enable_tog), "Enable"); otk_widget_set_size (OTK_WIDGET(&enable_tog), 60, 15); otk_widget_set_position(OTK_WIDGET(&enable_tog), 0, 0); otk_widget_set_gc_background_color (OTK_WIDGET(&enable_tog), OTK_COL_WHITE); otk_widget_set_gc_foreground_color (OTK_WIDGET(&enable_tog), OTK_COL_BLACK); Pointer of the OtkSelection2 instance CK1 SDK Programmer’s Reference Manual...
  • Page 253: Otktabgroup

    Purpose: Append to the specified OtkTabGroup a page (OtkTab widget). Prototype: void otk_tab_group_append(OtkTabGroup* tabgrp, OtkTab* tab); Parameters: tabgrp Return: None CK1 SDK Programmer’s Reference Manual Pointer to the real instance Specified OtkTabgroup widget Specified OtkTab widget Chapter 4 — SDK Components...
  • Page 254: Otk_Tab_Group_Set_Tab_Button_Size

    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...
  • Page 255: Otk_Custompopupmenu_Add_Item

    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...
  • Page 256: Otk_Custompopupmenu_Show

    * 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...
  • Page 257: Otk_Custompopupmenu_Hide_Submenu

    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...
  • Page 258: Otkpopupmenu

    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...
  • Page 259: Otk_Popupmenu_Hide

    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...
  • Page 260: Otk_Popupmenu_Show_Submenu

    (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...
  • Page 261 (&popupmenu2, &mi2[0]); otk_menuitem_init(&mi2[1]); otk_menuitem_set(&mi2[1], "SubItem1",8, NULL,NULL,OTK_FALSE, NULL); otk_popupmenu_add_item (&popupmenu2, &mi2[1]); otk_menuitem_init(&mi2[2]); otk_menuitem_set(&mi2[2], "SubItem2",8, NULL,NULL,OTK_FALSE, NULL); otk_popupmenu_add_item (&popupmenu2, &mi2[2]); return otk_app_loop(); OTK_BOOL button_callback (OtkWidget* widget, int x, int y) otk_popupmenu_show(&popupmenu1,10,10); return OTK_TRUE; CK1 SDK Programmer’s Reference Manual Chapter 4 — SDK Components...
  • Page 262: Otkmenuitem

    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...
  • Page 263: Otk_Menuitem_Set_Enabled

    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...
  • Page 264: Otk_Menuitem_Set_Clicked_Callback

    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...
  • Page 265: Otk_Menuitem_Set_Color

    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...
  • Page 266 Chapter 4 — SDK Components CK1 SDK Programmer’s Reference Manual...
  • Page 267: Nano-X Apis

    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...
  • Page 268: General Api

    GrRegisterInput(). Currently never returns. Syntax: void Parameter: fncb (void); (void); (void); (GR_FNCALLBACKEVENT fncb); (GR_SCREEN_INFO *sip); (GR_FNCALLBACKEVENT fncb); (GR_EVENT *ep); GrFlush GrOpen If succeeded If failed GrClose GrMainLoop (GR_FNCALLBACKEVENT fncb); CK1 SDK Programmer’s Reference Manual (void); (void); (void);...
  • Page 269: Grgetscreeninfo ()

    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,...
  • Page 270: Grnewwindow ()

    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...
  • Page 271: Grnewpixmap ()

    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...
  • Page 272: Grdestroywindow ()

    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);...
  • Page 273: Grmovewindow ()

    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...
  • Page 274: Grsetwmproperties ()

    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);...
  • Page 275: Grsetbackgroundpixmap ()

    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...
  • Page 276: Grkillwindow ()

    (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height); (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height); (GR_DRAW_ID id, GR_GC_ID gc, GR_COUNT count, GR_POINT *pointtable); (GR_DRAW_ID id, CK1 SDK Programmer’s Reference Manual (GR_WINDOW_ID wid);...
  • Page 277 GrSetGCBackground void GrSetGCUseBackground void GrSetGCMode void GrSetGCFont void GrGetGCTextSize void GrReadArea CK1 SDK Programmer’s Reference Manual Chapter 5 — Nano-X APIs GR_GC_ID gc, GR_COUNT count, GR_POINT *pointtable); (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_SIZE rx, GR_SIZE ry); (GR_DRAW_ID id,...
  • Page 278 GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height, GR_IMAGE_ID imageid); (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, GR_IMAGE_HDR *pimage); (GR_DRAW_ID id, GR_GC_ID gc, GR_COORD x, GR_COORD y, void *str, GR_COUNT count, int flags); (GR_DRAW_ID id, CK1 SDK Programmer’s Reference Manual...
  • Page 279: Grnewgc ()

    GrGetGCInfo () Purpose: Fill in the specified GR_GC_INFO structure with information regarding the specified graphics context. Syntax: void Parameters: gc gcip CK1 SDK Programmer’s Reference Manual GR_GC_ID gc, GR_COORD x1, GR_COORD y1, GR_COORD x2, GR_COORD y2 (GR_DRAW_ID id, GR_GC_ID gc,...
  • Page 280: Grdestroygc ()

    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,...
  • Page 281: Grrect ()

    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...
  • Page 282: Grpoly ()

    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);...
  • Page 283: Grellipse ()

    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...
  • Page 284: Grarcangle ()

    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,...
  • Page 285: Grsetgcforeground ()

    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...
  • Page 286: Grsetgcfont ()

    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);...
  • Page 287: Grarea ()

    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...
  • Page 288: Grcopyarea ()

    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,...
  • Page 289: Grfreeimage ()

    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...
  • Page 290: Grloadimagefromfile ()

    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,...
  • Page 291: Grdrawimagebits ()

    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...
  • Page 292: Grdashline ()

    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,...
  • Page 293: Grdrawlines ()

    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...
  • Page 294: Grgetnextevent ()

    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().
  • Page 295: Fonts Api

    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);...
  • Page 296: Grsetfontsize ()

    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);...
  • Page 297: Grfontsetcfontsize ()

    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...
  • Page 298: Grmovecursor ()

    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);...
  • Page 299: Colors Api

    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);...
  • Page 300: Grfindcolor ()

    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); (GR_REGION_ID dst_rgn, GR_REGION_ID src_rgn1, GR_REGION_ID src_rgn2); (GR_GC_ID gc, GR_REGION_ID region); (GR_REGION_ID region, GR_COORD x, GR_COORD y); (GR_REGION_ID region, GR_COORD x, CK1 SDK Programmer’s Reference Manual (GR_COLOR c, GR_PIXELVAL *retpixel); (int index);...
  • Page 301: Grnewregion ()

    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);...
  • Page 302: Grsubtractregion ()

    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);...
  • Page 303: Grsetgcregion ()

    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...
  • Page 304: Gremptyregion ()

    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);...
  • Page 305: Grnewpolygonregion ()

    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);...
  • Page 306: Grgetselectionowner ()

    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,...
  • Page 307: Grsendclientdata ()

    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...
  • Page 308: Grreqshmcmds ()

    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;...
  • Page 309: Grregisterinput ()

    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...
  • Page 310: Grbell ()

    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);...
  • Page 311: Grsettriggerenabled()

    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);...
  • Page 312: Grsetcodepage()

    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);...
  • Page 313: Μclinux System

    • 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...
  • Page 314: Introducing The Μclinux System

    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.
  • Page 315: Linux Kernel

    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...
  • Page 317: General Purpose Linux Kernel Architecture

    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...
  • Page 318: Processes

    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...
  • Page 320: Reentrant Kernel

    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...
  • Page 323: Threads Under Linux

    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...
  • Page 324: Memory Management In General Purpose Linux

    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...
  • Page 325: Networking Interface

    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...
  • Page 327: Device Drivers

    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...
  • Page 328: History Of Μclinux

    This is done in the folder /nommu, which replaces CK1 SDK Programmer’s Reference Manual...
  • Page 329: Μclinux Libraries

    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...
  • Page 330: Source Tree

    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.
  • Page 332: Hardware Dependency Under The Μclinux

    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.
  • Page 333: Runtime Linker And Loader

    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...
  • Page 335: Flat File Relocations

    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...
  • Page 337: Creating The Image

    /.../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...
  • Page 338: Booting The Device

    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...
  • Page 340: Root File System

    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...
  • Page 343: Kernel Block Drivers

    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...
  • Page 344: Memory Management

    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...
  • Page 345: User Applications

    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...
  • Page 346: Μclinux On The Ck1

    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.
  • Page 348: Ck1 Memory Mapping

    µ 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.
  • Page 349: Programs In Nor Flash

    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...
  • Page 351: Bootloader

    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).
  • Page 352: Bios

    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.
  • Page 353: Diagnostic Program

    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.
  • Page 354: Kernel Initialization For Ck1

    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.
  • Page 355: Serial Flash File System

    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.
  • Page 356: Kernel Block Drivers

    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.
  • Page 357: Character Fonts

    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...
  • Page 359: Mounted Partitions

    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.
  • Page 360: Developing Applications Under The Μclinux System

    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.
  • Page 361: Supported Libraries

    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.
  • Page 362: Fetch

    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.
  • Page 364: Home/Etc

    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 365: Index

    Index CK1 SDK Programmer’s Reference Manual...
  • Page 366 144 auto set property, 171 entry, 183 mask edit, 193 background color bitmaps, drawing, 261 entry, 179 graphics context, 261 mask edit, 189 setting, 137 setting window to, 251 text, drawing, 261 widget, setting, 141 CK1 SDK Programmer’s Reference Manual...
  • Page 367 ADC value, 75 critical limit getting, 72 setting, 67 good limit getting, 71 setting, 65 life, getting main, 70 CK1 SDK Programmer’s Reference Manual low limit getting, 71 setting, 66 power level, getting, 75 states, described, 52 very low limit getting, 72...
  • Page 368 175 cutting region to, 175 entry cutting from, 185 pasting to, 185 mask edit cutting to, 195 pasting to, 195 pasting from, 175 selection setting to window, 281 CLOSE_REQ, sending to window, 251 CK1 SDK Programmer’s Reference Manual...
  • Page 369 52 brightness, changing, 46 volume, changing, 26 sending to CK1, 18 common properties CK1 SDK Programmer’s Reference Manual editable instance, 171 entry, 182 mask edit, 192 menu item, 239 compile result area, SDK, 5, 14...
  • Page 370 239 trigger, 126 disconnecting window client, 252 display height, retrieving, 139 width, retrieving, 139 double-byte font size, 273 downloading, project to CK1, 12 drag and drop data, 282 drawing arc, 259, 260 bitmap data, 264 dash line, 268 ellipse...
  • Page 371 173 position, setting, 169 read-only property, 172 replacing text with buffer content, 176 sibling next, setting, 170 previous, setting, 170 CK1 SDK Programmer’s Reference Manual widgets, setting, 171 size, setting, 169 text content, 174 file, 174 property, 173 editing...
  • Page 372 138 CK1 support, 333 default font identification, 138 double-byte, changing size, 273 entry, size, 186 filling in information, 272 freeing and unloading, 272 locating, 138, 271 mask edit, size, 197 CK1 SDK Programmer’s Reference Manual...
  • Page 373 268 mode, drawing, 261 monochrome bitmap data, 264 pixel array, drawing, 263 pixel data, reading, 262 point, drawing, 256 CK1 SDK Programmer’s Reference Manual points, drawing, 256 polygon boundary, 258 filled, 258 rectangle boundary, drawing, 257...
  • Page 374 GrText (), 267 GRUB, 292 GrUnionRectWithRegion (), 277 GrUnionRegion (), 277 GrUnmapWindow (), 248 GrXorRegion (), 278 GUI system on CK1, 335 Hamster chip bar code setting type code, 113 type number, 112 codabar setting status, 121 Code 11 setting status, 121...
  • Page 375 152 inserting text in editable instance, 177 installing the SDK, 2 interprocess communication, 297 intersection, calculating region, 278 CK1 SDK Programmer’s Reference Manual IP address getting host, 99 setting host, 99 JFFS/JFFS2, 316 journaling flash file system, 317...
  • Page 376 197 initializing, 189 inserting text at cursor, 196 length, maximum, 194 marking content in buffer, 196 mask, setting, 198 memory buffer, 194 modified property, 193 parent widget, 190 position, 190 read-only property, 193 redrawing, 197 CK1 SDK Programmer’s Reference Manual...
  • Page 377 274 specifying, 273 Hamster setting status, 120 setting type codes, 115 type number, 113 NAND flash, entering, 328 CK1 SDK Programmer’s Reference Manual nanown event, 286 nano-X server library, 337 October widgets, 134 talking with window manager, 286 networking system, 302...
  • Page 378 169 otk_editable_insert, 177 otk_editable_load_from_file, 174 otk_editable_next_cursorpos, 178 otk_editable_paste_from_clipboard, 175 otk_editable_prev_cursorpos, 178 otk_editable_select_all, 176 otk_editable_set, 171 otk_editable_set_autoset, 171 otk_editable_set_buffer, 173 otk_editable_set_drawing_func, 170 otk_editable_set_event_handler, 170 otk_editable_set_flag, 171 otk_editable_set_focused, 172 otk_editable_set_maxlength, 172 otk_editable_set_modified, 172 otk_editable_set_next_sibling, 170 otk_editable_set_parent, 169 CK1 SDK Programmer’s Reference Manual...
  • Page 379 154 otk_icon_get_user_data, 155 otk_icon_init, 154 otk_icon_set_bitmap, 154 otk_icon_set_user_data, 155 otk_list_et_user_data, 161 otk_list_get_item, 160 otk_list_get_selected, 160 otk_list_get_user_data, 161 CK1 SDK Programmer’s Reference Manual otk_list_init, 155 otk_list_item_set_bitmap, 158 otk_list_item_set_text, 158 otk_list_item_set_user_data, 159 otk_list_new_item, 158 otk_list_remove_all, 160 otk_list_remove_item, 159 otk_list_remove_row, 160 otk_list_remove_selected, 160...
  • Page 380 215 otk_spin_set_value, 217 otk_tab_add, 166 otk_tab_get_user_data, 166 otk_tab_group_append, 229 otk_tab_group_init, 229 otk_tab_group_set_tab_button_size, 230 otk_tab_group_set_user_data, 230 otk_tab_init, 165 otk_tab_set_label, 166 otk_tab_set_user_data, 166 otk_toggle_button_get_user_data, 167 otk_toggle_button_get_value, 167 otk_toggle_button_init, 167 otk_toggle_button_set_user_data, 167 otk_toggle_button_set_value, 167 otk_widget_get_user_data, 143 otk_widget_init, 140 CK1 SDK Programmer’s Reference Manual...
  • Page 381 275 setting, 275 parent changing, 249 editable instance, setting, 169 entry, 180 CK1 SDK Programmer’s Reference Manual input-only window, 247 linking all child widgets with same, 153 mask edit, setting, 190 new window, 246 pointer NULL, 153 OtkControl, 150...
  • 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...
  • Page 384 180 widget, setting, 142 slider current value, 221 maximum value, 221 minimum value, 221 orientation, 219 position, 220 range, 220 redrawing, 220 size, 219 step value, 220 slow mode, 333 sound getting warning status, 39 CK1 SDK Programmer’s Reference Manual...
  • Page 385 275 setting, 275 prompt getting status, 39 setting, 40 requirements, 2 V IPC, 298 CK1 SDK Programmer’s Reference Manual tab buttons, size, 230 target wizard, SDK, See also SDK appearance, 3 described, 2 installing, 2 running, 3 Telepen...
  • Page 386 32 setting system, 32 waiting for alarm, 90 warning getting buzzer status, 39 setting buzzer, 39 widgets background color, 141 base class for declaring edit, 168 entry sibling, 182 font identification number, 142 size, 142 CK1 SDK Programmer’s Reference Manual...
  • Page 387 284, 286 focus getting, 250 setting, 250 mapping, 248 moving, 249 nanown event, 286 CK1 SDK Programmer’s Reference Manual OtkControl mapping, 151 size, setting, 150 unmapping, 151 OtkDialog, mapping, 152 OtkPopupWindow, mapping, 162 pad keys, selecting, 286...
  • Page 388 Index CK1 SDK Programmer’s Reference Manual...
  • Page 390 Corporate Headquarters 6001 36th Avenue West Everett, Washington 98203 U.S.A. tel 425.348.2600 fax 425.355.9551 www.intermec.com CK1 SDK Programmer's Reference Manual *073771-001* P/N 073771-001...

Table of Contents