AppEmit v 0.9.11 在瀏覽器調用本地應用程序 支持 調用開發串口 Pcomm.dll 支持多開跨線程異步調用

AppEmit v 0.9.11 ,  可以在 瀏覽器調用本地應用程序 支持 調用開發串口 Pcomm.dll  等 更多 主頁 下載

支持多開跨線程異步調用

解決網頁直播 ActiveX組件及dll ocx 等在Chrome、Edge新內核、360 、FireFox、IE等瀏覽器各版本中的嵌入 調用

並能在瀏覽器的js中控制 調用dll。

下面是調用 Pcomm.dll 示例 ( 若果沒有串口,可以下載 VSPD 設置 com1-com2 互相調用信息, Configure Virtual Serial Port Driver)

 

 

同時可以在js中控制,其 Pcomm.dll 的原始函數如下

The PComm serial communication library is to assist users to develop programs for serial communications for any COM port complying with Microsoft Win32 API. It can ease the implementation of multi-process and multi-thread serial communication programs and hence greatly reduce the developing time. It is suitable for all Win32 compatible COM ports. The hierarchical diagram shows the PComm Library.

Application written in PComm Application written in Win32 COMM API
PComm
Windows 9x/NT/200/XP/2003/Vista COMM API
Windows 9x/NT/2000/XP/2003/Vista Serial Device Drivers

PComm supports all Win32 platforms (including x86 and x64 platform):

 

 

/* PComm_c.h      
 * PComm define file for Win32 on C/C++
 * History:
 * Date        Author    Comment
 * 10/22/1996  Victor    wrote it.
 * 03/28/1997  Victor    modified. add sio_term_irq function.
 *                add sio_linput function.
 * 04/29/1997  Victor    modified. add sio_putb_x function.
 * 05/21/1997  Victor    modified. add sio_view function.
 * 06/13/1997  Victor    modified. add file transfer function.
 * 06/30/1997  Victor    modified. add sio_TxLowWater function.
 * 11/17/1997  Victor    add sio_AbortWrite, sio_SetWriteTimeouts
 * 11/21/1997  Victor    add sio_SetReadTimeouts, sio_AbortRead
 *                sio_GetReadTimeouts, sio_GetWriteTimeouts
 * 03/08/1998  Casper   support VB 5.0
 *
 * 04/27/1999  Casper   add sio_ActXon, sio_ActXoff, sio_break_ex
 */

/*    BAUD rate setting    */
#define B50            0x00
#define B75            0x01
#define B110        0x02
#define B134        0x03
#define B150        0x04
#define B300        0x05
#define B600        0x06
#define B1200        0x07
#define B1800        0x08
#define B2400        0x09
#define B4800        0x0A
#define B7200        0x0B
#define B9600        0x0C
#define B19200        0x0D
#define B38400        0x0E
#define B57600        0x0F
#define B115200     0x10
#define B230400     0x11
#define B460800     0x12
#define B921600     0x13

/*    MODE setting        */
#define BIT_5        0x00            /* Word length define    */
#define BIT_6        0x01
#define BIT_7        0x02
#define BIT_8        0x03

#define STOP_1        0x00            /* Stop bits define    */
#define STOP_2        0x04

#define P_EVEN        0x18            /* Parity define    */
#define P_ODD        0x08
#define P_SPC        0x38
#define P_MRK        0x28
#define P_NONE        0x00

/*    MODEM CONTROL setting    */
#define C_DTR        0x01
#define C_RTS        0x02

/*    MODEM LINE STATUS    */
#define S_CTS        0x01
#define S_DSR        0x02
#define S_RI        0x04
#define S_CD        0x08

/* error code */
#define SIO_OK        0
#define SIO_BADPORT    -1    /* no such port or port not opened */
#define SIO_OUTCONTROL    -2    /* can't control the board */
#define SIO_NODATA    -4    /* no data to read or no buffer to write */
#define SIO_OPENFAIL    -5    /* no such port or port has be opened */
#define SIO_RTS_BY_HW    -6      /* RTS can't set because H/W flowctrl */
#define SIO_BADPARM    -7    /* bad parameter */
#define SIO_WIN32FAIL    -8    /* call win32 function fail, please call */
                /* GetLastError to get the error code */
#define SIO_BOARDNOTSUPPORT -9    /* Does not support this board */
#define SIO_FAIL    -10    /* PComm function run result fail */
#define SIO_ABORTWRITE    -11    /* write has blocked, and user abort write */
#define SIO_WRITETIMEOUT    -12 /* write timeoue has happened */

/* file transfer error code */
#define SIOFT_OK    0
#define SIOFT_BADPORT    -1    /* no such port or port not open */
#define SIOFT_TIMEOUT    -2    /* protocol timeout */
#define SIOFT_ABORT    -3    /* user key abort */
#define SIOFT_FUNC    -4    /* func return abort */
#define SIOFT_FOPEN    -5    /* can not open files */
#define SIOFT_CANABORT    -6    /* Ymodem CAN signal abort */
#define SIOFT_PROTOCOL    -7    /* Protocol checking error abort */
#define SIOFT_SKIP    -8    /* Zmodem remote skip this send file */
#define SIOFT_LACKRBUF    -9    /* Zmodem Recv-Buff size must >= 2K bytes */
#define SIOFT_WIN32FAIL -10    /* OS fail */
                /* GetLastError to get the error code */
#define SIOFT_BOARDNOTSUPPORT -11       /* Does not support board */

#ifdef __cplusplus
extern "C" {
#endif

/* basic function phototype */
int  WINAPI sio_ioctl(int port, int baud, int mode);
int  WINAPI sio_getch(int port);
int  WINAPI sio_read(int port, char *buf, int len);
int  WINAPI sio_putch(int port, int term);
int  WINAPI sio_write(int port, char *buf, int len);
int  WINAPI sio_flush(int port, int func);
long WINAPI sio_iqueue(int port);
long WINAPI sio_oqueue(int port);
int  WINAPI sio_lstatus(int port);
int  WINAPI sio_lctrl(int port, int mode);
int  WINAPI sio_cnt_irq(int port, VOID (CALLBACK *func)(int port), int count);
int  WINAPI sio_modem_irq(int port, VOID (CALLBACK *func)(int port));
int  WINAPI sio_break_irq(int port, VOID (CALLBACK *func)(int port));
int  WINAPI sio_Tx_empty_irq(int port, VOID (CALLBACK *func)(int port));
int  WINAPI sio_break(int port, int time);
int  WINAPI sio_break_ex(int port, int time);
int  WINAPI sio_flowctrl(int port, int mode);
int  WINAPI sio_Tx_hold(int port);
int  WINAPI sio_close(int port);
int  WINAPI sio_open(int port);
long WINAPI sio_getbaud(int port);
int  WINAPI sio_getmode(int port);
int  WINAPI sio_getflow(int port);
int  WINAPI sio_DTR(int port, int mode);
int  WINAPI sio_RTS(int port, int mode);
int  WINAPI sio_baud(int port, long speed);
int  WINAPI sio_data_status(int port);
int  WINAPI sio_term_irq(int port, VOID (CALLBACK *func)(int port), char code);
int  WINAPI sio_linput(int port, char *buf, int lne, int term);
int  WINAPI sio_putb_x(int port, char *buf, int len, int tick);
int  WINAPI sio_putb_x_ex(int port, char *buf, int len, int tms);
int  WINAPI sio_view(int port, char *buf, int len);
int  WINAPI sio_TxLowWater(int port, int size);
int  WINAPI sio_AbortWrite(int port);
int  WINAPI sio_SetWriteTimeouts(int port, DWORD TotalTimeouts);
int  WINAPI sio_GetWriteTimeouts(int port, DWORD *TotalTimeouts);
int  WINAPI sio_SetReadTimeouts(int port, DWORD TotalTimeouts,
                DWORD IntervalTimeouts);
int  WINAPI sio_GetReadTimeouts(int port, DWORD *TotalTimeouts,
                DWORD *IntervalTimeouts);
int  WINAPI sio_AbortRead(int port);

int WINAPI sio_ActXoff(int port);
int WINAPI sio_ActXon(int port);

/* file transfer function phototype */
int WINAPI sio_FtASCIITx(int port, char *fname, int (CALLBACK *func)(long len, int rlen,
            char *buf, long flen), int key);
int WINAPI sio_FtASCIIRx(int port, char *fname, int (CALLBACK *func)(long len, int rlen,
            char *buf, long flen), int key, int sec);
int WINAPI sio_FtXmodemCheckSumTx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtXmodemCheckSumRx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtXmodemCRCTx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtXmodemCRCRx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtXmodem1KCRCTx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtXmodem1KCRCRx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtYmodemTx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtYmodemRx(int port, char **ffname, int fno,
            int (CALLBACK *func)(long len, int rlen, char *buf, long flen),
            int key);
int WINAPI sio_FtZmodemTx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtZmodemRx(int port, char **ffname, int fno,
            int (CALLBACK *func)(long len, int rlen, char *buf, long flen),
            int key);
int WINAPI sio_FtKermitTx(int port, char *fname, int (CALLBACK *func)(long len,
            int rlen, char *buf, long flen), int key);
int WINAPI sio_FtKermitRx(int port, char **ffname, int fno,
            int (CALLBACK *func)(long len, int rlen, char *buf, long flen),
            int key);

#ifdef __cplusplus
}
#endif

#define sio_putb(x, y, z) sio_write(x, y, z)

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章