Академический Документы
Профессиональный Документы
Культура Документы
* *
* *
* TeamPad500G Programmer's Reference Guide *
* *
* *
* *
* September 2004 First Edition *
*******************************************************************************
All Rights Reserved, Copyright (C) FUJITSU LIMITED 2004
0. Introduction
3. Devices on TeamPad500G
3.1 Storage devices
3.2 Keyboard
3.3 Soft Keyboard
3.4 Integrated Printer
3.5 Serial communication
6. Cautions
6.1 Memory Card
6.2 TeamPad-Explorer
6.3 Memory Trouble
6.4 When using the LAN adaptor
6.5 Regading the necessity for regular rebooting the system
###############################################################################
===============================================================================
0. Introduction
===============================================================================
* Rule of notation *
Below table describe a rule of notation on this documentation.
----------------+-------------------------------------------------------
Mark | Meaning
----------------+-------------------------------------------------------
| Possible to omit the content of [ ]
[ ]m | m is expressed as possible for repetition
|
| e.g. [variable name] means to be able to omit
| variable name.
----------------+-------------------------------------------------------
Microsoft, Windows, Windows XP, and Visual C++ are registered trademarks
of Microsoft Corporation in the United States and other countries.
Other company names and product names in this document are trademarks or
registered trademarks of their respective owners.
===============================================================================
1. Application Development Environment
===============================================================================
------------------------------------------------------------------------------
1.1 Setting Up Development Environment
------------------------------------------------------------------------------
The "eMbedded Visual C++ 4.0" tools cannot be loaded onto the same disk
partition as "eMbedded Visual Tools 3.0" .
At the writing of this document the "eMbedded Visual C++ 4.0" product could
be downloaded free from Microsoft, or a CD obtained by paying the shipping and
handling charge.
The "eMbedded Visual C++ 4.0" product could (at the writing of this document)
be ordered or downloaded from the following Microsoft•fs web site:
http://www.microsoft.com/downloads/release.asp?ReleaseID=37662&area=search&ordinal=3
The Service Pack 2(SP2) or the Service Pack 3(SP3) must be added to "eMbedded
Visual C++ 4.0" .
http://microsoft.com/downloads/details.aspx?FamilyId=CE7F1AAA-54EB-4989-812B-
7F955605DCB8&displaylang=en
http://www.microsoft.com/downloads/details.aspx?familyid=5bb36f3e-5b3d-419a-9610-
2fe53815ae3b&displaylang=en
The standard SDK for for Microsoft Windows CE 4.2 also can be added to
"eMbedded Visual C++ 4.0" if nessesary, and the standard SDK can be found at:
http://www.microsoft.com/downloads/details.aspx?FamilyID=a08f6991-16b0-4019-a174-
0c40e6d25fe7&DisplayLang=en
The following Microsoft products are required to develop for the TeamPad500G,
along with the knowledge on how to use them:
b. Place the "Microsoft eMbedded Visual C++ 4.0" CD into the CD drive.
The install program will start automatically.
c. The install program will ask what components you wish to install.
Make sure only "eMbedded Visual C++ 4.0" is checked.
e. The install program will ask what components you wish to install.
Make sure both "eMbedded Visual C++ 4.0" and "Common Components" are
selected.
f. Add "eMbedded Visual C++ 4.0 SP2" or "eMbedded Visual C++ 4.0 SP3".
-------------------------------------------------------------------------------
1.2 Development for Application
-------------------------------------------------------------------------------
Application Software by using eMbedded Visual C++ 4.0 for the TeamPad500G
will be developed with the following sequence.
a. Making Project
d. Build (Compile)
After the coding is completed, build (compile) and create the XXXXXX.EXE
file.
(*) XXXXXX is a name of the project which you made.
e. Emulation
a. Making Project
b. Build (Compile)
After the coding is completed, build (compile) and create the XXXXXX.EXE
file.
(*) XXXXXX is a name of the project which you made.
e. Emulation
===============================================================================
2. Application Software Installation
===============================================================================
-------------------------------------------------------------------------------
2.1 Setup File (CONFIG.HHT)
-------------------------------------------------------------------------------
b. Format
+-------------------------------------------------------------------------+
| [Initialize] |
| DirectoryName=Destination_Folder[,Destination_Folder]m |
| END |
+-------------------------------------------------------------------------+
- Specify this section only when you need to initialize specific folders.
- This function is supported in case of installing from Storage Card. This
function is invalid when the program loader or ActiveSync is used.
- In the case of more than one folder initialization, add ","and specify
folder name.
- Example for removing all the files in \Storage Card1\Temp
[Initialize]
DirectoryName="\Storage Card1\Temp"
END
b. Format
+-------------------------------------------------------------------------+
| [Install File] |
| Source_Filename=Destination_Filename |
| END |
+-------------------------------------------------------------------------+
- You have to designate the full path names for both source and
destination.
- Do not put the blank (space) before and after the "=" sign.
- When you use Wild Card *.* for installing, all the files under the folder
is copied to designated location. Then you have to designate the both
filename as *.*.
- Describe END only after [Install File] section when it runs a program on
the Memory Card.
- The name of Compact Flash card slots are "Storage Card1" and "Storage
Card2".
- Example for copying all files in \Storage Card1\HhtApl\ folder to
\HhtApl folder in TeamPad500G
[Install File]
"\Storage Card1\HhtApl\*.*"=\HhtApl\*.*
END
b. Format
+-------------------------------------------------------------------------+
| [StartUp] |
| FileName=Startup_Filename [parameter] |
| END |
+-------------------------------------------------------------------------+
[StartUp]
FileName="\Hht Apl\HhtApl.exe"
END
b. Format
+-------------------------------------------------------------------------+
| [WceLoad] |
| CabFile=CAB_Filename |
| END |
+-------------------------------------------------------------------------+
- Ensure that CAB_Filename is with full path name where the file is
installed.
- In case that you use CAB file including space in the path name or
file name, you have to enclose the parameter with "".
- Example for designating \WinCeApp\WinCeApp.Cab as CAB file
[WceLoad]
CabFile=\WinCeApp\WinCeApp.Cab
END
5) Registering DLL's
----------------------------------------------------------------------------
a. Function
This section designates Class ID to register the registry.
b. Format
+-------------------------------------------------------------------------+
| [RegSvrCE] |
| CESelfRegister=Filename_to_Register[,Filename_to_Register]m |
| END |
+-------------------------------------------------------------------------+
[RegSvrCE]
CESelfRegister=\HhtApl\HhtApl.dll,HhtApl.ocx
END
6) Define control panel settings
----------------------------------------------------------------------------
a. Function
This section provides a method of the configuration of control panel
settings, when installing the application software.
b. Format
+-------------------------------------------------------------------------+
| [Control Panel] |
| TaskBar=W/Wo displaying of Task Bar |
| TeampadInf=W/Wo displaying of Battery/Sound volume screen |
| ScrKey=W/Wo displaying of Screen Keyboard |
| BattPowerOff=Time period for auto-power OFF with battery operation |
| ExtPowerOff=Time period for auto-power OFF with AC Outlet operation |
| BattBackLightOff=Time period for auto-backlight-off with battery |
| operation |
| ExtBackLightOff=Time period for auto-backlight-off with AC Outlet |
| operation |
| DeviceName=Device name for communication |
| Volume=Speaker Volume |
| MemorySize=Size of RAM ObjectStore |
| AutoRestore=Automatic restoring function when memory contents is lost |
| ClearType=Clear Type Font |
| MyComputerIcon=W/Wo displaying of MyComputer icon on desktop |
| USBMode=LAN Adaptor(FHTUL411) Setting |
| END |
+-------------------------------------------------------------------------+
The below items show Control Panel Information to be able to set with
Installing.
- W/Wo displaying of Task Bar (Default:disable)
(0:disable 1:enable)
- W/Wo displaying of Battery/Sound volume screen (Default:enable)
(0:disable 1:enable)
- W/Wo displaying of Screen Keyboard (Default:enable)
(0:disable 1:enable)
- Time period for auto-power OFF with battery operation (Default:180sec)
(Value:Sec 0sec means disable)
- Time period for auto-power OFF with AC Outlet operation (Default:0sec
(disable)
(Value:Sec 0sec means disable)
- Time period for auto-backlight-off with battery operation (Default:60
sec)
(Value:Sec 0sec means disable)
- Time period for auto-backlight-off with AC Outlet operation (Default:
600sec)
(Value:Sec 0sec means disable)
- Device name for communication(Default:WindowsCE)
Designate device name with communication
- Volume (Default:Medium)
(Level 1:High 2:Medium 3:Low 4:Off)
- Size of RAM disk (Object Store) (Default:30116KB)
(Size KB)
- Settings of automatic restoring function when memory contents is lost.
(Default:0x00000000)
Notification Touch Panel Calendar Setting
Screen Calibration Screen Screen
0x00000000: Yes Yes Yes
0x00000001: No No No
0x00010001: Yes No No
0x00020001: No Yes No
0x00030001: Yes No No
0x00040001: No No Yes
0x00050001: Yes No Yes
0x00060001: No Yes Yes
- Clear Type Font (Default:disable)
(0:disable 1:enable)
- W/Wo displaying of MyComputer Icon on desktop (Default:disable)
(0:disable 1:enable)
- LAN Adaptor(FHTUL581) Setting (Default:USB-CIU)
( 0:USB-CIU(FHTUA571) 1:USB-LAN Adaptor(FHTUL581) )
You can set these designating only when you need to change Control Panel
information. Also you can set some (or one) item(s) only which you need.
Example for designating "With displaying of Task Bar"
[Control Panel]
TaskBar=1
END
7) Quick launch
----------------------------------------------------------------------------
a. Function
This section designates the program (launcher) by pressing 'F1'-'F5' key.
b. Format
+-------------------------------------------------------------------------+
| [Launch] |
| F1=Program_name_by_pressing_F1_key [parameter] |
| F2=Program_name_by_pressing_F2_key [parameter] |
| F3=Program_name_by_pressing_F3_key [parameter] |
| F4=Program_name_by_pressing_F4_key [parameter] |
| F5=Program_name_by_pressing_F5_key [parameter] |
| END |
+-------------------------------------------------------------------------+
- Ensure to edit file name with full path which is executed by launcher.
- You can set these designating only when you need to register or change
launcher. Also you can set some (or one) item(s) only which you need.
- In case of including space in the program name or path name, you have
to enclose the program name or the parameter with "".
- Example for designating \HhtApl\HhtApl.exe as 'F2' key
[Launch]
F2=\HhtApl\HhtApl.exe
END
b. Format
+-------------------------------------------------------------------------+
| [User Registry] |
| RegFile=Registry_Import_Filename[,Registry_Import_Filename]m |
| END |
+-------------------------------------------------------------------------+
[User Registry]
RegFile="\Storage Card1\User1.Reg"
END
*=== CAUTION ==============================================================*
| - Only the registry file exported by the registry editor in TeamPad500G |
| can be imported. |
*==========================================================================*
-------------------------------------------------------------------------------
2.2 Installation Procedure
-------------------------------------------------------------------------------
a. Start ActiveSync on PC
[WceLoad]
CabFile=\WinCeApp\WinCeApp.Cab
END
*=== CAUTION ==============================================================*
| - If format of Setup file (CONFIG.HHT) is wrong, the software will be |
| installed without correct registration. |
| - If error occurred during installation of application software, system |
| error message will be displayed and TeamPad500G returns to initial |
| state. In case if system error occurred, re-installation of the |
| application is required. |
| - When application installation, the application program is automatically|
| backed up to the following folder. |
| \FlashDisk\System : Backup folder |
| Do not delete the file in this backup folder or do not move. |
| If it is deleted or moved, the automatic restoration function does not |
| work when the battery empty. |
*==========================================================================*
===============================================================================
3. Devices on TeamPad500G
===============================================================================
-------------------------------------------------------------------------------
3.1 Storage devices
-------------------------------------------------------------------------------
+---------------------+-----------------+---------------------------------+
| Memory area | Capacity | Note |
+---------------------+-----------------+---------------------------------+
| RAM disk | Approx.32MB | Back-up available by internal |
| | | battery (Volatile) |
| Flash Disk | Approx.32MB | Back-up even if no internal |
| | | battery (Non-volatile) |
| Storage Card | Card Capability | External media, Optional card is|
| | | required (Non-volatile) |
+---------------------+-----------------+---------------------------------+
Note: Capacity of RAM disk can be changed by Control Panel, however if the
RAM disk capacity is expanded, the program may work properly
because of short of executable area.
When you install a certain file(e.g. XXXXX.DAT) from Compact Flash Card to
Flash Disk drive, you need specify on CONFIG.HHT as follows;
[Install File]
\Strage Card1\XXXXXX.DAT=\FlashDisk\XXXXXX.DAT
END
If you wish to expand the area to store files, optional Compact Flash disk
card or PCMCIA card is required.
TeamPad500G has two(2) card slots, and the folder name of Compact Flash card
is "Storage Card1" and the folder name of PCMCIA card is "Storage Card2".
When you install a certain file(e.g. XXXXX.DAT) from Compact Flash card to
a certain location (e.g. under \Temp\Data), you need specify on CONFIG.HHT
as follows;
[Install File]
\Storage Card1\XXXXXX.DAT=\Temp\Data\XXXXXX.DAT
END
-------------------------------------------------------------------------------
3.2 Keyboard
-------------------------------------------------------------------------------
a. key code
(1)Normal status
The below table shows the relation as name of the keys and virtual key codes.
This virtual key code is notified to the user application as "wParam"
parameter of the WM_KEYDOWN message.
+-------+-----------------+-------+ +---------+-----------------+-------+
| Key | Symbolize | Value | | Key | Symbolize | Value |
| | constant | | | with SFT| constant | |
+-------+-----------------+-------+ +---------+-----------------+-------+
| 0 | VK_0 | 0x30 | | 0 | VK_NUMPAD0 | 0x60 |
| 1 | VK_1 | 0x31 | | 1 | VK_NUMPAD1 | 0x61 |
| 2 | VK_2 | 0x32 | | 2 | VK_NUMPAD2 | 0x62 |
| 3 | VK_3 | 0x33 | | 3 | VK_NUMPAD3 | 0x63 |
| 4 | VK_4 | 0x34 | | 4 | VK_NUMPAD4 | 0x64 |
| 5 | VK_5 | 0x35 | | 5 | VK_NUMPAD5 | 0x65 |
| 6 | VK_6 | 0x36 | | 6 | VK_NUMPAD6 | 0x66 |
| 7 | VK_7 | 0x37 | | 7 | VK_NUMPAD7 | 0x67 |
| 8 | VK_8 | 0x38 | | 8 | VK_NUMPAD8 | 0x68 |
| 9 | VK_9 | 0x39 | | 9 | VK_NUMPAD9 | 0x69 |
| F1 | VK_F1 | 0x70 | | F6 | VK_F6 | 0x75 |
| F2 | VK_F2 | 0x71 | | F7 | VK_F7 | 0x76 |
| F3 | VK_F3 | 0x71 | | F8 | VK_F8 | 0x77 |
| F4 | VK_F4 | 0x71 | | F9 | VK_F9 | 0x78 |
| F5 | VK_F5 | 0x71 | | F10 | VK_F10 | 0x79 |
| SFT | VK_SHIFT | 0x10 | | | | |
| <= | VK_LEFT | 0x25 | | /\ | VK_UP | 0x26 |
| => | VK_RIGHT | 0x27 | | \/ | VK_DOWN | 0x28 |
| ENT | VK_RETURN | 0x0D | |(System) | (System Menu) | |
| 00 | VK_0,VK_0 | | | CTL | VK_CONTROL | 0x11 |
| BKS | VK_BACK | 0x08 | | ESC | VK_ESCAPE | 0x1B |
| . | VK_PERIOD | 0xBE | | ALT | VK_MENU | 0x12 |
| CLR | VK_CLEAR | 0x0C | | - | VK_HYPHEN | 0xBD |
+-------+-----------------+-------+ +---------+-----------------+-------+
b. Key Sequence
+----------+------------------------------------------------------------+
|SFT+F1 |Paper Feed of integrated printer |
|SFT+F2 |Paper Back Feed of integrated printer |
|SFT+F3 |Set the back light of screen darker |
|SFT+F4 |Set the back light of screen lighter |
|SFT+F5 |Toggles presence of touch screen keyboard on display |
|SFT+ENT |Displays battery status and allows speaker volume |
| |control and touch screen calibration |
|SFT+CLR+F2|Display "Setup Menu" when these keys pressing on boot, |
| |even if an application is to be started automatically. |
+----------+------------------------------------------------------------+
Note:
The keyboard backlight is turned off whenever the screen back light is
active.
-------------------------------------------------------------------------------
3.3 Soft Keyboard
-------------------------------------------------------------------------------
(2) Function
BOOL SipShowIM(DWORD dwFlags);
(3) Parameter
dwFlags : Designate soft keyboard display or not.
0(SIPF_ON) Display SIP
1(SIPF_OFF) Not display SIP
(5) Example
BOOL bRet;
// Display SIP
bRet = SipShowIM(SIPF_ON);
if(!bRet) goto Error_Exit;
-------------------------------------------------------------------------------
3.4 Integrated Printer
-------------------------------------------------------------------------------
The application program can control the integrated printer by the following
library.
-------------------------------------------------------------------------------
3.5 Serial Communication
-------------------------------------------------------------------------------
+-----+----------------------------+-----------------------------------------+
|Port | Device | Purpose |
+-----+----------------------------+-----------------------------------------+
|COM1 | Mechanical RS232 Port | For use with External 1D barcode reader |
|COM2 | Integrated Scanner | 1D barcode reader (Symbol SE923) |
|COM3 | IrComm | For use with IrComm/IrLPT Devices |
| | | (most often printers) |
|COM4 | --- | No device assigned |
|COM5A| IrDA Multiplex | For use with CIU when Modem control |
| | | signals are required |
|COM5D| Magnetic Stripe Reader | Track 1 and 2 card reader (Omron) |
|COM5E| Magnetic Stripe Reader | Track 2 and 3 card reader (Omron) |
|COM6 | IrDA Raw (direct access) | Use for custom IR protocols. |
| | | Or, for use with CIU when modem control |
| | | signals not required. |
|COM7 | USB (Slave port) | For USB connection with PC |
|COMx | CF Type Modem Card | Most often data collection |
|LPT1 | Integrated Printer | For Invoice/Receipt |
+-----+----------------------------------------------------------------------+
The IrDA port can be used in three different modes. The modes are IrDA Raw,
IrDA Multiplex, and IrComm/IrLPT.
While each of these modes are accessed differently, only one can be used
at a time as they share the same hardware.
The IrDA Raw mode is used to send data out the IrDA port when communicating
by a proprietary protocol. IrDA Raw only supports transmit (Tx) and receive
(Rx) data. The protocol is the responsibility of the program sending the
data, as no protocol is provided by the TeamPad500G.
The IrDA Raw mode can transmit and receive at Max 115Kbps. The receiving
device must have knowledge of the protocol and the baud rate at which the
data is to be received.
If the IrDA Raw mode is used with the RS232C-CIU, then the dip switches
on the back of the CIU must be set to corresponding baud rate.
When COM3 is used to access the IrDA port, then the data is sent to the port
via the industry standard IrCOMM protocol. IrCOMM is supported directly from
the COM3 interface.
Note that the COM3, COM5, and COM6 devices share the same hardware and only
one can be opened by the application at a time.
Power supply to every serial device is done when the "CreateFile" function
is called, and power abort is done when the "CloseHandle" function is
called.
When CF Type Modem Card is placed into TeamPad500G, unoccupied and lowest
COM number is assigned for COM port.
===============================================================================
4. API for Visual C++
===============================================================================
-------------------------------------------------------------------------------
4.1 Power Control
-------------------------------------------------------------------------------
This function is capable to enable/disable the power OFF switch through the
application program in order to prevent power OFF from careless operation of
application process.
(2) Function
BOOL fhtGetSetPowkeyStatus (DWORD dwGetSetCmd,
DWORD *pdwStatus,
DWORD *pdwErrDetail);
(3) Parameter
dwGetSetCmd : Command which designates to get or set status of 'PWR' key
control.
0(POW_GET_STATUS) Get 'PWR' key status
1(POW_SET_STATUS) Set 'PWR' key status
pdwStatus : Buffer pointer to store 'PWR' key status.
In case of getting status, the status return to designated
buffer. In case of setting status, set the status which you
wish to set.
Values of 'PWR' key status are as follows;
0(POW_SW_DISABLE) Power off disable by 'PWR' key
1(POW_SW_ENABLE) Power off enable by 'PWR' key
pdwErrDetail: Buffer pointer to return error detail code
If you need no error detail code, you can designate NULL.
In case that returned value is FALSE, it returns the
following error detail code.
101(POW_INVALID_PARAMETER) Parameter error
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
(5) Example
In case when the 'PWR' key is disabled.
DWORD dwStatus,dwErrDetail,dwGetSetCmd;
BOOL bRet;
This function is capable to enter the unit into Suspend mode through
application program.
(2) Function
BOOL fhtSetPowerDown(DWORD dwResume,
DWORD *pdwErrDetail);
(3) Parameter
dwResume : Setting of next power ON mode.
0 Resume
0x55AA55AA Warm Boot
pdwErrDetail : Buffer pointer to return error detail code
If you need no error detail code, you can designate NULL.
In case that returned value is FALSE, it returns the
following error detail code.
101(POW_INVALID_PARAMETER) Parameter error
102(POW_SYSTEM_ERROR) System error
(Lack of resource or others)
103(POW_SYSTEM_BUSY) System busy
(Suspend can't transit)
104(POW_KEY_DISABLE) 'PWR' key event is masked
(5) Example
BOOL bRet;
DWORD dwErrDetail, dwResume;
// Setting Suspend
while(1){
dwResume = 0;
bRet = fhtSetPowerDown(dwResume, &dwErrDetail);
if(bRet) break;
if(dwErrDetail != POW_SYSTEM_BUSY) goto Error_Exit;
Sleep(1000);
}
(2) Function
BOOL fhtSetPowonSeq(DWORD dwResume,
DWORD *pdwErrDetail);
(3) Parameter
dwResume : Setting of power ON mode.
0 Resume
0x55AA55AA Warm Boot
pdwErrDetail: Buffer pointer to return error detail code
If you need no error detail code, you can designate NULL.
In case that returned value is FALSE, it returns the
following error detail code.
101(POW_INVALID_PARAMETER) Parameter error
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
(5) Example
DWORD dwErrDetail,dwResume;
BOOL bRet;
This function has a capability to set Back light ON/OFF and to adjust
Brightness or to get their status.
(2) Function
BOOL fhtGetSetBacklight(DWORD dwGetSetCmd,
DWORD *pdwValue,
DWORD *pdwErrDetail);
(3) Parameter
dwGetSetCmd : Command which designates to get or set status of Back light
or Contrast.
4(GET_LIGHT) Get Back light status
5(SET_LIGHT) Set Back light status
pdwValue : Buffer pointer to designate brightness value of Back light.
In case of getting status, the status returns to designated
buffer. In case of setting status, set the status which you
wish to change.
Back light value is follows;
0 Back light Off
1-128 Brightness value
pdwErrDetail: Buffer pointer to return error detail code
If you do not need error detail code, you can designate NULL.
In case that returned value is FALSE, it returns the follow
error detail code.
101(POW_INVALID_PARAMETER) Parameter error
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
(5) Example
DWORD dwErrDetail,dwGetSetCmd,dwValue;
BOOL bRet;
(2) Function
BOOL fhtBatteryGetStatus2
(PSYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx,
UINT16 *pwCharge, DWORD *pdwErrDetail);
(3) Parameter
pSystemPowerStatusEx: Pointer to structure of battery status information.
pwCharge : Pointer to the number of times for battery charge/discharge.
Note this value is not supported in TeamPad500G.
pdwErrDetail: Buffer pointer to return error detail code
If you do not need error detail code, you can designate NULL.
In case that returned value is FALSE, it returns the
following error detail code.
101(POW_INVALID_PARAMETER) Parameter error
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
(5) Example
DWORD dwErrDetail;
BOOL bRet;
SYSTEM_POWER_STATUS_EX2 ps;
UINT16 pwCharge;
This function has a capability to set auto power OFF function, or to get
this status.
When no activity detects in specified time, the unit will enter Suspend mode
automatically. Application can disable this automatic Suspend mode.
(2) Function
BOOL fhtGetSetAutoPwrOff(DWORD dwGetSetCmd,
DWORD *pdwStatus,
DWORD *pdwErrDetail);
(3) Parameter
dwGetSetCmd : Command which designates to get or set status of auto
power OFF function.
0(POW_GET_STATUS) Get auto power OFF function status
1(POW_SET_STATUS) Set auto power OFF function status
pdwStatus : Designate pointer of buffer to Auto power OFF function
status.
Values of auto power OFF function status are as follows;
0(AUT_POWER_OFF) Disable Auto power OFF function
1(AUT_POWER_ON) Enable Auto power OFF function
pdwErrDetail: Buffer pointer to return error detail code.
If you do not need error detail code, you can designate NULL.
In case that returned value is FALSE, it returns the follow
error detail code.
101(POW_INVALID_PARAMETER) Parameter error
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
(5) Example
DWORD dwErrDetail,dwGetSetCmd,dwStatus;
BOOL bRet;
(2) Function
BOOL fhtResumeWait(DWORD *pdwErrDetail);
(3) Parameter
pdwErrDetail: Buffer pointer to return error detail code.
If you do not need error detail code, you can designate NULL.
In case that returned value is FALSE, it returns the follow
error detail code.
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
103(POW_SYSTEM_BUSY) System busy
(Suspend can't transit)
(5) Example
¥
¥
¥
¥
ExitThread( 0 ) ;
return 0 ;
}
This function stops the fhtResumeWait function which waits for resuming
(power-on).
(2) Function
(3) Parameter
pdwErrDetail: Buffer pointer to return error detail code.
If you do not need error detail code, you can designate NULL.
In case that returned value is FALSE, it returns the follow
error detail code.
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
(5) Example
-------------------------------------------------------------------------------
4.2 Serial communication
-------------------------------------------------------------------------------
Serial devices can be accessed through the file I/O function. Power can be
supplied to each serial device by calling the CreateFile function,
and power can be cut-off by calling the CloseHandle function. However,
regarding the serial port wherein multiple devices can be connected
(when extended), it is necessary to use the function described in
"4.2.2 Connect Peripheral To COM Port";
keep the function selected prior to powering the serial port.
This device supports 6 serial port interfaces (COM1, COM2, COM3, COM5, COM6
and COM7).
The connections for each port are shown below.
- COM1 --
Mechanical RS232 Port
- COM2 --
Integrated Scanner
- COM3 --
IrCOMM
- COM5 --
PortA:IrDA Multiplex
PortD:Magnetic Stripe Reader(Track 1 and 2 card reader)
PortE:Magnetic Stripe Reader(Track 2 and 3 card reader)
- COM6 -- IrDA
- COM7 -- USB (Slave port)
This device provides a method to obtain the connection status for each
COM port.
(2) Function
BOOL MpxGetPort(DWORD dwCom, DWORD *pdwPort, BOOL *pbPow,
BYTE *pbyRfStatus, BYTE *pbyInService, DWORD *pdwErr);
(3) Parameter
dwCom : Specify the port for which the connection status is to be
obtained.
1 (MPX_COM1) Get the status of COM1
2 (MPX_COM2) Get the status of COM2
5 (MPX_COM5) Get the status of COM5
6 (MPX_COM6) Get the status of COM6
pdwPort : Specify the pointer for the buffer that returns the
connection device on COM, specified in the first parameter
of dwCom.
0 (PORT_A)
3 (PORT_D)
4 (PORT_E)
pbPow : Specify the pointer for the buffer that returns the
power status of the connection device on COM, specified
in the first parameter of dwCom.
0 (POWOFF)
1 (POWON)
pdwErr : Specify the pointer for the buffer that returns the Error
Detail Code.
When the return value is FALSE, return the following Error
Detail Code.
0 (MPX_ERR_SUCCESS) No error (Successful)
101 (MPX_ERR_PARAM) Parameter error
104 (MPX_ERR_SUSPEND) The power for the device is in the
OFF status during the power supply
to the port
(5) Example
In case when getting the port status of COM5:
DWORD dwCom,dwPort,dwErr;
BOOL bPow, bRet;
Since it is not possible to simultaneously use the COM port, the following
functions are provided to select the device to be connected to the COM port.
(2) Function
BOOL MpxSetPort(DWORD dwCom, DWORD dwPort, DWORD *pdwErr);
(3) Parameter
dwCom : Specify the port.
1 (MPX_COM1) Set COM1
2 (MPX_COM2) Set COM2
5 (MPX_COM5) Set COM5
6 (MPX_COM6) Set COM6
dwPort : Specify the connection target device for COM, specified in the
first parameter of dwCom.
0 (PORT_A)
3 (PORT_D)
4 (PORT_E)
pdwErr : Specify the pointer for the buffer that returns the Error
Detail Code.
When the return value is FALSE, return the following Error
Detail Code.
0 (MPX_ERR_SUCCESS) No error (Successful)
101 (MPX_ERR_PARAM) Parameter error
102 (MPX_ERR_CONFLICT) Cannot change due to device conflicts
103 (MPX_ERR_INUSE) Cannot change since the specified COM
is occupied or is in use
104 (MPX_ERR_SUSPEND) The power to the device is in OFF status
during the power supply to the port
* Note 2
(5) Example
In case when selecting the PortD device for COM5:
DWORD dwCom,dwPort,dwErr;
BOOL bRet;
----------------------------------------------------------------------------
4.3 Device Information
----------------------------------------------------------------------------
(2) Function
(3) Parameter
0 : Success
Other : Failure
(5) Example
UNIQUEID_INFO uid;
DWORD dwRet;
dwRet=fhtGetUniqueID(&uid);
if(dwRet == 0 && uid.dwFFSError == 0){
// Display Unique ID
DWORD i;
for(i=0;i<16;i++){
printf("%02X",uid.bID[i]);
if(((i+1) % 4) == 0) printf(" ");
}
} else {
// Display Eror code
printf("Error %d %d\r\n",dwRet,dwFFSError);
}
----------------------------------------------------------------------------
4.4 USB Configuration
----------------------------------------------------------------------------
When using the USB adaptor (FHTUA571) after enabling the LAN adaptor
(FHTUL581), set the USB adaptor (FHTUA571) to enabled with any of the
above-mentioned 1) to 3) methods.
This device provides a function to set network communication with the LAN
adaptor and the USB adaptor through the application program.
(2) Function
BOOL fhtGetSetUSBMode( DWORD dwGetSetCmd,
DWORD *pdwValue,
DWORD *pdwErrDetail );
(3) Parameter
dwGetSetCmd : Specify whether to obtain or set the status of the
LAN adaptor.
0 (POW_GET_STATUS) Obtain the current setting of the
LAN adaptor
1 (POW_SET_STATUS) Set the status of the LAN adaptor
pdwValue : Specify the pointer for the buffer that stores the status
of the LAN adaptor.
When obtaining the status, the status returns to the
specified buffer.
When specifying the status, set the status to be changed.
Furthermore, the values for the LAN adaptor status are as
follows:
0 (USB_SLAVE) USB adaptor (FHTUA571) communication enabled
1 (USB_HOST) LAN adaptor (FHTUL581) communication enabled
pdwErrDetail : Specify the pointer for the buffer that stores the error
code. When NULL is specified, the error code is not
returned.
101(POW_INVALID_PARAMETER) Parameter error
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
(5) Example
In case when setting the LAN adaptor communication environment to enabled.
DWORD dwGetSetCmd,dwValue,dwErrDetail;
BOOL bRet;
The function to control the power supply on/off of the USB device is offered.
(2) Function
BOOL fhtGetSetUSBPower( DWORD dwGetSetCmd,
DWORD *pdwValue,
DWORD *pdwErrDetail );
(3) Parameter
dwGetSetCmd : Command which designates to get or set status of USB device
power ON/OFF.
0 (POW_GET_STATUS) Get status of USB device power ON/OFF
1 (POW_SET_STATUS) Set status of USB device power ON/OFF
pdwErrDetail: Specify the pointer for the buffer that stores the error
code. When NULL is specified, the error code is not
returned.
101(POW_INVALID_PARAMETER) Parameter error
102(POW_SYSTEM_ERROR) System error(Lack of resource or
others)
(5) Example
In case when it is reconnected with the USB device.
DWORD dwGetSetCmd,dwValue,dwErrDetail;
BOOL bRet;
Sleep(500);
----------------------------------------------------------------------------
4.5 initialization file function
----------------------------------------------------------------------------
[section]
key=value
¥
¥
¥
(2) Function
DWORD fhtGetPrivateProfileInt(TCHAR *pszSection, TCHAR *pszKey,
DWORD dwDefault, TCHAR *pszFile);
(3) Parameter
pszSection : Pointer to a null-terminated string specifying the name of
the section in the initialization file.
(5) Example
When obtaining the integer value correlated to "Key" within the "Section"
section of the \Temp\Sample.ini file:
DWORD dwValue;
dwValue=fhtGetPrivateProfileInt(TEXT("Section"),TEXT("Key"),1
,TEXT("\Temp\Sample.ini"));
key=string
The comment line that starts by the semicolon is deleted, and it doesn't store
it in the buffer that the pszReturnBuffer parameter indicates.
(2) Function
DWORD fhtGetPrivateProfileSection(TCHAR *pszSection, TCHAR *pszReturnBuff,
DWORD dwBuffer, TCHAR *pszFile);
(3) Parameter
pszSection : Pointer to a null-terminated string specifying the name of
the section in the initialization file.
pszReturnBuff: Pointer to a buffer that receives the key name and value
pairs associated with the named section. The buffer is
filled with one or more null-terminated strings; the last
string is followed by a second null character.
(5) Example
When getting the value correlated to all keys within the "Section" section
of the \Temp\Sample.ini file.
DWORD dwValue;
TCHAR szKey[129];
dwValue=fhtGetPrivateProfileSection(TEXT("Section"),szKey,129
,TEXT("\Temp\Sample.ini"));
[section]
key=string
¥
¥
¥
(2) Function
DWORD fhtGetPrivateProfileString(TCHAR *pszSection, TCHAR *pszKey,
TCHAR *pszDefault, TCHAR *pszReturnBuffer,
DWORD dwReturnBuffer, TCHAR *pszFile);
(3) Parameter
pszSection : Pointer to a null-terminated string that specifies the name
of the section containing the key name. If this parameter is
NULL, the fhtGetPrivateProfileString function copies all
section names in the file to the supplied buffer.
(5) Example
When getting the character string correlated to the "Key" key within the
"Section" section of the \Temp\Sample.ini file.
DWORD dwValue;
TCHAR szString[129];
dwValue=fhtGetPrivateProfileString(TEXT("Section"),
TEXT("Key"),
TEXT("Default"),
szString,
129,
TEXT("\Temp\Sample.ini"));
4.5.4 Replaces the keys and values for the specified section
----------------------------------------------------------------------------
key=string
(2) Function
BOOL fhtWritePrivateProfileSection(TCHAR *pszSection,
TCHAR *pszKeyAndValues,
TCHAR *pszFile);
(3) Parameter
pszSection : Pointer to a null-terminated string specifying the name
of the section in which data is written.
BOOL bResult;
TCHAR szKeyAndValue[129];
memset(szKeyAndValue,0,sizeof(TCHAR)* 129);
_tcscpy(szKeyAndValue,TEXT("Key1=String"));
_tcscpy(szKeyAndValue,[_tcslen(TEXT("Key1=String"))+1],TEXT(Key2=222"));
bResult=fhtWritePrivateProfileSection(TEXT("Section"),szKeyAndValue,
TEXT("\Temp\Sample.ini"));
[section]
key=string
If the pszFile parameter does not contain a full path and file name for the
file, fhtWritePrivateProfileString searches the Windows directory for the
file. If the file does not exist, this function creates the file in the
Windows directory.
(2) Function
BOOL fhtWritePrivateProfileString(TCHAR *pszSection,
TCHAR *pszKey,
TCHAR *pszString,
TCHAR *pszFile);
(3) Parameter
pszSection : Pointer to a null-terminated string containing the name of
the section to which the string will be copied. If the
section does not exist, it is created. The name of the
section is case-independent; the string can be any
combination of uppercase and lowercase letters.
(5) Example
When searching for the "Key" key of the "Section" section of the
\Temp\Sample.ini file and changing the value correlated to that key to
the specified new value.
BOOL bResult;
bResult=fhtWritePrivateProfileString(TEXT("Section"),TEXT("Key"),
TEXT("newvalue"),
TEXT("\Temp\Sample.ini"));
-------------------------------------------------------------------------------
4.6 Trace
-------------------------------------------------------------------------------
This device provides a function to output a log file for applications file.
Enter or edit the settings in the following registry to output the log.
* If no setting are entered in the registry, the device operates with
the default values listed below.
[HKEY_LOCAL_MACHINE\TEAMPADKEY\Trace]
"StringLevel"=dword:2 ;String trace level settings
"FileLog"=dword:1 ;String trace file output enabled flag
"FileName"="\Temp\TraceLog.txt" ;String trace output file name
"FileSize"=dword:200 ;String trace Max file size
; (Kbytes)
"Backup"=dword:1 ;String trace file generation
; Number of backups
[HKEY_LOCAL_MACHINE\TEAMPADKEY\Trace]
"FileName"="\FlashDisk\TraceLog.txt"
[HKEY_LOCAL_MACHINE\TEAMPADKEY\Trace]
"FileLog"=dword:0
In accordance with the settings for the specified char type String, output
the log data to the specified file.
In the case of the fhtTraceString function, output is to a file in a format
where the current date and time are added to the log. Moreover, even when
a line feed (CR+LF) is not specified, output is in a format where the line
feed code is added.
In the case of the fhtTraceString0 function, output is to the file in a
format where the specified log data remains unchanged.
(2) Function
BOOL fhtTraceString(DWORD TraceLevel, const char *pString);
BOOL fhtTraceString0(DWORD TraceLevel, const char *pString);
(3) Parameter
TraceLevel : Trace log output level (1 to 3)
When the set value level of "StringLevel" key to the registry
is the same or higher than a specified value of this parameter,
the trace log data is output to the file.
pString : Pointer to the character string for CHAR type ending in NULL,
including the format control
specifier (maximum 255 characters).
FormatString can be used in the same way as printf.
(5) Example
When carrying out output of trace log data using the fhtTraceString function.
BOOL bRet;
In accordance with the settings for the specified TCHAR type String,
output the log data to the specified file.
In the case of the fhtTraceStringW function, output is to the file in a
format where the current date and time are added to the log data.
Moreover, even when the line feed (CR+LF) is not specified,
output is in a format where the line feed code is added.
In the case of the fhtTraceStringw0 function, output is to the file in
a format where the specified log data remains unchanged.
(2) Function
BOOL fhtTraceStringW(DWORD TraceLevel, const TCHAR *pString);
BOOL fhtTraceStringW0(DWORD TraceLevel, const TCHAR *pString);
(3) Parameter
TraceLevel : Trace log output level (1 to 3)
When the set value level of "StringLevel" key to the registry
is the same or higher than a specified value of this parameter,
the trace log data is output to the file.
pString : Pointer to the character string for the TCHAR type ending in
NULL, including the format control specifier (maximum 255
characters).
FormatString can be used in the same way as wprintf.
(5) Example
When outputting trace log data using the fhtTraceStringW function.
BOOL bRet;
===============================================================================
5. API for Visual Basic.NET
===============================================================================
The method to use in Visual Basic.NET, the exclusive function library that
provides functions specific to this device, is mentioned here.
In this chapter, the method for Visual Basic.NET is noted as functions.
-------------------------------------------------------------------------------
5.1 Power Control
-------------------------------------------------------------------------------
This function is capable to enable/disable the power OFF switch through the
application program in order to prevent power OFF from careless operation of
application process.
(2) Format
Declare Function fhtGetSetPowkeyStatus Lib "fhtUpow.dll" ( _
ByVal dwGetSetCmd As Integer, _
ByRef pdwStatus As Integer, _
ByRef pdwErrDetail As Integer _
) As Boolean
(3) Parameter
dwGetSetCmd : Command which designates to get or set status of 'PWR' key
control.
0(POW_GET_STATUS) Get 'PWR' key status
1(POW_SET_STATUS) Set 'PWR' key status
pdwStatus : Buffer pointer to store 'PWR' key status.
In case of getting status, the status return to designated
buffer. In case of setting status, set the status which you
wish to set.
Values of 'PWR' key status are as follows;
0(POW_SW_DISABLE) Power off disable by 'PWR' key
1(POW_SW_ENABLE) Power off enable by 'PWR' key
pdwErrDetail: Buffer pointer to return error detail code
If you need no error detail code, you can designate Nothing.
In case that returned value is False, it returns the
following error detail code.
101 Parameter error
102 System error(Lack of resource or others)
(5) Example
In case when the 'PWR' key is disabled.
This function is capable to enter the unit into Suspend mode through
application program.
(2) Function
Declare Function fhtSetPowerDown Lib "fhtUpow.dll" ( _
ByVal dwResume As Integer, _
ByRef pdwErrDetail As Integer _
) As Boolean
(3) Parameter
dwResume : Setting of next power ON mode.
0 Resume
&H55AA55AA Warm Boot
pdwErrDetail : Buffer pointer to return error detail code
If you need no error detail code, you can designate Nothing.
In case that returned value is False, it returns the
following error detail code.
101 Parameter error
102 System error
(Lack of resource or others)
103 System busy
(Suspend can't transit)
104 'PWR' key event is masked
(5) Example
(2) Function
Declare Function fhtSetPowonSeq Lib "fhtUpow.dll" ( _
ByVal dwResume As Integer, _
ByRef pdwErrDetail As Integer _
) As Boolean
(3) Parameter
dwResume : Setting of power ON mode.
0 Resume
&H55AA55AA Warm Boot
pdwErrDetail: Buffer pointer to return error detail code
If you need no error detail code, you can designate Nothing.
In case that returned value is False, it returns the
following error detail code.
101 Parameter error
102 System error(Lack of resource or others)
(5) Example
This function has a capability to set Back light ON/OFF and to adjust
Brightness or to get their status.
(2) Function
Declare Function fhtGetSetBacklight Lib "fhtUpow.dll" ( _
ByVal dwGetSetCmd As Integer, _
ByRef pdwValue As Integer, _
ByRef pdwErrDetail As Integer _
) As Boolean
(3) Parameter
dwGetSetCmd : Command which designates to get or set status of Back light
or Contrast.
4(GET_LIGHT) Get Back light status
5(SET_LIGHT) Set Back light status
pdwValue : Buffer pointer to designate brightness value of Back light.
In case of getting status, the status returns to designated
buffer. In case of setting status, set the status which you
wish to change.
Back light value is follows;
0 Back light Off
1-128 Brightness value
pdwErrDetail: Buffer pointer to return error detail code
If you do not need error detail code, you can designate Nothing.
In case that returned value is False, it returns the follow
error detail code.
101 Parameter error
102 System error(Lack of resource or others)
(5) Example
(2) Function
Declare Function fhtBatteryGetStatus2 Lib "fhtUpow.dll" ( _
<System.Runtime.InteropServices.In(), _
System.Runtime.InteropServices.Out()> _
ByVal pSystemPowerStatusEx As SYSTEM_POWER_STATUS_EX2, _
ByRef pwCharge As Short, _
ByRef pdwErrDetail As Integer _
)As Boolean
(3) Parameter
pSystemPowerStatusEx: Pointer to structure of battery status information.
pwCharge : Pointer to the number of times for battery charge/discharge.
Note this value is not supported in TeamPad500G.
pdwErrDetail: Buffer pointer to return error detail code
If you do not need error detail code, you can designate Nothing.
In case that returned value is False, it returns the
following error detail code.
101 Parameter error
102 System error(Lack of resource or others)
(5) Example
' Crirical
Case 4
Case Else
End Select
This function has a capability to set auto power OFF function, or to get
this status.
When no activity detects in specified time, the unit will enter Suspend mode
automatically. Application can disable this automatic Suspend mode.
(2) Function
Declare Function fhtGetSetAutoPwrOff Lib "fhtUpow.dll" ( _
ByVal dwGetSetCmd As Integer, _
ByRef pdwStatus As Integer, _
ByRef pdwErrDetail As Integer _
) As Boolean
(3) Parameter
dwGetSetCmd : Command which designates to get or set status of auto
power OFF function.
0(POW_GET_STATUS) Get auto power OFF function status
1(POW_SET_STATUS) Set auto power OFF function status
pdwStatus : Designate pointer of buffer to Auto power OFF function
status.
Values of auto power OFF function status are as follows;
0(AUT_POWER_OFF) Disable Auto power OFF function
1(AUT_POWER_ON) Enable Auto power OFF function
pdwErrDetail: Buffer pointer to return error detail code.
If you do not need error detail code, you can designate Nothing.
In case that returned value is False, it returns the follow
error detail code.
101 Parameter error
102 System error(Lack of resource or others)
(5) Example
(2) Function
Declare Function fhtResumeWait Lib "fhtUpow.dll" ( _
ByRef pdwErrDetail As Integer _
) As Boolean
(3) Parameter
pdwErrDetail: Buffer pointer to return error detail code.
If you do not need error detail code, you can designate Nothing.
In case that returned value is False, it returns the follow
error detail code.
102 System error (Lack of resource or others)
103 System busy (Suspend can't transit)
(5) Example
This function stops the fhtResumeWait function which waits for resuming
(power-on).
(2) Function
(3) Parameter
pdwErrDetail: Buffer pointer to return error detail code.
If you do not need error detail code, you can designate Nothing.
In case that returned value is False, it returns the follow
error detail code.
102 System error(Lack of resource or others)
(5) Example
-------------------------------------------------------------------------------
5.2 Serial communication
-------------------------------------------------------------------------------
Serial devices can be accessed through the file I/O function. Power can be
supplied to each serial device by calling the CreateFile function,
and power can be cut-off by calling the CloseHandle function. However,
regarding the serial port wherein multiple devices can be connected
(when extended), it is necessary to use the function described in
"5.2.2 Connect Peripheral To COM Port";
keep the function selected prior to powering the serial port.
This device supports 6 serial port interfaces (COM1, COM2, COM3, COM5, COM6
and COM7).
The connections for each port are shown below.
- COM1 --
Mechanical RS232 Port
- COM2 --
Integrated Scanner
- COM3 --
IrCOMM
- COM5 --
PortA:IrDA Multiplex
PortD:Magnetic Stripe Reader(Track 1 and 2 card reader)
PortE:Magnetic Stripe Reader(Track 2 and 3 card reader)
- COM6 -- IrDA
- COM7 -- USB (Slave port)
This device provides a method to obtain the connection status for each
COM port.
(2) Function
Declare Function MpxGetPort Lib "fhtUmpx.dll" ( _
ByVal dwCom As Integer, _
ByRef pdwPort As Integer, _
ByRef pbPow As Integer, _
ByRef pbyRfStatus As Byte, _
ByRef pbyInService As Byte, _
ByRef pdwErr As Integer _
) As Boolean
(3) Parameter
dwCom : Specify the port for which the connection status is to be
obtained.
1 (MPX_COM1) Get the status of COM1
2 (MPX_COM2) Get the status of COM2
5 (MPX_COM5) Get the status of COM5
6 (MPX_COM6) Get the status of COM6
pdwPort : Specify the pointer for the buffer that returns the
connection device on COM, specified in the first parameter
of dwCom.
0 (PORT_A)
3 (PORT_D)
4 (PORT_E)
pbPow : Specify the pointer for the buffer that returns the
power status of the connection device on COM, specified
in the first parameter of dwCom.
0 (POWOFF)
1 (POWON)
pdwErr : Specify the pointer for the buffer that returns the Error
Detail Code.
When the return value is FALSE, return the following Error
Detail Code.
0 No error (Successful)
101 Parameter error
104 The power for the device is in the OFF status during
the power supply to the port
Since it is not possible to simultaneously use the COM port, the following
functions are provided to select the device to be connected to the COM port.
(3) Parameter
dwCom : Specify the port.
1 (MPX_COM1) Set COM1
2 (MPX_COM2) Set COM2
5 (MPX_COM5) Set COM5
6 (MPX_COM6) Set COM6
dwPort : Specify the connection target device for COM, specified in the
first parameter of dwCom.
0 (PORT_A)
3 (PORT_D)
4 (PORT_E)
pdwErr : Specify the pointer for the buffer that returns the Error
Detail Code.
When the return value is FALSE, return the following Error
Detail Code.
0 No error (Successful)
101 Parameter error
102 Cannot change due to device conflicts
103 Cannot change since the specified COM
is occupied or is in use
104 The power to the device is in OFF status
during the power supply to the port
* Note 2
(5) Example: In case when selecting the PortD device for COM5:
----------------------------------------------------------------------------
5.3 Device Information
----------------------------------------------------------------------------
(2) Function
(3) Parameter
0 : Success
Other : Failure
(5) Example
iReturn = cLibrary.fhtGetUniqueID(strUniqueID.Data)
If (0 = iReturn And 0 = strUniqueID.dwFFSError) Then
' Display Unique ID
For iCount = 0 To 15
Console.Write("{0:X02}", strUniqueID.bID(iCount))
If (0 = (iCount + 1) Mod 4) Then
Console.Write(" ")
End If
Next
Else
' Display Eror code
Console.WriteLine("Error {0} {1}", iReturn, strUniqueID.dwFFSError)
End If
----------------------------------------------------------------------------
5.4 USB Configuration
----------------------------------------------------------------------------
When using the USB adaptor (FHTUA571) after enabling the LAN adaptor
(FHTUL581), set the USB adaptor (FHTUA571) to enabled with any of the
above-mentioned 1) to 3) methods.
*CAUTION==================================================================*
| - When using the USB adaptor (FHTUA571), do not enable the LAN adaptor |
| (FHTUL581) using the function described in "4.4.1 Select USB Adapetor |
| /LAN Adaptor" The USB adaptor (FHTUA571) communication function |
| cannot be used when the LAN adaptor (FHTUL581) is enabled. |
*=========================================================================*
This device provides a function to set network communication with the LAN
adaptor and the USB adaptor through the application program.
(2) Function
Declare Function fhtGetSetUSBMode Lib "fhtUpow.dll" ( _
ByVal dwGetSetCmd As Integer, _
ByRef pdwValue As Integer, _
ByRef pdwErrDetail As Integer _
) As Boolean
(3) Parameter
dwGetSetCmd : Specify whether to obtain or set the status of the
LAN adaptor.
0 (POW_GET_STATUS) Obtain the current setting of the
LAN adaptor
1 (POW_SET_STATUS) Set the status of the LAN adaptor
pdwValue : Specify the pointer for the buffer that stores the status
of the LAN adaptor.
When obtaining the status, the status returns to the
specified buffer.
When specifying the status, set the status to be changed.
Furthermore, the values for the LAN adaptor status are as
follows:
0 (USB_SLAVE) USB adaptor (FHTUA571) communication enabled
1 (USB_HOST) LAN adaptor (FHTUL581) communication enabled
pdwErrDetail : Specify the pointer for the buffer that stores the error
code. When NULL is specified, the error code is not
returned.
101 Parameter error
102 System error(Lack of resource or others)
(5) Example
In case when setting the LAN adaptor communication environment to enabled.
The function to control the power supply on/off of the USB device is offered.
(2) Function
Declare Function fhtGetSetUSBPower Lib "fhtUpow.dll" ( _
ByVal dwGetSetCmd As Integer, _
ByRef pdwValue As Integer, _
ByRef pdwErrDetail As Integer _
) As Boolean
(3) Parameter
dwGetSetCmd : Command which designates to get or set status of USB device
power ON/OFF.
0 (POW_GET_STATUS) Get status of USB device power ON/OFF
1 (POW_SET_STATUS) Set status of USB device power ON/OFF
pdwErrDetail: Specify the pointer for the buffer that stores the error
code. When NULL is specified, the error code is not
returned.
101 Parameter error
102 System error(Lack of resource or others)
(5) Example
In case when it is reconnected with the USB device.
----------------------------------------------------------------------------
5.5 initialization file function
----------------------------------------------------------------------------
[section]
key=value
¥
¥
¥
(2) Function
Declare Function fhtGetPrivateProfileInt Lib "fhtUini.dll" ) _
ByVal pszSection As String, _
ByVal pszKey As String, _
ByVal dwDefault As Integer, _
ByVal pszFile As String _
) As Integer
(3) Parameter
pszSection : Pointer to a null-terminated string specifying the name of
the section in the initialization file.
pszKey : Pointer to the null-terminated string specifying the name of
the key whose value is to be retrieved.
(5) Example
When obtaining the integer value correlated to "Key" within the "Section"
section of the \Temp\Sample.ini file:
key=string
The comment line that starts by the semicolon is deleted, and it doesn't store
it in the buffer that the pszReturnBuffer parameter indicates.
(2) Function
Declare Function fhtGetPrivateProfileSection Lib "fhtUini.dll" ( _
ByVal pszSection As String, _
ByVal pszReturnBuffer As String, _
ByVal dwBuffer As Integer, _
ByVal pszFile As String _
) As Integer
(3) Parameter
pszSection : Pointer to a null-terminated string specifying the name of
the section in the initialization file.
pszReturnBuff: Pointer to a buffer that receives the key name and value
pairs associated with the named section. The buffer is
filled with one or more null-terminated strings; the last
string is followed by a second null character.
(5) Example
When getting the value correlated to all keys within the "Section" section
of the \Temp\Sample.ini file.
[section]
key=string
¥
¥
¥
(2) Function
Declare Function fhtGetPrivateProfileString Lib "fhtUini.dll" ( _
ByVal pszSection As String, _
ByVal pszKey As String, _
ByVal pszDefault As String, _
ByVal pszReturnBuffer As String, _
ByVal dwReturnBuffer As Integer, _
ByVal pszFile As String _
) As Integer
(3) Parameter
pszSection : Pointer to a null-terminated string that specifies the name
of the section containing the key name. If this parameter is
NULL, the fhtGetPrivateProfileString function copies all
section names in the file to the supplied buffer.
(5) Example
When getting the character string correlated to the "Key" key within the
"Section" section of the \Temp\Sample.ini file.
5.5.4 Replaces the keys and values for the specified section
----------------------------------------------------------------------------
key=string
The fhtWritePrivateProfileSection function is not case-sensitive; the string
pointed to by the pszSection parameter can be a combination of uppercase and
lowercase letters.
(2) Function
Declare Function fhtWritePrivateProfileSection Lib "fhtUini.dll" ( _
ByVal pszSection As String, _
ByVal pszKeysAndValues As System.Text.StringBuilder, _
ByVal pszFile As String _
) As Boolean
(3) Parameter
pszSection : Pointer to a null-terminated string specifying the name
of the section in which data is written.
(5) Example
When deleting all the keys of the "Section" section of the \Temp\Sample.ini
file, and the values correlated to that key, and changing to the specified
new key and value.
szString.Append("Key1=String")
szString.Append(Char.MinValue)
szString.Append("Key2=222")
bReturn = cLibrary.fhtWritePrivateProfileSection("Section", _
szKeyAndValue, "\Temp\Sample.ini")
5.5.5 Copies a string into the specified section
----------------------------------------------------------------------------
[section]
key=string
If the pszFile parameter does not contain a full path and file name for the
file, fhtWritePrivateProfileString searches the Windows directory for the
file. If the file does not exist, this function creates the file in the
Windows directory.
(2) Function
Declare Function fhtWritePrivateProfileString Lib "fhtUini.dll" ( _
ByVal pszSection As String, _
ByVal pszKey As String, _
ByVal pszString As String, _
ByVal pszFile As String _
) As Boolean
(3) Parameter
pszSection : Pointer to a null-terminated string containing the name of
the section to which the string will be copied. If the
section does not exist, it is created. The name of the
section is case-independent; the string can be any
combination of uppercase and lowercase letters.
(5) Example
When searching for the "Key" key of the "Section" section of the
\Temp\Sample.ini file and changing the value correlated to that key to
the specified new value.
-------------------------------------------------------------------------------
5.6 Trace
-------------------------------------------------------------------------------
This device provides a function to output a log to the application program
file.
Enter or edit the settings in the following registry to output the log.
* If no setting are entered in the registry, the device operates with
the default values listed below.
[HKEY_LOCAL_MACHINE\TEAMPADKEY\Trace]
"StringLevel"=dword:2 ;String trace level settings
"FileLog"=dword:1 ;String trace file output enabled flag
"FileName"="\Temp\TraceLog.txt" ;String trace output file name
"FileSize"=dword:200 ;String trace Max file size
; (Kbytes)
"Backup"=dword:1 ;String trace file generation
; Number of backups
[HKEY_LOCAL_MACHINE\TEAMPADKEY\Trace]
"FileName"="\FlashDisk\TraceLog.txt"
[HKEY_LOCAL_MACHINE\TEAMPADKEY\Trace]
"FileLog"=dword:0
In accordance with the settings for the specified TCHAR type String,
output the log data to the specified file.
In the case of the fhtTraceStringW function, output is to the file in a
format where the current date and time are added to the log data.
Moreover, even when the line feed (CR+LF) is not specified,
output is in a format where the line feed code is added.
In the case of the fhtTraceStringw0 function, output is to the file in
a format where the specified log data remains unchanged.
(2) Function
Declare Function fhtTraceStringW Lib "fhtUtrace.dll"( _
ByVal TraceLevel As Integer, _
ByVal pString As String _
) As Boolean
(3) Parameter
TraceLevel : Trace log output level (1 to 3)
When the specified value of this parameter ? the settings
value for the "StringLevel" key of the registry, output the
trace log data to the file.
pString : Pointer to the character string for the TCHAR type ending in
NULL, including the format control specifier (maximum 255
characters).
FormatString can be used in the same way as wprintf.
(5) Example
When outputting trace log data using the fhtTraceStringW function.
===============================================================================
6. Cautions
===============================================================================
-------------------------------------------------------------------------------
6.1 Memory Card
-------------------------------------------------------------------------------
If you turn off the TeamPad500G during Memory Card is accessed, subsequent
power ON may makes file-copy fail, the error message may be displayed.
We recommend that you restrict the power OFF by pressing 'PWR' key during
file is accessed.
"4.1.1 Enable/Disable 'PWR' key" explain how to restrict pressing 'PWR' key
to power off.
As preparation for power off during file is accessed, Please check error
after file access and if the error happens, please have retry sequence.
(3) Example of the program during file accessing (Arguments is omitted bellow)
BOOL bCopy;
.
.
Retry_Copy:
// File copy
bCopy = CopyFile(szFileName1,szFileName2,.....);
// Enable 'PWR' key
fhtGetSetPowkeyStatus(POW_SET_STATUS, POW_SW_ENABLE..)
// Error check
if(bCopy)
{
iRet = MessageBox(hWnd, ....); // Check retry
if(iRet==ID_YES) goto Retry_Copy;
}
.
.
1) "Storage Card1" folder (CF card slot on the side of the device)
It is possible to continue and use the open file handle of without
closing the handle.
2) "Storage Card2" folder (PCMCIA card slot on the upper side of the
device)
File handles are forcibly closed, it is necessary to reopen the
file to continue to use it.
b. When the device power is OFF and when replacing the CF card with one of
identical capacity made by another manufacturer:
1) "Storage Card1" folder (CF card slot on the side of the device)
Since the information on the CF card is not updated when the power
is turned ON, the information on the CF card prior to replacement
can be used.
2) "Storage Card2" folder (PCMCIA card slot on the upper side of the
device)
The information on the PCMCIA card is updated after power ON and is
updated with the information on the CF card after the replacement.
When using the card in this device, take note of the following contents.
-------------------------------------------------------------------------------
6.2 TeamPad-Explorer
-------------------------------------------------------------------------------
In case that RAM disk is initialized by battery empty and like, the below
warning message is displayed at next booting operation system.
"Warning. Power fail detected. The contents of RAM memory has been lost.
Press 'ENT'+'1' to continue."
- "date and time property" is displayed. Enter date and time again.
- Program files from back-up media (Memory Card) are copied.
- Short-cut key of Application program is restored.
- Operating environment (registry) is restored.
(*) This function is only relevant for files that are installed using "Setup
Menu". Please refer "2 Application Software Installation".
-------------------------------------------------------------------------------
6.4 When using the LAN adaptor
-------------------------------------------------------------------------------
Below is an explanation of the precautions for using the LAN adaptor over a
LAN.
It takes several seconds from that the device is attached on the LAN
adaptor to that the network connection actually is established.
Usually, it is about 5 seconds but it also depends on your environment.
(2) When there is an error in LAN communication with the LAN adaptor:
If this device is detached from the LAN adaptor and the same operation is
attempted within a short period of time, there is a possibility that
the LAN connection will fail. When the LAN connection is not possible,
reset the device.
-------------------------------------------------------------------------------
6.5 Regarding the necessity for regular rebooting of the system
-------------------------------------------------------------------------------
Memory leaks indicate that allocated memory could not be released properly.
In programs that leak memory or when the memory leaks accumulate,
the symptoms include deterioration in performance (or continuous
deterioration) to complete memory insufficiency. Even if the amount of each
memory leak is small, the memory leak accumulates and depletes the memory
with continuous operation of the resume function.
So, it is necessary to reboot the system regularly.
To avoid memory depletion from memory leaks, set a work completion button
in the application, and call the exclusive function fhtSetPowerDown()
in the reboot specification. With this, the device is rebooted when the power
is switched ON the next time.