Moxa UC-8418-T-CE [42/48] Uc 8400 wince application development with the sdk and software libraries

Moxa UC-8418-T-CE [42/48] Uc 8400 wince application development with the sdk and software libraries
UC-8400 WinCE Application Development with the SDK and Software Libraries
B-5
Function
void mxbuzzer_beep(HANDLE fd, int time);
Description This function regulates the buzzer.
Input <fd> Specifies the open handle of the buzzer.
<time> Specifies the amount of time (in milliseconds) that the beep lasts.
Return
None
Remarks
Function
void mxbuzzer_close(HANDLE fd);
Description This function closes the open handle of the buzzer.
Input <fd> Specifies the open handle of the buzzer.
Return None
Remarks
CANbus (UC-8418 only)
Function
int mxcan_open(int port);
Description This function open a can port by the port number.
Input <port> Port number starting from 1.
Return When successful, this function returns the handle of the open port.
When an error occurs, it returns a negative value.
Remarks For example, uses mxcan _open(1) to retrieve the interface of CAN1:
The function is equivalent Win32 CreateFile() API.
Function
int mxcan_close( int fd );
Description This function closes a CAN bus port.
Input <fd> Handle of the open port.
Return When successful, this function returns 0. When an error occurs, it returns a
negative value.
Remarks The function is equivalent Win32 CloseHandle() API.
Function
int mxcan_write( int fd, char *buffer, int size);
Description This function write data to the open port (the size should be a multiple of the
CANMSG size)
Input <fd> Handle of the open port.
<buffer> buffer point to the data
<size> size of the data (should be a multiple of the CANMSG size)
Return 0 on failure, otherwise the number of bytes written.
Remarks The function is equivalent Win32 WriteFile() API.
Function
int mxcan_read ( int fd, char *buffer, int size);
Description This function read data onto a buffer from an open port (the size should be a
multiple of the CANMSG size)
Input <fd> Handle of the open port.
<buffer> buffer point to the data
<size> size maximum size to be read (should be a multiple of the CANMSG size)
Return
0: failure. 0: no data ready. Otherwise the number of bytes read.
Remarks The function is equivalent Win32 ReadFile() API.

Содержание

Скачать