/*******************************/
/* hypeX XMODEM communication  */
/*   RS-232C version           */
/*******************************/

File sending/receiving is attempted to a hyper-terminal on PC through XMODEM communication.
Using this sample, data sending/receiving with a device supporting XMODEM can be realized.
With bi_cominit(), a RS-232C communication and Ir communication are also available.

<<<Setting on PC>>>
The following is a programming for this sample.
PC activation -> Program -> Accessory -> Hyper-terminal -> Hypertrm.exe
The process above enables to establish a file transfer between onHand/Ruputer and PC through a RS-232 cable.

If Hypertrm.exe is activated:
1. Prompts the setting for connection. Enter "hyperX."
2. In Telephone Number, RS-232C selects one from com1 to com4. (example: com1)
3. Properties for com1
	bit/sec 		38400
	data bit		8
	parity			none
	stop bit		1
	flow control	none
4. During connection, the counter at the left below of screen changes.
   PC should be waiting in this state.
5. When exiting, a message "Do you save the session, hyperX?" If you select "yes" this setting is saved for the next time you click on the icon for hyperX.

Note: if you set to serial port that is same port to PC Filer,"rupshell" process already use the port. So after terminate "rupshell" process(Alt-Ctrl-Del ->select "rupshell" to be quit.),you'll test Hypertrm.exe.


<<<Description>>>
After program activation:

"Download"... File transfer from onHand/Ruputer to PC
  (In this sample, hyperX.exf itself is transferred from onHand/Ruputer)

"Upload" ... File transfer from PC to onHand/Ruputer
  (In this sample, the data sent from PC is upload.txt 99/8/28 15:19:10 256 bytes)

"    Exit    "

(1) Select Download with the Enter key.
 Mount the device on the docking station, Select Communication (C) -> Connect (C) in the hyperterminal menu to move on to the next step.
 Select Transfer (T) -> Receive File (R) to configure as follows:

  Place Where File Is Saved (P) ... The directory to which a file is saved by onHand/Ruputer
  Protocol In Use(U) ... Xmodem

 After setting, press the Receive (R) button to display a setting screen for file names, where you can configure.
 Press the OK button to enable onHand/Ruputer to send data, which the PC receives.

(2) Select Upload with the Enter key
 Mount the device on the docking station, Select Communication (C) -> Connect (C) in the hyper-terminal menu to move on to the next step.
 Select Transfer (T) -> Send File (R) to configure as follows:

  File Name (F) ... The file name to be sent by PC
  Protocol In Use(U) ... Xmodem

 After setting, press the Send (S) button to enable PC to send data, which onHand/Ruputer receives.


<<<Source file>>>
 To the use XMODEM upload / download library module, the followings are required:
   Header   rsh.h
   Library libxmodem.a

Refer to "xmodem.c" and "makefile".

 For more information on calling upload/download on onHand/Ruputer, Refer to <RshellCommandList.txt>.

    To send a file, use dwlcall.
    int  dwlcall( char *fname );
        char  *fname;                 /* File name to be sent 	  	*/
        Return value: Normal termination 0. Other values are abnormal termination.

    To receive a file, use uplcall.
    int  uplcall( char *fname, long size, int date, int time, int attr );
        char  *fname;                 /* File name to be received 	*/
        long   size;                  /* File size     			  	*/
		int	   date;				  /* File date (Pack type)		*/
		int	   time;				  /* File time (Pack type)		*/
		int	   attr;				  /* File attribute				*/
        Return value: Normal termination 0. Other values are abnormal termination.


===============================================================================
 Copyright (c) 1998-1999.  Seiko Instruments Inc.  All rights reserved. 
===============================================================================
