The text of a manual · part 29 of 40
700 Series Color Mobile Computer User's Manual: Section 7 - Programming, pages 240 to 249
Pages 240 to 249 of 346, from 700 Series Color Mobile Computer User's Manual
The original document is the PDF (2.9 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Intermec Model 720, Intermec Model 740, Intermec Model 741, Intermec Model 751, Intermec Model 760, Intermec Model 710, Intermec Model 730 and Intermec Model 761
Page 240
Programming
SECTION 7
IOCTL_HAL_GET_RESET_INFO This IOCTL code allows software to check the type of the most recent reset. Usage: #include “oemioctl.h” Syntax: BOOL KernelIoControl( IOCTL_HAL_GET_RESET_INFO, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned ); Parameters: lpInBuf
Should be set to NULL.
lpInBufSize
Should be set to zero.
lpOutBuf
Must point to a HAL_RESET_INFO structure: typedef struct { DWORD ResetReason; DWORD ObjectStoreState; } HAL_RESET_INFO, * PHAL_RESET_INFO; // Reset reason types #define HAL_RESET_TYPE_UNKNOWN #define HAL_RESET_REASON_HARDWARE #define HAL_RESET_REASON_SOFTWARE #define HAL_RESET_REASON_WATCHDOG #define HAL_RESET_BATT_FAULT #define HAL_RESET_VDD_FAULT
// most recent reset type // state of object store
0 1 2 4 8 16
// cold // suspend // power fail // warm boot
// Object store state flags #define HAL_OBJECT_STORE_STATE_UNKNOWN 0 #define HAL_OBJECT_STORE_STATE_CLEAR 1 nOutBufSize
The size of HAL_RESET_INFO in bytes.
lpBytesReturned The number of bytes returned by the function. Return Values: Returns TRUE if function succeeds. Returns FALSE if the function fails. GetLastError() may be used to get the extended error value.
700 Series Color Mobile Computer User’s Manual
7-31
Page 241
Programming
SECTION 7
IOCTL_HAL_GET_BOOT_DEVICE This IOCTL code allows software to check which device CE booted from. Usage: #include “oemioctl.h” Syntax: BOOL KernelIoControl( IOCTL_HAL_GET_BOOT_DEVICE, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned ); Parameters: lpInBuf
Should be set to NULL.
lpInBufSize
Should be set to zero.
lpOutBuf
Must point to a buffer large enough to hold a DWORD (4 bytes) that contains the boot device. The following boot devices are supported: #define HAL_BOOT_DEVICE_UNKNOWN #define HAL_BOOT_DEVICE_ROM_XIP #define HAL_BOOT_DEVICE_ROM #define HAL_BOOT_DEVICE_PCMCIA_ATA #define HAL_BOOT_DEVICE_PCMCIA_LINEAR #define HAL_BOOT_DEVICE_IDE_ATA #define HAL_BOOT_DEVICE_IDE_ATAPI nOutBufSize
0 1 2 3 4 5 6
The size of lpOutBuf in bytes (4).
lpBytesReturned The number of bytes returned by the function. Return Values: Returns TRUE if function succeeds. Returns FALSE if the function fails. GetLastError() may be used to get the extended error value.
IOCTL_HAL_REBOOT Causes the system to perform a warm-boot. The object store is retained. Usage: #include “oemioctl.h” Syntax: BOOL KernelIoControl( IOCTL_HAL_REBOOT, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned ); Parameters: lpInBuf
Should be set to NULL.
lpInBufSize
Should be set to zero.
lpOutBuf
Should be NULL.
nOutBufSize
Should be zero.
Return Values: None. 7-32
700 Series Color Mobile Computer User’s Manual
Page 242
Programming
SECTION 7
IOCTL_PROCESSOR_INFORMATION Returns processor information. Usage: #include “pkfuncs.h” Syntax: BOOL KernelIoControl( IOCTL_PROCESSOR_INFORMATION, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned ); Parameters: lpInBuf
Should be set to NULL.
lpInBufSize
Should be set to zero.
lpOutBuf
Should be a pointer to the PROCESSOR_INFO structure. The PROCESSOR_INFO structure stores information that describes the CPU more descriptively. typedef WORD WCHAR WORD WCHAR WORD WCAHR WCHAR DWORD DWORD } nOutBufSize
__PROCESSOR_INFO { wVersion; szProcessorCore[40]; wCoreRevision; szProcessorName[40]; wProcessorRevision; szCatalogNumber[100]; szVendor[100]; dwInstructionSet; dwClockSpeed;
// Set to value 1 // “ARM\0” // 4 // “PXA250\0” // 0 // 0 // “Intel Corporation\0” // 0 // 400
Should be set to sizeof(PROCESSOR_INFO) in bytes.
lpBytesReturned Returns sizeof(PROCESSOR_INFO); Return Values: Returns TRUE if function succeeds. Returns FALSE if the function fails. GetLastError() may be used to get the extended error value.
700 Series Color Mobile Computer User’s Manual
7-33
Page 243
Programming
SECTION 7
IOCTL_GET_CPU_ID Returns Xscale processor ID. Usage: #include “oemioctl.h” Syntax: BOOL KernelIoControl( IOCTL_GET_CPU_ID, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned ); Parameters: lpInBuf
Should point to a CPUIdInfo structure defined in OEMIOCTL.H.
lpInBufSize
Should be sizeof(CPUIdInfo).
lpOutBuf
Should be NULL.
nOutBufSize
Should be set to 0.
lpBytesReturned Returns sizeof(PROCESSOR_INFO); Return Values: Returns TRUE if function succeeds. Returns FALSE if the function fails. GetLastError() may be used to get the extended error value.
7-34
700 Series Color Mobile Computer User’s Manual
Page 244
Programming
SECTION 7
Reboot Functions There are several methods, via Kernel I/O Control functions, that an application program can use to force the 700 Series Computer to reboot.
IOCTL_HAL_REBOOT IOCTL_HAL_REBOOT performs a warm-boot. See page 7-32.
IOCTL_HAL_COLDBOOT Invoking the KernelIOControl function with IOCTL_HAL_COLDBOOT forces a cold reboot. This resets the 700 Series Computer and reloads Windows CE as if a power-up had been performed. The contents of the Windows CE RAM-based object store are discarded. See page 7-30.
IOCTL_HAL_WARMBOOT This function is supported on the 700 Series Computers. It performs a warm boot of the system, preserving the object store. See page 7-30.
700 Series Color Mobile Computer User’s Manual
7-35
Page 245
Programming
SECTION 7
Remapping the Keypad " NOTE:
Use caution when remapping the keypad. Improper remapping may render the keypad unusable. Data within the 700 Series Computer could also be lost, should any problems occur.
Applications have the ability to remap keys on the 700 Color Keypad. This will allow applications to enable keys that would otherwise not be available, such as the [F1] function key. Also, to disable keys that should not be available, such as the alpha key because no alpha entry is required. Care should be exercised when attempting to remap the keypad because improper remapping may cause the keypad to become unusable. This can be corrected by cold booting the device which will cause the default keymap to be loaded again. Note that remapping the keys in this way affects the key mapping for the entire system, not just for the application that does the remapping. There are three “planes” supported for the 740 Keypad. Keys that are to be used in more than one shift plane must be described in each plane. Unshifted plane: Contains values from the keypad when not pressed with other keys, such as the following: [1] 1 5 " [5] 9 " [9] Gold plane: Contains values from the keypad when a key is simultaneously pressed with the [Gold] key, such as the following: "
[Gold] + [1] Send [Gold] + [5] A3 PageDown " [Gold] + [9] Alpha plane: Contains values from the keypad when the keypad has been placed in alpha mode by pressing the blue alpha key, such as the following: " "
[Alpha] + [1] Caps JKL " [Alpha] + [5] WXYZ " [Alpha] + [9] Key values for each plane are stored in the registry. All units ship with a default key mapping already loaded in the registry. Applications that wish to change the default mapping need to read the appropriate key from the registry into an array of Words, modify the values required and then write the updated values back into the registry. The registry access can be done with standard Microsoft API calls, such as RegOpenKeyEx(), RegQueryValueEx(), and RegSetValueEx(). "
"
The unshifted plane mapping can be found in the registry at: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD\Vkey
"
The gold plane mapping can be found in the registry at: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD\VkeyGold
"
The alpha plane mapping can be found in the registry at: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD\VkeyAlpha
7-36
700 Series Color Mobile Computer User’s Manual
Page 246
Programming
SECTION 7
How Key Values Are Stored in Registry To know which fields to update in the registry, you must know what Scan Codes are assigned to each physical key (see the table below). The Scan Code is used at the lowest level of the system to let the keypad driver know which physical key has been pressed. The keypad driver takes that scan code and looks it up in a table (a copy of the one stored in the registry) to determine which values to pass on to the operating system. Each registry key is just an array that describes to the keypad driver what value needs to be passed for each physical key. The key values are indexed by the scan code, this is a zero-based index. For example in the unshifted plane, the [4] key has a scan code of 0x06. This means that the seventh word under the “Vkey” registry key will have the value for the [4] key. Taking a sample of the “Vkey” registry key shows the following values: 00,00,0B,05,02,03,C1,07,04,03,BE,00,34,00,00,00,. . .
The value is 34,00. The values are in reverse byte order because that is the way the processor handles data. When writing an application, nothing needs to be done to swap the bytes, as this will happen automatically when the data is read into a byte value. This is something you just need to be aware of this when looking at the registry. Knowing this, we can see that the value that the keypad driver will pass to the system is a hex 34. Looking that up on an UNICODE character chart, we see that it maps to a “4”. If you wanted the key, labeled “4”, to output the letter “A” instead, you would need to change the seventh word to “41” (the hexadecimal representation of “A” from the UNICODE chart), then put the key back into the registry. " NOTE:
Do not remap scan codes 0x01, 0x41, 0x42, 0x43, 0x44. Remapping these scan codes could render your 700 Series Computer unusable until a cold-boot is performed.
If you wish to disable a certain key, remap its scan code to 0x00.
Change Notification Just changing the registry keys will not immediately change the key mappings. To notify the keypad driver that the registry has been updated, signal the “ITC_KEYBOARD_CHANGE” named event using the CreateEvent() API.
Advanced Keypad Remapping It is also possible to map multiple key presses to one button and to map named system events to a button. The multiple key press option could be useful to cut down on the number of keys needed to press in a given situation or to remap which key behaves like the action key. Mapping events to a button could be useful to change which buttons will fire the scanner, control volume, and allow for suspending and resuming the device. If you need help performing one of these advanced topics please contact Intermec Technical Support.
700 Series Color Mobile Computer User’s Manual
7-37
Page 247
Programming
SECTION 7
Scan Codes At the lowest driver level, the 740 Keypad identifies keys as scan codes. These scan codes are sent via the keypad microcontroller, and cannot be changed without modifying the keypad firmware. Key/Meaning Reserved I/O Button Scanner Trigger Scanner Left Scanner Right . 4 None Left Arrow None Backspace Gold Key None ESC Down Arrow 1 7 Alpha Key None Up Arrow Right Arrow 2 8 0 5 None Action Key 3 9 ENTER 6 None Charge Detect
7-38
Scancode 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F–0x40 0x41
LCD Frontlight Ambient Light Threshold Crossed
0x42 0x42 0x42
Headset Detected
0x43
Keypad Backlight Ambient Light Threshold Crossed
0x44 0x44 0x44
700 Series Color Mobile Computer User’s Manual
Page 248
Programming
SECTION 7
Sample View of Registry Keys The following is a sample view of the current default key mapping. See the registry on your device for the latest key mappings. [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD] ”ResumeMask”=dword:7 ”Vkey”=hex: 00,00,0B,05,02,03,C1,07,04,03,BE,00,34,00,00,00,\ 25,00,00,00,08,00,03,02,00,00,1B,00,28,00,31,00,\ 37,00,01,02,00,00,26,00,27,00,32,00,38,00,30,00,\ 35,00,00,00,01,03,33,00,39,00,0D,00,36,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,07,05,01,05,03,05,02,05 ”VkeyGold”=hex: 00,00,0B,05,02,03,C1,07,04,03,BE,00,34,00,00,00,\ 09,01,00,00,BF,00,03,02,00,00,BD,00,75,00,72,00,\ 21,00,01,02,00,00,76,00,09,00,73,00,38,01,5B,00,\ 35,00,00,00,BB,01,09,05,22,00,32,01,36,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,07,05,01,05,03,05,02,05 ”VkeyAlpha”=hex: 00,00,0B,05,02,03,C1,07,04,03,BE,00,47,00,00,00,\ 25,00,00,00,08,00,03,02,00,00,1B,00,28,00,02,02,\ 50,00,01,02,00,00,26,00,27,00,41,00,54,00,20,00,\ 4A,00,00,00,01,03,44,00,57,00,0D,00,4D,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,07,05,01,05,03,05,02,05
700 Series Color Mobile Computer User’s Manual
7-39
Page 249
Programming
7-40
700 Series Color Mobile Computer User’s Manual
SECTION 7