Availability | All terminals | |||||||||||||||||||||||||||||||||||||||||||||||||||
Description |
This routine uses the OseComm protocol to transmit and receive one or more complete files through the serial
communications port that was last opened by ComOpen(). The OseComm protocol is not susceptible to timing issues, as opposed to the NetO protocol. Features of protocol version 1.01: - Fixed or Auto terminal ID - Set time - Get time - Send file to terminal - Receive file from terminal - Get OS version - Get application version - List files on the terminal - Delete files from the terminal. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
Syntax |
long OseComm(long sessionID, int terminateKey, const char *appVersion, pOnOseCommInfo OnOseCommInfo);
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
Arguments |
long sessionIDThe communication identification number for the session.The valid range is from 0 to 16.777.215 (0x000000 to 0xFFFFFF). If the sessionID supplied is -1, the sessionID will be generated by the device. int terminateKeyWhen this key is pressed the session is aborted.
const char *appVersionA string holding the application version. When no version string, or an empty version string, is used, the terminal will send a command to get the unknown application version.pOnOseCommInfo OnOseCommInfoCallback function that gets the status, error, and progress information. NULL if no callback function is used. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
OK on success or an error code (negative value) specified as follows:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
Host software |
On our web site a Windows® application, called OseComm32, can be downloaded which can be used to send and/or receive files from a host device (PC)
to an Opticon Handheld terminal using the OseComm protocol. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
Example |
#include <stdio.h> #include "lib.h" void OnOseComInfo(int status, int errorsuccess, int progress, const char *info) { switch (status) { case STAT_GET_TIME_DATE: break; case STAT_SET_TIME_DATE: break; case STAT_GET_OS_VERSION: break; case STAT_GET_APPL_VERSION: break; case STAT_XMIT_FILE_TO_PC: // if successful then delete the file if (errorsuccess == SUCC_COMPLETE) remove(info); // Delete the transfered file break; case STAT_RECV_FILE_FROM_PC: break; case STAT_LIST_FILES: break; } } void main(void) { for (;;) { if (IsCharging()) { printf("\nStart OseComm"); if (OseComm( -1L, CONNECTION_ABORT, "OseComm Example", OnOseComInfo) == COMM_OK) printf("\nOseComm Success"); else printf("\nOseComm aborted"); } Idle(); } } |