IBM ECS-320A Benutzerhandbuch

Seite von 63
S
ERIAL 
I
NTERFACE 
D
EVELOPERS 
G
UIDE
 
 
possible baud rates (9600, 38400, 115200) and verifying communication status.  The remainder of the 
settings are automatically configured by the communications library. 
5 Host Side Interface 
5.1 Baud Rate 
The baud rate of the host side can be fixed to the configuration of the camera electronics or it can be 
designed to detect the active baud rate.  When opening the port on the host application side the 
function requires a baud rate parameter.  See function definition below. 
DWORD McbOpenCom(HMCBCOM* phCom, int port, int speed = 9600, LPWSTR remoteServer = NULL); 
  
Using the open handle with the desired baud rate, the host application can call the function below. 
DWORD McbDetect(HMCBCOM hCom, LPMCB_RESP_GETINFO pinfo); 
 
By verifying the return of this function it can be determined if the baud rate setting is valid.  Once it has 
been determined the connection is valid then data transfer can begin. 
5.2 Function Subset 
All of the functions contained in the Motorola communications library can be found in the ‘mcbcom.h’ 
file as well as the ‘Mcbcom.chm’ compiled HTML help file.  Only those that are typical for interfacing 
with the camera electronics will be discussed here. 
5.2.1 McbOpenCom 
This function is used to open a PC Master Communications resource to begin data transfer.  The 
pointer that is supplied is filled with a handle to the resource if successful.  That handle is used in 
every subsequent call via the library to the camera electronics. 
Function Definition:  MCBCOM_API DWORD McbOpenCom(HMCBCOM* phCom, int port, int speed = 
9600, LPWSTR remoteServer = NULL); 
5.2.2 McbCloseCom 
This function is used to close an existing PC Master communications resource.  This function should 
be called when exiting the application, or when needing to change the resource configuration (baud 
rate). 
Function Definition:  MCBCOM_API void McbCloseCom(HMCBCOM hCom); 
5.2.3 McbDetect 
Call this function to detect if the communications link to the camera electronics is successful.   
Function Definition:  MCBCOM_API DWORD McbDetect(HMCBCOM hCom, 
LPMCB_RESP_GETINFO pinfo); 
5.2.4 McbGetInfo  
Call this function to obtain information about the protocol as it exists on the camera electronics.  The 
supplied pointer is used to fill a data structure with the requested data. 
Function Definition:  MCBCOM MCBCOM_API DWORD McbGetInfo(HMCBCOM hCom, 
LPMCB_RESP_GETINFO pinfo);