Intermec CK1 Serial Dock Programmer's Reference Manual

Type
Programmer's Reference Manual
CK1 SDK
Programmer's
Reference Manual
ii CK1 SDK Programmer’s Reference Manual
Intermec Technologies Corporation
Corporate Headquarters
6001 36th Ave. W.
Everett, WA 98203
U.S.A.
www.intermec.com
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.
Information and specifications contained in this document are subject to change without prior notice and do
not represent a commitment on the part of Intermec Technologies Corporation.
© 2004 by Intermec Technologies Corporation. All rights reserved.
The word Intermec, the Intermec logo, Norand, ArciTech, CrossBar, Data Collection Browser, dcBrowser,
Duratherm, EasyCoder, EasyLAN, Enterprise Wireless LAN, EZBuilder, Fingerprint, i-gistics, INCA (under
license), InterDriver, Intermec Printer Network Manager, IRL, JANUS, LabelShop, Mobile Framework,
MobileLAN, Nor*Ware, Pen*Key, Precision Print, PrintSet, RoutePower, TE 2000, Trakker Antares, UAP,
Universal Access Point, and Virtual Wedge are either trademarks or registered trademarks of Intermec
Technologies Corporation.
Throughout this manual, trademarked names may be used. Rather than put a trademark (™ or ®) symbol in
every occurrence of a trademarked name, we state that we are using the names only in an editorial fashion,
and to the benefit of the trademark owner, with no intention of infringement.
There are U.S. and foreign patents pending.
Contents
CK1 SDK Programmer’s Reference Manual
iii
Contents
Before You Begin.............................................................................................................xxi
Safety Summary..................................................................................................xxi
Safety Icons .......................................................................................................xxii
Global Services and Support..............................................................................xxii
Who Should Read This Document? .................................................................xxiii
Related Documents ..........................................................................................xxiii
Installing and Using the SDK................................................................................................ 1
What Is the SDK Target Wizard? .......................................................................................2
Development Process Flow ....................................................................................2
Installing the SDK Target Wizard .........................................................................2
Running the SDK Target Wizard ..........................................................................3
SDK Appearance ................................................................................................................3
Understanding the Menus .....................................................................................4
Toolbar .................................................................................................................4
Project, Classes, and Debug Tabs ..........................................................................4
Edit Region ...........................................................................................................5
Status Bar ..............................................................................................................5
Compile Result Area..............................................................................................5
Creating a New Project.......................................................................................................5
Creating a Source File............................................................................................6
Adding the Source File to the Project.....................................................................7
Editing a Project.................................................................................................................8
Opening a Project..................................................................................................8
Removing Files From a Project ..............................................................................9
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
Icon Editor ..........................................................................................................15
Keyboard Remapping ..........................................................................................16
Terminal..............................................................................................................18
1
Contents
iv
CK1 SDK Programmer’s Reference Manual
Example Code ..................................................................................................................19
Designing the Basic UI........................................................................................19
Complete Example Code.....................................................................................20
Configuring the CK1 System .............................................................................................. 23
Introducing the CK1 ........................................................................................................24
Scanning Options for the CK1 .........................................................................................25
System APIs......................................................................................................................25
Buzzer APIs .........................................................................................................25
Changing the Default Volume by Command Line Operation ................26
Changing the Volume by /proc...............................................................27
Example Code ........................................................................................27
Reading System Volume.........................................................................31
Adjusting System Volume.......................................................................31
Setting System Volume...........................................................................32
Restoring System Volume.......................................................................32
Playing Sound ........................................................................................32
Buzzer Application APIs ......................................................................................33
Example Code ........................................................................................33
Getting Buzzer Keyclick Status ...............................................................38
Setting Buzzer Keyclick Status ................................................................38
Getting Buzzer Warning Status ..............................................................39
Setting Buzzer Warning Status................................................................39
Getting Buzzer System-Prompt Status ....................................................39
Setting Buzzer System-Prompt Status .....................................................40
Light APIs ...........................................................................................................40
Changing the Light Status by /proc ........................................................40
Example Code ........................................................................................41
Reading Light Status...............................................................................44
Setting Light...........................................................................................44
Delaying Turning On Light ...................................................................45
Delaying Turning Off Light ...................................................................45
Liquid Crystal Display APIs ................................................................................45
Changing the Default Brightness by Command Line Operation.............46
Changing the Brightness by /proc...........................................................46
Example Code ........................................................................................46
Getting LCD Status................................................................................49
Setting Brightness...................................................................................49
Adjusting Brightness...............................................................................50
Restoring Brightness...............................................................................50
Turning On the LCD.............................................................................50
Turning Off the LCD ............................................................................51
Turning On the Backlight ......................................................................51
Turning Off the Backlight......................................................................51
Advanced Power Management APIs ....................................................................51
Changing the APM Function by Command Line Operation..................52
Changing the APM Function by /proc ...................................................53
Example Codes.......................................................................................54
Enabling APM........................................................................................60
2
Contents
CK1 SDK Programmer’s Reference Manual
v
Disabling APM.......................................................................................60
Entering Normal Mode ..........................................................................60
Entering Idle Mode ................................................................................61
Entering Standby Mode..........................................................................61
Enabling Backlight Control....................................................................62
Disabling Backlight Control...................................................................63
Getting Status of Backlight Control........................................................63
Enabling EXT5V Output.......................................................................63
Disabling the EXT5V Output ................................................................63
Setting Backlight Timeout......................................................................64
Setting Idle Time....................................................................................64
Setting Standby Time .............................................................................65
Setting Main Battery Good Limit...........................................................65
Setting Main Battery Low Limit .............................................................66
Setting Main Battery Very Low Limit.....................................................66
Setting Main Battery Critical Limit ........................................................67
Setting Backup Battery Good Limit........................................................67
Setting Backup Battery Low Limit..........................................................68
Setting Backup Battery Very Low Limit .................................................68
Setting Backup Battery Critical Limit .....................................................68
Making Sure APM Is Working ...............................................................69
Getting Backlight Timeout.....................................................................69
Getting Idle Time...................................................................................70
Getting Standby Time............................................................................70
Getting Main Battery Life.......................................................................70
Getting Backup Battery Life ...................................................................71
Getting Main Battery Good Limit..........................................................71
Getting Main Battery Low Limit ............................................................71
Getting Main Battery Very Low Limit....................................................72
Getting Main Battery Critical Limit .......................................................72
Getting Backup Battery Good Limit.......................................................72
Getting Backup Battery Low Limit.........................................................73
Getting Backup Battery Very Low Limit ................................................73
Getting Backup Battery Critical Limit....................................................73
Getting AC Line Status...........................................................................74
Getting APM Status ...............................................................................74
Setting BIOS Resume Voltage ................................................................74
Getting ADC Value From the Main Battery Only Once ........................75
Getting the Main Battery Power Level....................................................75
Restoring APM Factory Default Values ..................................................75
Getting All APM Information ................................................................76
Backup File.............................................................................................76
PPP API ..............................................................................................................76
Example Code ........................................................................................77
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
Contents
vi
CK1 SDK Programmer’s Reference Manual
Disabling the Alarm Function ................................................................89
Getting the Alarm Value.........................................................................90
Waiting for the Alarm Arrival.................................................................90
Remote Upgrade..................................................................................................91
Connecting the CK1 to a PC..................................................................91
Remote Upgrade.....................................................................................92
Remote Upgrade APIs ............................................................................98
System Configuration Setting ............................................................................103
Example Code ......................................................................................103
Getting the Current Setting of the Boot Flag........................................105
Setting a New Boot Flag .......................................................................105
Getting the Current Setting of the Vendor Name.................................105
Getting the Product Name ...................................................................105
Getting the Version of the Images on NOR Flash.................................106
Getting the Current Setting of the Vendor Serial..................................106
Getting the Current Setting of the Var Serial........................................106
Getting the Current Setting of RAMdisk Size.......................................107
Setting New RAMdisk Size...................................................................107
Scanner Support...................................................................................................................... 109
Introducing Scanner Support..........................................................................................110
General Functions ..........................................................................................................110
Opening ............................................................................................................110
Closing ..............................................................................................................110
Getting Bar Code Type Name...........................................................................110
Function Structure..........................................................................................................111
Guideline for the APIs ....................................................................................................112
Bar Code Scanning Program..............................................................................112
Scanning by Pressing Scan Button ........................................................113
Scanning Under Program Control........................................................113
Bar Code Parameter Setting Program ................................................................113
Getting the Settings ..............................................................................125
Setting the Settings ...............................................................................125
Member Functions of TPT.............................................................................................125
Enabling Trigger................................................................................................125
Disabling Trigger ..............................................................................................126
Checking Bar Code Input..................................................................................126
Reading Bar Code Data.....................................................................................126
Setting Bar Code Symbology Into Decoder Chip ..............................................126
Getting Bar Code Symbology Setting From Decoder Chip................................127
Resetting All Symbologies to Default.................................................................127
Setting Preamble String .....................................................................................127
Getting Preamble String ....................................................................................127
Setting Postamble String....................................................................................128
Getting Postamble String...................................................................................128
Setting Delimiter String.....................................................................................128
Getting Delimiter String....................................................................................128
3
Contents
CK1 SDK Programmer’s Reference Manual
vii
Stopping Scanning.............................................................................................128
Starting Scanning ..............................................................................................129
Getting Current Setting Array ...........................................................................129
Example Code ................................................................................................................130
Scanning Bar Code Labels .................................................................................130
SDK Components .................................................................................................................... 133
Introducing the October Widget Library........................................................................134
OtkApplication...............................................................................................................134
otk_app_init......................................................................................................135
otk_app_loop ....................................................................................................135
otk_app_add......................................................................................................135
otk_app_remove................................................................................................135
otk_app_redraw.................................................................................................136
otk_app_get_current_event ...............................................................................136
otk_app_set_event_timeout...............................................................................136
otk_app_unset_event_timeout...........................................................................136
otk_app_new_window ......................................................................................136
otk_app_set_window_background_color ..........................................................137
otk_app_set_window_border_size .....................................................................137
otk_app_get_gc .................................................................................................137
otk_app_get_gc_user_defined ...........................................................................138
otk_app_new_font ............................................................................................138
otk_app_get_font_default..................................................................................138
otk_app_set_font_default ..................................................................................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
4
Contents
viii
CK1 SDK Programmer’s Reference Manual
OtkButton......................................................................................................................144
otk_button_init.................................................................................................144
otk_button_set_label .........................................................................................144
otk_button_set_click_callback...........................................................................144
otk_button_set_user_data..................................................................................145
otk_button_get_user_data .................................................................................145
OnClick Event ..................................................................................................145
OtkCellBox ....................................................................................................................145
otk_cell_box_init...............................................................................................146
otk_cell_box_set_cells .......................................................................................146
otk_cell_box_clear_selected ...............................................................................146
otk_cell_box_get_selected_column....................................................................146
otk_cell_box_get_selected_row..........................................................................147
otk_cell_box_set_user_data ...............................................................................147
otk_cell_box_get_user_data...............................................................................147
OtkCheckButton............................................................................................................147
otk_check_button_init ......................................................................................147
otk_check_button_set_value..............................................................................148
otk_check_button_get_value .............................................................................148
otk_check_button_set_user_data.......................................................................148
otk_check_button_get_user_data ......................................................................148
OtkCombo.....................................................................................................................149
otk_combo_init.................................................................................................149
otk_combo_get_list ...........................................................................................149
otk_combo_add_list_item .................................................................................149
otk_combo_set_user_data .................................................................................149
otk_combo_get_user_data.................................................................................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
Contents
CK1 SDK Programmer’s Reference Manual
ix
OtkIcon..........................................................................................................................154
otk_icon_init.....................................................................................................154
otk_icon_set_bitmap .........................................................................................154
otk_icon_set_user_data .....................................................................................155
otk_icon_get_user_data.....................................................................................155
OtkList...........................................................................................................................155
otk_list_init.......................................................................................................155
otk_list_set_scrollbar .........................................................................................156
otk_list_set_select_callback................................................................................156
otk_list_set_timeout_callback............................................................................156
otk_list_set_title_visible.....................................................................................156
otk_list_set_column_titles .................................................................................157
otk_list_set_column_title ..................................................................................157
otk_list_set_column_align.................................................................................157
otk_list_set_column_width ...............................................................................157
otk_list_new_item .............................................................................................158
otk_list_item_set_text........................................................................................158
otk_list_item_set_bitmap ..................................................................................158
otk_list_set_text_and_bitmap............................................................................159
otk_list_item_set_user_data...............................................................................159
otk_list_remove_item ........................................................................................159
otk_list_remove_row .........................................................................................160
otk_list_remove_selected ...................................................................................160
otk_list_remove_all ...........................................................................................160
otk_list_get_selected..........................................................................................160
otk_list_get_item...............................................................................................160
otk_list_set_user_data........................................................................................161
otk_list_get_user_data .......................................................................................161
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
Contents
x
CK1 SDK Programmer’s Reference Manual
OtkTab ..........................................................................................................................165
otk_tab_init.......................................................................................................165
otk_tab_set_label...............................................................................................166
otk_tab_add ......................................................................................................166
otk_tab_set_user_data .......................................................................................166
otk_tab_get_user_data.......................................................................................166
OtkToggleButton ...........................................................................................................166
otk_toggle_button_init......................................................................................167
otk_toggle_button_set_value .............................................................................167
otk_toggle_button_get_value.............................................................................167
otk_toggle_button_set_user_data ......................................................................167
otk_toggle_button_get_user_data......................................................................167
OtkEditable....................................................................................................................168
otk_editable_init ...............................................................................................169
otk_editable_set_position ..................................................................................169
otk_editable_set_size .........................................................................................169
otk_editable_set_parent.....................................................................................169
otk_editable_set_prev_sibling............................................................................170
otk_editable_set_next_sibling............................................................................170
otk_editable_set_event_handler.........................................................................170
otk_editable_set_drawing_func .........................................................................170
otk_editable_set_flag .........................................................................................171
otk_editable_set.................................................................................................171
otk_editable_set_sibling.....................................................................................171
otk_editable_set_autoset....................................................................................171
otk_editable_set_modified.................................................................................172
otk_editable_set_readonly .................................................................................172
otk_editable_set_focused ...................................................................................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
Contents
CK1 SDK Programmer’s Reference Manual
xi
OtkEntry........................................................................................................................178
otk_entry_init....................................................................................................179
otk_entry_set_visible .........................................................................................179
otk_entry_set_sensitive......................................................................................179
otk_entry_set_gc_background_color .................................................................179
otk_entry_set_gc_foreground_color ..................................................................180
otk_entry_set_position ......................................................................................180
otk_entry_set_size .............................................................................................180
otk_entry_set_parent.........................................................................................180
otk_entry_set_prev_sibling................................................................................181
otk_entry_set_next_sibling................................................................................181
otk_entry_set_event_handler .............................................................................181
otk_entry_set_drawing_func .............................................................................181
otk_entry_set_flag .............................................................................................182
otk_entry_set.....................................................................................................182
otk_entry_set_sibling.........................................................................................182
otk_entry_set_color ...........................................................................................182
otk_entry_set_autoset........................................................................................183
otk_entry_set_modified.....................................................................................183
otk_entry_set_readonly......................................................................................183
otk_entry_set_focused .......................................................................................184
otk_entry_set_maxlength...................................................................................184
otk_entry_set_buffer..........................................................................................184
otk_entry_load_from_file..................................................................................184
otk_entry_cut_to_clipboard ..............................................................................185
otk_entry_paste_from_clipboard.......................................................................185
otk_entry_clear_selection ..................................................................................185
otk_entry_set_seltextbuf ....................................................................................185
otk_entry_clear..................................................................................................186
otk_entry_select_all ...........................................................................................186
otk_entry_set_font_size.....................................................................................186
otk_entry_set_align ...........................................................................................186
otk_entry_set_restrict_length.............................................................................186
otk_entry_set_pswdmode ..................................................................................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
Contents
xii
CK1 SDK Programmer’s Reference Manual
otk_maskedit_set_flag .......................................................................................192
otk_maskedit_set...............................................................................................192
otk_maskedit_set_sibling...................................................................................192
otk_maskedit_set_color .....................................................................................193
otk_maskedit_set_autoset ..................................................................................193
otk_maskedit_set_modified ...............................................................................193
otk_maskedit_set_readonly................................................................................193
otk_maskedit_set_focused .................................................................................194
otk_maskedit_set_maxlength.............................................................................194
otk_maskedit_set_buffer....................................................................................194
otk_maskedit_load_from_file ............................................................................194
otk_maskedit_cut_to_clipboard ........................................................................195
otk_maskedit_paste_from_clipboard .................................................................195
otk_maskedit_clear_selection.............................................................................195
otk_maskedit_set_seltextbuf ..............................................................................195
otk_maskedit_clear............................................................................................196
otk_maskedit_select_all .....................................................................................196
otk_maskedit_insert...........................................................................................196
otk_maskedit_delete ..........................................................................................196
otk_maskedit_set_font_size ...............................................................................197
otk_maskedit_show ...........................................................................................197
otk_maskedit_hide ............................................................................................197
otk_maskedit_refresh.........................................................................................197
otk_maskedit_set_mask .....................................................................................198
otk_maskedit_set_unentered_char.....................................................................198
OnReturnPress Event ........................................................................................198
Example Code ...................................................................................................198
OtkPage..........................................................................................................................199
otk_page_init.....................................................................................................199
otk_page_set_size ..............................................................................................199
otk_page_set_position .......................................................................................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
Contents
CK1 SDK Programmer’s Reference Manual
xiii
OtkScrollBar ..................................................................................................................206
otk_scrollbar_init ..............................................................................................206
otk_scrollbar_set_typeflag..................................................................................206
otk_scrollbar_set_size ........................................................................................207
otk_scrollbar_set_position.................................................................................207
otk_scrollbar_set_range .....................................................................................207
otk_scrollbar_set_step........................................................................................207
otk_scrollbar_refresh .........................................................................................208
otk_scrollbar_set_max .......................................................................................208
otk_scrollbar_set_min .......................................................................................208
otk_scrollbar_set_value......................................................................................208
Example Code ...................................................................................................209
OtkScrollBar2 ................................................................................................................210
otk_scrollbar2_init ............................................................................................210
otk_scrollbar2_set_typeflag................................................................................211
otk_scrollbar2_set_size ......................................................................................211
otk_scrollbar2_set_position...............................................................................211
otk_scrollbar2_set_range ...................................................................................211
otk_scrollbar2_set_step......................................................................................212
otk_scrollbar2_refresh .......................................................................................212
otk_scrollbar2_set_max .....................................................................................212
otk_scrollbar2_set_min .....................................................................................212
otk_scrollbar2_set_value....................................................................................213
Example Code ...................................................................................................213
OtkSpin..........................................................................................................................215
otk_spin_init .....................................................................................................215
otk_spin_set_typeflag ........................................................................................215
otk_spin_set_size...............................................................................................215
otk_spin_set_position........................................................................................216
otk_spin_set_range............................................................................................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
Contents
xiv
CK1 SDK Programmer’s Reference Manual
OtkSelection...................................................................................................................223
otk_selection_init ..............................................................................................223
otk_selection_set_size ........................................................................................223
otk_selection_set_position.................................................................................223
otk_selection_set_label_number ........................................................................224
otk_selection_set_label ......................................................................................224
otk_selection_set_default...................................................................................224
otk_selection_refresh .........................................................................................224
Example Code ...................................................................................................225
OtkSelection2.................................................................................................................226
otk_selection2_init ............................................................................................226
otk_selection2_set_size ......................................................................................226
otk_selection2_set_position...............................................................................227
otk_selection2_set_label_number ......................................................................227
otk_selection2_set_label ....................................................................................227
otk_selection2_set_default.................................................................................227
otk_selection2_refresh .......................................................................................228
Example Code ...................................................................................................228
OtkTabGroup ................................................................................................................229
otk_tab_group_init............................................................................................229
otk_tab_group_append......................................................................................229
otk_tab_group_set_tab_button_size ..................................................................230
otk_tab_group_set_user_data ............................................................................230
OtkCustomPopupMenu.................................................................................................230
otk_custompopupmenu_init .............................................................................230
otk_custompopupmenu_add_item....................................................................231
otk_custompopupmenu_set_owner...................................................................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
Contents
CK1 SDK Programmer’s Reference Manual
xv
OtkMenuItem ................................................................................................................238
otk_menuitem_init............................................................................................238
otk_menuitem_set_label....................................................................................238
otk_menuitem_set_enabled ...............................................................................239
otk_menuitem_set_checked...............................................................................239
otk_menuitem_set_groupid...............................................................................239
otk_menuitem_set.............................................................................................239
otk_menuitem_set_clicked_callback..................................................................240
otk_menuitem_set_height .................................................................................240
otk_menuitem_set_width ..................................................................................240
otk_menuitem_set_color ...................................................................................241
otk_menuitem_refresh.......................................................................................241
OnClick Event ..................................................................................................241
Nano-X APIs................................................................................................................................ 243
General API....................................................................................................................244
Synopsis.............................................................................................................244
GrFlush ()..........................................................................................................244
GrOpen () .........................................................................................................244
GrClose ()..........................................................................................................244
GrMainLoop ()..................................................................................................244
GrGetScreenInfo ()............................................................................................245
GrSetErrorHandler () ........................................................................................245
GrDefaultErrorHandler () .................................................................................245
Window API ..................................................................................................................245
Synopsis.............................................................................................................245
GrNewWindow () .............................................................................................246
GrNewPixmap ()...............................................................................................247
GrNewInputWindow () ....................................................................................247
GrDestroyWindow () ........................................................................................248
GrMapWindow () .............................................................................................248
GrUnmapWindow ().........................................................................................248
GrRaiseWindow () ............................................................................................248
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
5
Contents
xvi
CK1 SDK Programmer’s Reference Manual
Graphics API ..................................................................................................................252
Synopsis.............................................................................................................252
GrNewGC ().....................................................................................................255
GrCopyGC ()....................................................................................................255
GrGetGCInfo ()................................................................................................255
GrDestroyGC () ................................................................................................256
GrLine () ...........................................................................................................256
GrPoint ()..........................................................................................................256
GrPoints () ........................................................................................................256
GrRect () ...........................................................................................................257
GrFillRect ()......................................................................................................257
GrPoly () ...........................................................................................................258
GrFillPoly () ......................................................................................................258
GrEllipse ()........................................................................................................259
GrFillEllipse ()...................................................................................................259
GrArc ().............................................................................................................259
GrArcAngle ()....................................................................................................260
GrSetGCForeground () .....................................................................................261
GrSetGCBackground ().....................................................................................261
GrSetGCUseBackground ()...............................................................................261
GrSetGCMode () ..............................................................................................261
GrSetGCFont () ................................................................................................262
GrGetGCTextSize () .........................................................................................262
GrReadArea () ...................................................................................................262
GrArea () ...........................................................................................................263
GrCopyArea ()...................................................................................................264
GrBitmap ().......................................................................................................264
GrFreeImage () ..................................................................................................265
GrGetImageInfo () ............................................................................................265
GrDrawImageFromFile ()..................................................................................265
GrLoadImageFromFile ()...................................................................................266
GrDrawImageToFit ().......................................................................................266
GrDrawImageBits ()..........................................................................................267
GrText ()...........................................................................................................267
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
Contents
CK1 SDK Programmer’s Reference Manual
xvii
GrDestroyFont () ..............................................................................................272
GrGetFontInfo () ..............................................................................................272
GrFontSetCFontSize ()......................................................................................273
Pointer API.....................................................................................................................273
Synopsis.............................................................................................................273
GrSetCursor ()...................................................................................................273
GrMoveCursor () ..............................................................................................274
GrInjectPointerEvent ().....................................................................................274
Colors API......................................................................................................................275
Synopsis.............................................................................................................275
GrGetSystemPalette () .......................................................................................275
GrSetSystemPalette () ........................................................................................275
GrFindColor ()..................................................................................................276
GrGetSysColor () ..............................................................................................276
Regions API....................................................................................................................276
Synopsis.............................................................................................................276
GrNewRegion ()................................................................................................277
GrDestroyRegion ()...........................................................................................277
GrUnionRectWithRegion ()..............................................................................277
GrUnionRegion ().............................................................................................277
GrSubtractRegion () ..........................................................................................278
GrXorRegion () .................................................................................................278
GrIntersectRegion ()..........................................................................................278
GrSetGCRegion ().............................................................................................279
GrPointInRegion () ...........................................................................................279
GrRectInRegion ().............................................................................................279
GrEmptyRegion ().............................................................................................280
GrEqualRegion () ..............................................................................................280
GrOffsetRegion ()..............................................................................................280
GrGetRegionBox () ...........................................................................................280
GrNewPolygonRegion () ...................................................................................281
Selections API.................................................................................................................281
Synopsis.............................................................................................................281
GrSetSelectionOwner ().....................................................................................281
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
Contents
xviii
CK1 SDK Programmer’s Reference Manual
GrSelectPadKeys() .............................................................................................286
GrSetTriggerEnabled() ......................................................................................287
GrGetCurrentKeyMapping().............................................................................287
GrSetKeyMapping() ..........................................................................................287
GrSetKeyboardMappingFile() ...........................................................................287
GrSetKeyboardMappingDefault() .....................................................................287
GrSetCodepage() ...............................................................................................288
GrGetCurrentCodepage()..................................................................................288
GrTranslateCodepageToName() .......................................................................288
µClinux System......................................................................................................................... 289
Introducing the µClinux System.....................................................................................290
Linux Kernel...................................................................................................................291
Booting Sequence ..............................................................................................291
General Purpose Linux Kernel Architecture.......................................................293
Processes...............................................................................................294
Reentrant Kernel ..................................................................................296
Interprocess Communication................................................................296
Threads Under Linux ...........................................................................299
Memory Management in General Purpose Linux .................................300
File Systems..........................................................................................300
Networking Interface............................................................................301
Device Drivers......................................................................................303
µClinux ..........................................................................................................................303
History of µClinux ............................................................................................304
µClinux Architecture.........................................................................................304
µClinux Libraries..................................................................................305
Source Tree ..........................................................................................306
Hardware Dependency Under the µClinux ..........................................308
µClinux Toolchains...........................................................................................308
Runtime Linker and Loader...............................................................................309
Flat File Relocations .............................................................................311
Creating the Image ............................................................................................313
Booting the Device ............................................................................................314
Root File System................................................................................................316
Serial Flash File System.........................................................................316
Kernel Block Drivers ............................................................................319
Changes in Programming Interfaces ..................................................................319
Memory Management ..........................................................................320
User Applications ..............................................................................................321
Porting Applications.............................................................................321
Future of µClinux..............................................................................................321
µClinux on the CK1.......................................................................................................322
CK1 Hardware Architecture and Memory Mapping..........................................322
CK1 Hardware Architecture.................................................................322
CK1 Memory Mapping........................................................................324
A
Contents
CK1 SDK Programmer’s Reference Manual
xix
Programs in NOR Flash ....................................................................................325
Bootloader............................................................................................327
BIOS ....................................................................................................328
Diagnostic Program..............................................................................329
Flash Writer..........................................................................................329
CK1 µClinux Toolchains ..................................................................................329
Kernel Initialization for CK1.............................................................................330
Root File System................................................................................................330
Serial Flash File System.........................................................................331
Kernel Block Drivers ............................................................................332
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
New and Update ..................................................................................337
First and Next.......................................................................................337
Fetch ....................................................................................................338
Count...................................................................................................338
Example................................................................................................338
Device Configuration Files .............................................................................................338
/etc/config .........................................................................................................338
/home/etc ..........................................................................................................340
Index...............................................................................................................................................341
I
Contents
xx
CK1 SDK Programmer’s Reference Manual
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194
  • Page 195 195
  • Page 196 196
  • Page 197 197
  • Page 198 198
  • Page 199 199
  • Page 200 200
  • Page 201 201
  • Page 202 202
  • Page 203 203
  • Page 204 204
  • Page 205 205
  • Page 206 206
  • Page 207 207
  • Page 208 208
  • Page 209 209
  • Page 210 210
  • Page 211 211
  • Page 212 212
  • Page 213 213
  • Page 214 214
  • Page 215 215
  • Page 216 216
  • Page 217 217
  • Page 218 218
  • Page 219 219
  • Page 220 220
  • Page 221 221
  • Page 222 222
  • Page 223 223
  • Page 224 224
  • Page 225 225
  • Page 226 226
  • Page 227 227
  • Page 228 228
  • Page 229 229
  • Page 230 230
  • Page 231 231
  • Page 232 232
  • Page 233 233
  • Page 234 234
  • Page 235 235
  • Page 236 236
  • Page 237 237
  • Page 238 238
  • Page 239 239
  • Page 240 240
  • Page 241 241
  • Page 242 242
  • Page 243 243
  • Page 244 244
  • Page 245 245
  • Page 246 246
  • Page 247 247
  • Page 248 248
  • Page 249 249
  • Page 250 250
  • Page 251 251
  • Page 252 252
  • Page 253 253
  • Page 254 254
  • Page 255 255
  • Page 256 256
  • Page 257 257
  • Page 258 258
  • Page 259 259
  • Page 260 260
  • Page 261 261
  • Page 262 262
  • Page 263 263
  • Page 264 264
  • Page 265 265
  • Page 266 266
  • Page 267 267
  • Page 268 268
  • Page 269 269
  • Page 270 270
  • Page 271 271
  • Page 272 272
  • Page 273 273
  • Page 274 274
  • Page 275 275
  • Page 276 276
  • Page 277 277
  • Page 278 278
  • Page 279 279
  • Page 280 280
  • Page 281 281
  • Page 282 282
  • Page 283 283
  • Page 284 284
  • Page 285 285
  • Page 286 286
  • Page 287 287
  • Page 288 288
  • Page 289 289
  • Page 290 290
  • Page 291 291
  • Page 292 292
  • Page 293 293
  • Page 294 294
  • Page 295 295
  • Page 296 296
  • Page 297 297
  • Page 298 298
  • Page 299 299
  • Page 300 300
  • Page 301 301
  • Page 302 302
  • Page 303 303
  • Page 304 304
  • Page 305 305
  • Page 306 306
  • Page 307 307
  • Page 308 308
  • Page 309 309
  • Page 310 310
  • Page 311 311
  • Page 312 312
  • Page 313 313
  • Page 314 314
  • Page 315 315
  • Page 316 316
  • Page 317 317
  • Page 318 318
  • Page 319 319
  • Page 320 320
  • Page 321 321
  • Page 322 322
  • Page 323 323
  • Page 324 324
  • Page 325 325
  • Page 326 326
  • Page 327 327
  • Page 328 328
  • Page 329 329
  • Page 330 330
  • Page 331 331
  • Page 332 332
  • Page 333 333
  • Page 334 334
  • Page 335 335
  • Page 336 336
  • Page 337 337
  • Page 338 338
  • Page 339 339
  • Page 340 340
  • Page 341 341
  • Page 342 342
  • Page 343 343
  • Page 344 344
  • Page 345 345
  • Page 346 346
  • Page 347 347
  • Page 348 348
  • Page 349 349
  • Page 350 350
  • Page 351 351
  • Page 352 352
  • Page 353 353
  • Page 354 354
  • Page 355 355
  • Page 356 356
  • Page 357 357
  • Page 358 358
  • Page 359 359
  • Page 360 360
  • Page 361 361
  • Page 362 362
  • Page 363 363
  • Page 364 364
  • Page 365 365
  • Page 366 366
  • Page 367 367
  • Page 368 368
  • Page 369 369
  • Page 370 370
  • Page 371 371
  • Page 372 372
  • Page 373 373
  • Page 374 374
  • Page 375 375
  • Page 376 376
  • Page 377 377
  • Page 378 378
  • Page 379 379
  • Page 380 380
  • Page 381 381
  • Page 382 382
  • Page 383 383
  • Page 384 384
  • Page 385 385
  • Page 386 386
  • Page 387 387
  • Page 388 388
  • Page 389 389
  • Page 390 390

Intermec CK1 Serial Dock Programmer's Reference Manual

Type
Programmer's Reference Manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI