#include "pch.h"#include "framework.h"#include "CommSDK.h"#include "UsbComm.h"#include "TcpComm.h"#include "BtComm.h"#include "ComComm.h"
Enumerations | |
| enum | COMM_IDX { USB_COMM = 0 , TCP_COMM , BT_COMM , COM_COMM } |
Functions | |
| DLLEXINT | BytesAvailable () |
| Get the bytes available. | |
| DLLEXBOOL | Connected () |
| Is connected with the selected interface. | |
| DLLEXVOID | Read (byte *buffer, int size) |
| Read data through the selected interface from printer. | |
| DLLEXVOID | Write (byte *dataOut, int iDataSize) |
| Write data through the selected interface to printer. | |
| DLLEXPBYTE | WriteAndWaitForResponse (byte *dataOut, int iDataSize, int responseStartTimeOut, int responseEndTimeOut, char *completetionToken) |
| Write byte data to output stream and return data received. Data returned is any data received or up to completion token if received. Wait for response timeout before returning. | |
| DLLEXVOID | Close () |
| Disconnect the printer. | |
| DLLEXVOID | Open () |
| Open the printer through the selected interface. | |
| DLLEXVOID | SendPrintFile (char *ipAddress, char *fileName) |
| Send file through the NET. | |
| DLLEXVOID | SendPrintString (char *ipAddress, char *data, int iDataSize) |
| Send the string through the NET. | |
| DLLEXINT | GetAvailableDevices (Tuple_c **devices, int *count) |
| Return the v_id and p_id of valid devices in the format of Tuple_c {short v_id; short p_id;}. The "v_id" refers to the Vendor ID, and "p_id" refers to the Vendor ID. | |
| DLLEXVOID | UsbConnect (Tuple_c device) |
| Connect to the selected USB device. | |
| DLLEXVOID | TcpConnect (char *ipAddress, int port) |
| Connect to the selected NET device. | |
| DLLEXVOID | BtConnect (u_int64 macAddress) |
| Connect to the selected bluetooth device. | |
| DLLEXVOID | ComConnect (std::string ComPort, int BaudRate) |
| Connect to the selected COM port device. | |
| DLLEXVOID | GetComm (CObject *&ptrComm) |
| Get the pointer of communicating interface. | |
Variables | |
| CCommSDKApp | theApp |
| UsbComm | gUsbComm |
| UsbConnection | gUsbConnection |
| TcpComm | gTcpComm |
| TcpConnection | gTcpConnection |
| BtComm | gBtComm |
| BtConnection | gBtConnection |
| ComComm | gComComm |
| ComConnection | gComConnection |
| int | giComm = USB_COMM |
| enum COMM_IDX |
| DLLEXVOID BtConnect | ( | u_int64 | macAddress | ) |
| DLLEXINT BytesAvailable | ( | ) |
Get the bytes available.
| DLLEXVOID Close | ( | ) |
| DLLEXVOID ComConnect | ( | std::string | ComPort, |
| int | BaudRate ) |
Connect to the selected COM port device.
| [in] | ComPort | : COM port name |
| [in] | BaudRate | : baud rate, range (9600 bps ~ 115200 bps) |
| DLLEXBOOL Connected | ( | ) |
| DLLEXINT GetAvailableDevices | ( | Tuple_c ** | devices, |
| int * | count ) |
Return the v_id and p_id of valid devices in the format of Tuple_c {short v_id; short p_id;}. The "v_id" refers to the Vendor ID, and "p_id" refers to the Vendor ID.
| [out] | devices | : Tuple_c to storage v_id & p_id |
| [out] | count | : the count of USB device(s) |
| DLLEXVOID GetComm | ( | CObject *& | ptrComm | ) |
| DLLEXVOID Open | ( | ) |
| DLLEXVOID Read | ( | byte * | buffer, |
| int | size ) |
Read data through the selected interface from printer.
| [in] | buffer | : the buffer for to storage data |
| [in] | size | : buffer size |
| DLLEXVOID SendPrintFile | ( | char * | ipAddress, |
| char * | fileName ) |
Send file through the NET.
| [in] | ipAddress | : IP address |
| [in] | fileName | : file path |
| DLLEXVOID SendPrintString | ( | char * | ipAddress, |
| char * | data, | ||
| int | iDataSize ) |
Send the string through the NET.
| [in] | ipAddress | : IP address |
| [in] | data | : the data to the printer |
| [in] | iDataSize | : the size of data |
| DLLEXVOID TcpConnect | ( | char * | ipAddress, |
| int | port ) |
Connect to the selected NET device.
| [in] | ipAddress | : IPv4 or IPv6 address |
| [in] | port | : port number:9100 |
| DLLEXVOID UsbConnect | ( | Tuple_c | device | ) |
Connect to the selected USB device.
| [in] | devices | : Tuple_c for v_id & p_id of selected USB device |
| DLLEXVOID Write | ( | byte * | dataOut, |
| int | iDataSize ) |
Write data through the selected interface to printer.
| [in] | dataOut | : the data write to printer |
| [in] | iDataSize | : the size of data to write to printer |
| DLLEXPBYTE WriteAndWaitForResponse | ( | byte * | dataOut, |
| int | iDataSize, | ||
| int | responseStartTimeOut, | ||
| int | responseEndTimeOut, | ||
| char * | completetionToken ) |
Write byte data to output stream and return data received. Data returned is any data received or up to completion token if received. Wait for response timeout before returning.
| [in] | dataOut | : the data write to printer |
| [in] | iDataSize | : the size of data to write to printer |
| [in] | responseStartTimeOut | : Timeout to wait for first data to be received. Time to first byte |
| [in] | responseEndTimeOut | : Timeout of no new data received. Time after last byte |
| [in] | completetionToken | String token denoting the end of the response expected. This can be empty string if simply want to wait for response after writing data to connection. |
| BtComm gBtComm |
| BtConnection gBtConnection |
| ComComm gComComm |
| ComConnection gComConnection |
| int giComm = USB_COMM |
| TcpComm gTcpComm |
| TcpConnection gTcpConnection |
| UsbComm gUsbComm |
| UsbConnection gUsbConnection |
| CCommSDKApp theApp |