Compare commits
6 Commits
master
...
68e2fbfc8c
| Author | SHA1 | Date | |
|---|---|---|---|
| 68e2fbfc8c | |||
| 7d971f4d13 | |||
| 25af267b39 | |||
| 96d447fc0d | |||
| 1fa6933c18 | |||
| cfb6690df5 |
BIN
lib/autoreplyprint.jar
Normal file
BIN
lib/autoreplyprint.jar
Normal file
Binary file not shown.
@@ -0,0 +1,37 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.controller;
|
||||||
|
|
||||||
|
import com.dpkj.common.vo.Result;
|
||||||
|
import com.dpkj.modules.autoReplyPrint.service.AutoReplyPrintService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 壁挂打印机
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("autoReplyPrint")
|
||||||
|
public class AutoReplyPrintController {
|
||||||
|
@Autowired
|
||||||
|
private AutoReplyPrintService autoReplyPrintService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取打印机固件版本
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("CPPrinterGetPrinterFirmwareVersion")
|
||||||
|
public Result<?> CPPrinterGetPrinterFirmwareVersion() {
|
||||||
|
try {
|
||||||
|
return autoReplyPrintService.CPPrinterGetPrinterFirmwareVersion();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.info("获取打印机固件版本失败 {}", e.getMessage());
|
||||||
|
return Result.error("获取打印机固件版本失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dpkj.common.vo.Result;
|
||||||
|
|
||||||
|
public interface AutoReplyPrintService {
|
||||||
|
|
||||||
|
Result<?> CPPrinterGetPrinterFirmwareVersion();
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.service.impl;
|
||||||
|
|
||||||
|
import com.dpkj.common.vo.Result;
|
||||||
|
import com.dpkj.modules.autoReplyPrint.service.AutoReplyPrintService;
|
||||||
|
import com.dpkj.modules.autoReplyPrint.utils.AutoReplyPrint;
|
||||||
|
import com.dpkj.modules.autoReplyPrint.utils.AutoReplyPrint2;
|
||||||
|
import com.dpkj.modules.autoReplyPrint.utils.MyLibrary;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class AutoReplyPrintServiceImpl implements AutoReplyPrintService {
|
||||||
|
|
||||||
|
private AutoReplyPrint2.AutoReplyPrint2Sdk autoReplyPrint2Sdk = AutoReplyPrint2.getAutoReplyPrint2SDK();
|
||||||
|
|
||||||
|
public AutoReplyPrintServiceImpl() throws AutoReplyPrint2.AutoReplyPrint2RegistrationException {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<?> CPPrinterGetPrinterFirmwareVersion() {
|
||||||
|
String s = MyLibrary.INSTANCE.CP_Printer_GetPrinterFirmwareVersion();
|
||||||
|
//String s = autoReplyPrint2Sdk.CPPrinterGetPrinterFirmwareVersion();
|
||||||
|
log.info("壁挂机打印机版本信息{}", s);
|
||||||
|
return Result.ok(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,429 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.service.impl;
|
||||||
|
|
||||||
|
import com.dpkj.modules.autoReplyPrint.utils.AutoReplyPrint;
|
||||||
|
import com.dpkj.modules.autoReplyPrint.utils.TestFunction;
|
||||||
|
import com.sun.jna.Pointer;
|
||||||
|
import com.sun.jna.ptr.IntByReference;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.awt.event.MouseListener;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class samplelabel {
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
class GroupBoxPort extends JPanel implements ActionListener {
|
||||||
|
|
||||||
|
public JRadioButton rbCom = new JRadioButton();
|
||||||
|
public JRadioButton rbTcp = new JRadioButton();
|
||||||
|
public JRadioButton rbUsb = new JRadioButton();
|
||||||
|
public ButtonGroup rbGroup = new ButtonGroup();
|
||||||
|
|
||||||
|
public JComboBox cbxComName = new JComboBox();
|
||||||
|
public JComboBox cbxComBaudrate = new JComboBox();
|
||||||
|
public JTextField editIPAddress = new JTextField();
|
||||||
|
public JTextField editTcpPort = new JTextField();
|
||||||
|
public JComboBox cbxUsbName = new JComboBox();
|
||||||
|
|
||||||
|
public GroupBoxPort() {
|
||||||
|
this.setLayout(null);
|
||||||
|
this.setSize(760, 120);
|
||||||
|
this.setBorder(BorderFactory.createTitledBorder("Select Port"));
|
||||||
|
|
||||||
|
rbGroup.add(rbCom);
|
||||||
|
rbGroup.add(rbTcp);
|
||||||
|
rbGroup.add(rbUsb);
|
||||||
|
|
||||||
|
rbCom.setText("COM");
|
||||||
|
rbCom.setBounds(10, 20, 60, 30);
|
||||||
|
this.add(rbCom);
|
||||||
|
|
||||||
|
rbTcp.setText("TCP");
|
||||||
|
rbTcp.setBounds(10, 50, 60, 30);
|
||||||
|
this.add(rbTcp);
|
||||||
|
|
||||||
|
rbUsb.setText("USB");
|
||||||
|
rbUsb.setBounds(10, 80, 60, 30);
|
||||||
|
this.add(rbUsb);
|
||||||
|
|
||||||
|
cbxComName.setBounds(70, 20, 600, 30);
|
||||||
|
this.add(cbxComName);
|
||||||
|
cbxComBaudrate.setBounds(670, 20, 80, 30);
|
||||||
|
this.add(cbxComBaudrate);
|
||||||
|
editIPAddress.setBounds(70, 50, 600, 31);
|
||||||
|
this.add(editIPAddress);
|
||||||
|
editTcpPort.setBounds(670, 50, 81, 31);
|
||||||
|
this.add(editTcpPort);
|
||||||
|
cbxUsbName.setBounds(70, 80, 680, 30);
|
||||||
|
this.add(cbxUsbName);
|
||||||
|
|
||||||
|
rbUsb.setSelected(true);
|
||||||
|
editIPAddress.setText("192.168.1.87");
|
||||||
|
editTcpPort.setText("9100");
|
||||||
|
String[] ComBaudrateStringList = {"1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200",
|
||||||
|
"230400", "256000", "500000", "750000", "1125000", "1500000"};
|
||||||
|
for (String baudrate : ComBaudrateStringList)
|
||||||
|
cbxComBaudrate.addItem(baudrate);
|
||||||
|
cbxComBaudrate.setSelectedIndex(7);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
class TestForm extends JFrame implements ActionListener {
|
||||||
|
|
||||||
|
String[] testFunctionOrderedList = new String[]{
|
||||||
|
|
||||||
|
"Test_Label_SampleTicket_58MM_1",
|
||||||
|
"Test_Label_SampleTicket_80MM_1",
|
||||||
|
|
||||||
|
"Test_Port_Write",
|
||||||
|
"Test_Port_Read",
|
||||||
|
"Test_Port_Available",
|
||||||
|
"Test_Port_SkipAvailable",
|
||||||
|
"Test_Port_IsConnectionValid",
|
||||||
|
|
||||||
|
"Test_Printer_GetPrinterInfo",
|
||||||
|
"Test_Printer_ClearPrinterBuffer",
|
||||||
|
"Test_Printer_ClearPrinterError",
|
||||||
|
|
||||||
|
"Test_Pos_QueryPrintResult",
|
||||||
|
|
||||||
|
"Test_Pos_KickOutDrawer",
|
||||||
|
"Test_Pos_Beep",
|
||||||
|
|
||||||
|
"Test_Pos_PrintSelfTestPage",
|
||||||
|
|
||||||
|
"Test_Label_EnableLabelMode",
|
||||||
|
"Test_Label_DisableLabelMode",
|
||||||
|
"Test_Label_CalibrateLabel",
|
||||||
|
"Test_Label_FeedLabel",
|
||||||
|
"Test_Label_SetLabelPositionAdjustment",
|
||||||
|
"Test_Label_PageBegin_PagePrint",
|
||||||
|
"Test_Label_DrawText",
|
||||||
|
"Test_Label_DrawBarcode_UPCA",
|
||||||
|
"Test_Label_DrawBarcode_UPCE",
|
||||||
|
"Test_Label_DrawBarcode_EAN13",
|
||||||
|
"Test_Label_DrawBarcode_EAN8",
|
||||||
|
"Test_Label_DrawBarcode_CODE39",
|
||||||
|
"Test_Label_DrawBarcode_ITF",
|
||||||
|
"Test_Label_DrawBarcode_CODEBAR",
|
||||||
|
"Test_Label_DrawBarcode_CODE93",
|
||||||
|
"Test_Label_DrawBarcode_CODE128",
|
||||||
|
"Test_Label_DrawQRCode",
|
||||||
|
"Test_Label_DrawPDF417Code",
|
||||||
|
"Test_Label_DrawLine",
|
||||||
|
"Test_Label_DrawRect",
|
||||||
|
"Test_Label_DrawBox",
|
||||||
|
"Test_Label_DrawImageFromBufferedImage",
|
||||||
|
};
|
||||||
|
|
||||||
|
GroupBoxPort groupBoxPort = new GroupBoxPort();
|
||||||
|
JButton btnEnumPort = new JButton();
|
||||||
|
JButton btnOpenPort = new JButton();
|
||||||
|
JButton btnClosePort = new JButton();
|
||||||
|
JList listFunction = new JList(testFunctionOrderedList);
|
||||||
|
JScrollPane scrollFunction = new JScrollPane(listFunction);
|
||||||
|
JLabel labelFirmwareVersion = new JLabel();
|
||||||
|
JLabel labelResolution = new JLabel();
|
||||||
|
JLabel labelErrorStatus = new JLabel();
|
||||||
|
JLabel labelInfoStatus = new JLabel();
|
||||||
|
JLabel labelPrinterReceivedByteCount = new JLabel();
|
||||||
|
JLabel labelPrinterPrintedPageID = new JLabel();
|
||||||
|
Pointer h = Pointer.NULL;
|
||||||
|
AutoReplyPrint.CP_OnPortClosedEvent_Callback closed_callback = new AutoReplyPrint.CP_OnPortClosedEvent_Callback() {
|
||||||
|
@Override
|
||||||
|
public void CP_OnPortClosedEvent(Pointer handle, Pointer private_data) {
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
btnClosePort.doClick();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
AutoReplyPrint.CP_OnPrinterStatusEvent_Callback status_callback = new AutoReplyPrint.CP_OnPrinterStatusEvent_Callback() {
|
||||||
|
@Override
|
||||||
|
public void CP_OnPrinterStatusEvent(Pointer h, final long printer_error_status,
|
||||||
|
final long printer_info_status, Pointer private_data) {
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
Date calendarDate = calendar.getTime();
|
||||||
|
String time = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss").format(calendarDate);
|
||||||
|
AutoReplyPrint.CP_PrinterStatus status = new AutoReplyPrint.CP_PrinterStatus(
|
||||||
|
printer_error_status, printer_info_status);
|
||||||
|
String error_status_string = String.format(" Printer Error Status: 0x%04X",
|
||||||
|
printer_error_status & 0xffff);
|
||||||
|
if (status.ERROR_OCCURED()) {
|
||||||
|
if (status.ERROR_CUTTER())
|
||||||
|
error_status_string += "[ERROR_CUTTER]";
|
||||||
|
if (status.ERROR_FLASH())
|
||||||
|
error_status_string += "[ERROR_FLASH]";
|
||||||
|
if (status.ERROR_NOPAPER())
|
||||||
|
error_status_string += "[ERROR_NOPAPER]";
|
||||||
|
if (status.ERROR_VOLTAGE())
|
||||||
|
error_status_string += "[ERROR_VOLTAGE]";
|
||||||
|
if (status.ERROR_MARKER())
|
||||||
|
error_status_string += "[ERROR_MARKER]";
|
||||||
|
if (status.ERROR_ENGINE())
|
||||||
|
error_status_string += "[ERROR_ENGINE]";
|
||||||
|
if (status.ERROR_OVERHEAT())
|
||||||
|
error_status_string += "[ERROR_OVERHEAT]";
|
||||||
|
if (status.ERROR_COVERUP())
|
||||||
|
error_status_string += "[ERROR_COVERUP]";
|
||||||
|
if (status.ERROR_MOTOR())
|
||||||
|
error_status_string += "[ERROR_MOTOR]";
|
||||||
|
}
|
||||||
|
String info_status_string = String.format(" Printer Info Status: 0x%04X",
|
||||||
|
printer_info_status & 0xffff);
|
||||||
|
if (status.INFO_LABELMODE())
|
||||||
|
info_status_string += "[Label Mode]";
|
||||||
|
if (status.INFO_LABELPAPER())
|
||||||
|
info_status_string += "[Label Paper]";
|
||||||
|
if (status.INFO_PAPERNOFETCH())
|
||||||
|
info_status_string += "[Paper Not Fetch]";
|
||||||
|
labelErrorStatus.setText(time + error_status_string);
|
||||||
|
labelInfoStatus.setText(time + info_status_string);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
AutoReplyPrint.CP_OnPrinterReceivedEvent_Callback received_callback = new AutoReplyPrint.CP_OnPrinterReceivedEvent_Callback() {
|
||||||
|
@Override
|
||||||
|
public void CP_OnPrinterReceivedEvent(Pointer h, final int printer_received_byte_count,
|
||||||
|
Pointer private_data) {
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
Date calendarDate = calendar.getTime();
|
||||||
|
String time = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss").format(calendarDate);
|
||||||
|
labelPrinterReceivedByteCount
|
||||||
|
.setText(time + " PrinterReceived: " + printer_received_byte_count);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
AutoReplyPrint.CP_OnPrinterPrintedEvent_Callback printed_callback = new AutoReplyPrint.CP_OnPrinterPrintedEvent_Callback() {
|
||||||
|
@Override
|
||||||
|
public void CP_OnPrinterPrintedEvent(Pointer h, final int printer_printed_page_id, Pointer private_data) {
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
Date calendarDate = calendar.getTime();
|
||||||
|
String time = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss").format(calendarDate);
|
||||||
|
labelPrinterPrintedPageID.setText(time + " PrinterPrinted: " + printer_printed_page_id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private void AddCallback() {
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_AddOnPortClosedEvent(closed_callback, Pointer.NULL);
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Printer_AddOnPrinterStatusEvent(status_callback, Pointer.NULL);
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Printer_AddOnPrinterReceivedEvent(received_callback, Pointer.NULL);
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Printer_AddOnPrinterPrintedEvent(printed_callback, Pointer.NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveCallback() {
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_RemoveOnPortClosedEvent(closed_callback);
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Printer_RemoveOnPrinterStatusEvent(status_callback);
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Printer_RemoveOnPrinterReceivedEvent(received_callback);
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Printer_RemoveOnPrinterPrintedEvent(printed_callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TestForm() {
|
||||||
|
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
this.setLayout(null);
|
||||||
|
this.setVisible(true);
|
||||||
|
this.setSize(800, 700);
|
||||||
|
this.setTitle(AutoReplyPrint.INSTANCE.CP_Library_Version());
|
||||||
|
|
||||||
|
groupBoxPort.setLocation(10, 10);
|
||||||
|
this.add(groupBoxPort);
|
||||||
|
|
||||||
|
btnEnumPort.setBounds(20, 140, 240, 30);
|
||||||
|
btnEnumPort.setText("EnumPort");
|
||||||
|
btnEnumPort.addActionListener(this);
|
||||||
|
this.add(btnEnumPort);
|
||||||
|
btnOpenPort.setBounds(270, 140, 240, 30);
|
||||||
|
btnOpenPort.setText("OpenPort");
|
||||||
|
btnOpenPort.addActionListener(this);
|
||||||
|
this.add(btnOpenPort);
|
||||||
|
btnClosePort.setBounds(520, 140, 240, 30);
|
||||||
|
btnClosePort.setText("ClosePort");
|
||||||
|
btnClosePort.addActionListener(this);
|
||||||
|
this.add(btnClosePort);
|
||||||
|
|
||||||
|
labelFirmwareVersion.setBounds(20, 460, 740, 30);
|
||||||
|
labelFirmwareVersion.setText("Firmware Version:");
|
||||||
|
this.add(labelFirmwareVersion);
|
||||||
|
labelResolution.setBounds(20, 490, 740, 30);
|
||||||
|
labelResolution.setText("Resolution:");
|
||||||
|
this.add(labelResolution);
|
||||||
|
labelErrorStatus.setBounds(20, 520, 740, 30);
|
||||||
|
labelErrorStatus.setText("Error Status:");
|
||||||
|
this.add(labelErrorStatus);
|
||||||
|
labelInfoStatus.setBounds(20, 550, 740, 30);
|
||||||
|
labelInfoStatus.setText("Info Status:");
|
||||||
|
this.add(labelInfoStatus);
|
||||||
|
labelPrinterReceivedByteCount.setBounds(20, 580, 740, 30);
|
||||||
|
labelPrinterReceivedByteCount.setText("Printer Received Byte Count:");
|
||||||
|
this.add(labelPrinterReceivedByteCount);
|
||||||
|
labelPrinterPrintedPageID.setBounds(20, 610, 740, 30);
|
||||||
|
labelPrinterPrintedPageID.setText("Printer Printed Page ID:");
|
||||||
|
this.add(labelPrinterPrintedPageID);
|
||||||
|
|
||||||
|
scrollFunction.setBounds(20, 180, 740, 270);
|
||||||
|
this.add(scrollFunction);
|
||||||
|
listFunction.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
// listFunction.addListSelectionListener(this);
|
||||||
|
listFunction.addMouseListener(new MouseListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
if (e.getSource() == listFunction) {
|
||||||
|
String functionName = listFunction.getSelectedValue().toString();
|
||||||
|
if ((functionName == null) || (functionName.isEmpty()))
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
TestFunction fun = new TestFunction();
|
||||||
|
Method m = TestFunction.class.getDeclaredMethod(functionName, Pointer.class);
|
||||||
|
m.invoke(fun, h);
|
||||||
|
} catch (Throwable tr) {
|
||||||
|
tr.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseEntered(MouseEvent e) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseExited(MouseEvent e) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mousePressed(MouseEvent e) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseReleased(MouseEvent e) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
btnEnumPort.doClick();
|
||||||
|
refreshUI();
|
||||||
|
|
||||||
|
AddCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void finalize() throws Throwable {
|
||||||
|
RemoveCallback();
|
||||||
|
super.finalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == btnEnumPort) {
|
||||||
|
String[] port_list = null;
|
||||||
|
|
||||||
|
groupBoxPort.cbxComName.removeAllItems();
|
||||||
|
port_list = AutoReplyPrint.CP_Port_EnumCom_Helper.EnumCom();
|
||||||
|
if (port_list != null) {
|
||||||
|
for (String port : port_list)
|
||||||
|
groupBoxPort.cbxComName.addItem(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
groupBoxPort.cbxUsbName.removeAllItems();
|
||||||
|
port_list = AutoReplyPrint.CP_Port_EnumUsb_Helper.EnumUsb();
|
||||||
|
if (port_list != null) {
|
||||||
|
for (String port : port_list)
|
||||||
|
groupBoxPort.cbxUsbName.addItem(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (e.getSource() == btnOpenPort) {
|
||||||
|
if (groupBoxPort.rbCom.isSelected()) {
|
||||||
|
if (groupBoxPort.cbxComName.getSelectedItem() == null)
|
||||||
|
return;
|
||||||
|
String name = groupBoxPort.cbxComName.getSelectedItem().toString();
|
||||||
|
int baudrate = Integer.parseInt(groupBoxPort.cbxComBaudrate.getSelectedItem().toString());
|
||||||
|
h = AutoReplyPrint.INSTANCE.CP_Port_OpenCom(name, baudrate, AutoReplyPrint.CP_ComDataBits_8,
|
||||||
|
AutoReplyPrint.CP_ComParity_NoParity, AutoReplyPrint.CP_ComStopBits_One, AutoReplyPrint.CP_ComFlowControl_None,
|
||||||
|
1);
|
||||||
|
} else if (groupBoxPort.rbUsb.isSelected()) {
|
||||||
|
if (groupBoxPort.cbxUsbName.getSelectedItem() == null)
|
||||||
|
return;
|
||||||
|
String name = groupBoxPort.cbxUsbName.getSelectedItem().toString();
|
||||||
|
h = AutoReplyPrint.INSTANCE.CP_Port_OpenUsb(name, 1);
|
||||||
|
} else if (groupBoxPort.rbTcp.isSelected()) {
|
||||||
|
String ip = groupBoxPort.editIPAddress.getText();
|
||||||
|
int port = Integer.parseInt(groupBoxPort.editTcpPort.getText());
|
||||||
|
h = AutoReplyPrint.INSTANCE.CP_Port_OpenTcp(null, ip, (short) port, 5000, 1);
|
||||||
|
}
|
||||||
|
refreshUI();
|
||||||
|
} else if (e.getSource() == btnClosePort) {
|
||||||
|
if (h != Pointer.NULL) {
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_Close(h);
|
||||||
|
h = Pointer.NULL;
|
||||||
|
}
|
||||||
|
refreshUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshUI() {
|
||||||
|
groupBoxPort.setEnabled(h == Pointer.NULL);
|
||||||
|
btnEnumPort.setEnabled(h == Pointer.NULL);
|
||||||
|
btnOpenPort.setEnabled(h == Pointer.NULL);
|
||||||
|
btnClosePort.setEnabled(h != Pointer.NULL);
|
||||||
|
listFunction.setEnabled(h != Pointer.NULL);
|
||||||
|
if (h != Pointer.NULL) {
|
||||||
|
labelFirmwareVersion.setText("Firmware Version: "
|
||||||
|
+ AutoReplyPrint.CP_Printer_GetPrinterFirmwareVersion_Helper.GetPrinterFirmwareVersion(h));
|
||||||
|
IntByReference width_mm = new IntByReference();
|
||||||
|
IntByReference height_mm = new IntByReference();
|
||||||
|
IntByReference dots_per_mm = new IntByReference();
|
||||||
|
if (AutoReplyPrint.INSTANCE.CP_Printer_GetPrinterResolutionInfo(h, width_mm, height_mm, dots_per_mm)) {
|
||||||
|
labelResolution.setText("Resolution: " + "width:" + width_mm.getValue() + "mm " + "height:"
|
||||||
|
+ height_mm.getValue() + "mm " + "dots_per_mm:" + dots_per_mm.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static TestForm testform;
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
testform = new samplelabel().new TestForm();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,849 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.utils;
|
||||||
|
|
||||||
|
import com.sun.jna.*;
|
||||||
|
import com.sun.jna.ptr.DoubleByReference;
|
||||||
|
import com.sun.jna.ptr.IntByReference;
|
||||||
|
import com.sun.jna.ptr.LongByReference;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
||||||
|
public interface AutoReplyPrint extends Library {
|
||||||
|
AutoReplyPrint INSTANCE = (AutoReplyPrint) Native.loadLibrary(GetLibraryPath_Helper.GetLibraryPath(), AutoReplyPrint.class);
|
||||||
|
int CP_ComDataBits_4 = 4;
|
||||||
|
int CP_ComDataBits_5 = 5;
|
||||||
|
int CP_ComDataBits_6 = 6;
|
||||||
|
int CP_ComDataBits_7 = 7;
|
||||||
|
int CP_ComDataBits_8 = 8;
|
||||||
|
int CP_ComParity_NoParity = 0;
|
||||||
|
int CP_ComParity_OddParity = 1;
|
||||||
|
int CP_ComParity_EvenParity = 2;
|
||||||
|
int CP_ComParity_MarkParity = 3;
|
||||||
|
int CP_ComParity_SpaceParity = 4;
|
||||||
|
int CP_ComStopBits_One = 0;
|
||||||
|
int CP_ComStopBits_OnePointFive = 1;
|
||||||
|
int CP_ComStopBits_Two = 2;
|
||||||
|
int CP_ComFlowControl_None = 0;
|
||||||
|
int CP_ComFlowControl_XonXoff = 1;
|
||||||
|
int CP_ComFlowControl_RtsCts = 2;
|
||||||
|
int CP_ComFlowControl_DtrDsr = 3;
|
||||||
|
int CP_CharacterSet_USA = 0;
|
||||||
|
int CP_CharacterSet_FRANCE = 1;
|
||||||
|
int CP_CharacterSet_GERMANY = 2;
|
||||||
|
int CP_CharacterSet_UK = 3;
|
||||||
|
int CP_CharacterSet_DENMARK_I = 4;
|
||||||
|
int CP_CharacterSet_SWEDEN = 5;
|
||||||
|
int CP_CharacterSet_ITALY = 6;
|
||||||
|
int CP_CharacterSet_SPAIN_I = 7;
|
||||||
|
int CP_CharacterSet_JAPAN = 8;
|
||||||
|
int CP_CharacterSet_NORWAY = 9;
|
||||||
|
int CP_CharacterSet_DENMARK_II = 10;
|
||||||
|
int CP_CharacterSet_SPAIN_II = 11;
|
||||||
|
int CP_CharacterSet_LATIN = 12;
|
||||||
|
int CP_CharacterSet_KOREA = 13;
|
||||||
|
int CP_CharacterSet_SLOVENIA = 14;
|
||||||
|
int CP_CharacterSet_CHINA = 15;
|
||||||
|
int CP_CharacterCodepage_CP437 = 0;
|
||||||
|
int CP_CharacterCodepage_KATAKANA = 1;
|
||||||
|
int CP_CharacterCodepage_CP850 = 2;
|
||||||
|
int CP_CharacterCodepage_CP860 = 3;
|
||||||
|
int CP_CharacterCodepage_CP863 = 4;
|
||||||
|
int CP_CharacterCodepage_CP865 = 5;
|
||||||
|
int CP_CharacterCodepage_WCP1251 = 6;
|
||||||
|
int CP_CharacterCodepage_CP866 = 7;
|
||||||
|
int CP_CharacterCodepage_MIK = 8;
|
||||||
|
int CP_CharacterCodepage_CP755 = 9;
|
||||||
|
int CP_CharacterCodepage_IRAN = 10;
|
||||||
|
int CP_CharacterCodepage_CP862 = 15;
|
||||||
|
int CP_CharacterCodepage_WCP1252 = 16;
|
||||||
|
int CP_CharacterCodepage_WCP1253 = 17;
|
||||||
|
int CP_CharacterCodepage_CP852 = 18;
|
||||||
|
int CP_CharacterCodepage_CP858 = 19;
|
||||||
|
int CP_CharacterCodepage_IRAN_II = 20;
|
||||||
|
int CP_CharacterCodepage_LATVIAN = 21;
|
||||||
|
int CP_CharacterCodepage_CP864 = 22;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_1 = 23;
|
||||||
|
int CP_CharacterCodepage_CP737 = 24;
|
||||||
|
int CP_CharacterCodepage_WCP1257 = 25;
|
||||||
|
int CP_CharacterCodepage_THAI = 26;
|
||||||
|
int CP_CharacterCodepage_CP720 = 27;
|
||||||
|
int CP_CharacterCodepage_CP855 = 28;
|
||||||
|
int CP_CharacterCodepage_CP857 = 29;
|
||||||
|
int CP_CharacterCodepage_WCP1250 = 30;
|
||||||
|
int CP_CharacterCodepage_CP775 = 31;
|
||||||
|
int CP_CharacterCodepage_WCP1254 = 32;
|
||||||
|
int CP_CharacterCodepage_WCP1255 = 33;
|
||||||
|
int CP_CharacterCodepage_WCP1256 = 34;
|
||||||
|
int CP_CharacterCodepage_WCP1258 = 35;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_2 = 36;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_3 = 37;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_4 = 38;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_5 = 39;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_6 = 40;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_7 = 41;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_8 = 42;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_9 = 43;
|
||||||
|
int CP_CharacterCodepage_ISO_8859_15 = 44;
|
||||||
|
int CP_CharacterCodepage_THAI_2 = 45;
|
||||||
|
int CP_CharacterCodepage_CP856 = 46;
|
||||||
|
int CP_CharacterCodepage_CP874 = 47;
|
||||||
|
int CP_CharacterCodepage_TCVN3 = 48;
|
||||||
|
int CP_MultiByteEncoding_GBK = 0;
|
||||||
|
int CP_MultiByteEncoding_UTF8 = 1;
|
||||||
|
int CP_MultiByteEncoding_BIG5 = 3;
|
||||||
|
int CP_MultiByteEncoding_ShiftJIS = 4;
|
||||||
|
int CP_MultiByteEncoding_EUCKR = 5;
|
||||||
|
int CP_ImageBinarizationMethod_Dithering = 0;
|
||||||
|
int CP_ImageBinarizationMethod_Thresholding = 1;
|
||||||
|
int CP_ImageBinarizationMethod_ErrorDiffusion = 2;
|
||||||
|
int CP_ImageCompressionMethod_None = 0;
|
||||||
|
int CP_ImageCompressionMethod_Level1 = 1;
|
||||||
|
int CP_ImageCompressionMethod_Level2 = 2;
|
||||||
|
int CP_ImagePixelsFormat_MONO = 1;
|
||||||
|
int CP_ImagePixelsFormat_MONOLSB = 2;
|
||||||
|
int CP_ImagePixelsFormat_GRAY8 = 3;
|
||||||
|
int CP_ImagePixelsFormat_BYTEORDERED_RGB24 = 4;
|
||||||
|
int CP_ImagePixelsFormat_BYTEORDERED_BGR24 = 5;
|
||||||
|
int CP_ImagePixelsFormat_BYTEORDERED_ARGB32 = 6;
|
||||||
|
int CP_ImagePixelsFormat_BYTEORDERED_RGBA32 = 7;
|
||||||
|
int CP_ImagePixelsFormat_BYTEORDERED_ABGR32 = 8;
|
||||||
|
int CP_ImagePixelsFormat_BYTEORDERED_BGRA32 = 9;
|
||||||
|
int CP_QRCodeECC_L = 1;
|
||||||
|
int CP_QRCodeECC_M = 2;
|
||||||
|
int CP_QRCodeECC_Q = 3;
|
||||||
|
int CP_QRCodeECC_H = 4;
|
||||||
|
int CP_Pos_Alignment_Left = 0;
|
||||||
|
int CP_Pos_Alignment_HCenter = 1;
|
||||||
|
int CP_Pos_Alignment_Right = 2;
|
||||||
|
int CP_Pos_BarcodeType_UPCA = 65;
|
||||||
|
int CP_Pos_BarcodeType_UPCE = 66;
|
||||||
|
int CP_Pos_BarcodeType_EAN13 = 67;
|
||||||
|
int CP_Pos_BarcodeType_EAN8 = 68;
|
||||||
|
int CP_Pos_BarcodeType_CODE39 = 69;
|
||||||
|
int CP_Pos_BarcodeType_ITF = 70;
|
||||||
|
int CP_Pos_BarcodeType_CODEBAR = 71;
|
||||||
|
int CP_Pos_BarcodeType_CODE93 = 72;
|
||||||
|
int CP_Pos_BarcodeType_CODE128 = 73;
|
||||||
|
int CP_Pos_BarcodeTextPrintPosition_None = 0;
|
||||||
|
int CP_Pos_BarcodeTextPrintPosition_AboveBarcode = 1;
|
||||||
|
int CP_Pos_BarcodeTextPrintPosition_BelowBarcode = 2;
|
||||||
|
int CP_Pos_BarcodeTextPrintPosition_AboveAndBelowBarcode = 3;
|
||||||
|
int CP_Page_DrawDirection_LeftToRight = 0;
|
||||||
|
int CP_Page_DrawDirection_BottomToTop = 1;
|
||||||
|
int CP_Page_DrawDirection_RightToLeft = 2;
|
||||||
|
int CP_Page_DrawDirection_TopToBottom = 3;
|
||||||
|
int CP_Page_DrawAlignment_Left = -1;
|
||||||
|
int CP_Page_DrawAlignment_HCenter = -2;
|
||||||
|
int CP_Page_DrawAlignment_Right = -3;
|
||||||
|
int CP_Page_DrawAlignment_Top = -1;
|
||||||
|
int CP_Page_DrawAlignment_VCenter = -2;
|
||||||
|
int CP_Page_DrawAlignment_Bottom = -3;
|
||||||
|
int CP_Label_BarcodeType_UPCA = 0;
|
||||||
|
int CP_Label_BarcodeType_UPCE = 1;
|
||||||
|
int CP_Label_BarcodeType_EAN13 = 2;
|
||||||
|
int CP_Label_BarcodeType_EAN8 = 3;
|
||||||
|
int CP_Label_BarcodeType_CODE39 = 4;
|
||||||
|
int CP_Label_BarcodeType_ITF = 5;
|
||||||
|
int CP_Label_BarcodeType_CODEBAR = 6;
|
||||||
|
int CP_Label_BarcodeType_CODE93 = 7;
|
||||||
|
int CP_Label_BarcodeType_CODE128 = 8;
|
||||||
|
int CP_Label_BarcodeType_CODE11 = 9;
|
||||||
|
int CP_Label_BarcodeType_MSI = 10;
|
||||||
|
int CP_Label_BarcodeType_128M = 11;
|
||||||
|
int CP_Label_BarcodeType_EAN128 = 12;
|
||||||
|
int CP_Label_BarcodeType_25C = 13;
|
||||||
|
int CP_Label_BarcodeType_39C = 14;
|
||||||
|
int CP_Label_BarcodeType_39 = 15;
|
||||||
|
int CP_Label_BarcodeType_EAN13PLUS2 = 16;
|
||||||
|
int CP_Label_BarcodeType_EAN13PLUS5 = 17;
|
||||||
|
int CP_Label_BarcodeType_EAN8PLUS2 = 18;
|
||||||
|
int CP_Label_BarcodeType_EAN8PLUS5 = 19;
|
||||||
|
int CP_Label_BarcodeType_POST = 20;
|
||||||
|
int CP_Label_BarcodeType_UPCAPLUS2 = 21;
|
||||||
|
int CP_Label_BarcodeType_UPCAPLUS5 = 22;
|
||||||
|
int CP_Label_BarcodeType_UPCEPLUS2 = 23;
|
||||||
|
int CP_Label_BarcodeType_UPCEPLUS5 = 24;
|
||||||
|
int CP_Label_BarcodeType_CPOST = 25;
|
||||||
|
int CP_Label_BarcodeType_MSIC = 26;
|
||||||
|
int CP_Label_BarcodeType_PLESSEY = 27;
|
||||||
|
int CP_Label_BarcodeType_ITF14 = 28;
|
||||||
|
int CP_Label_BarcodeType_EAN14 = 29;
|
||||||
|
int CP_Label_BarcodeTextPrintPosition_None = 0;
|
||||||
|
int CP_Label_BarcodeTextPrintPosition_AboveBarcode = 1;
|
||||||
|
int CP_Label_BarcodeTextPrintPosition_BelowBarcode = 2;
|
||||||
|
int CP_Label_BarcodeTextPrintPosition_AboveAndBelowBarcode = 3;
|
||||||
|
int CP_Label_Rotation_0 = 0;
|
||||||
|
int CP_Label_Rotation_90 = 1;
|
||||||
|
int CP_Label_Rotation_180 = 2;
|
||||||
|
int CP_Label_Rotation_270 = 3;
|
||||||
|
int CP_Label_Color_White = 0;
|
||||||
|
int CP_Label_Color_Black = 1;
|
||||||
|
|
||||||
|
String CP_Library_Version();
|
||||||
|
|
||||||
|
int CP_Port_EnumCom(byte[] var1, int var2, IntByReference var3);
|
||||||
|
|
||||||
|
int CP_Port_EnumLpt(byte[] var1, int var2, IntByReference var3);
|
||||||
|
|
||||||
|
int CP_Port_EnumUsb(byte[] var1, int var2, IntByReference var3);
|
||||||
|
|
||||||
|
void CP_Port_EnumNetPrinter(int var1, IntByReference var2, CP_OnNetPrinterDiscovered_Callback var3, Pointer var4);
|
||||||
|
|
||||||
|
void CP_Port_EnumBtDevice(int var1, IntByReference var2, CP_OnBluetoothDeviceDiscovered_Callback var3, Pointer var4);
|
||||||
|
|
||||||
|
void CP_Port_EnumBleDevice(int var1, IntByReference var2, CP_OnBluetoothDeviceDiscovered_Callback var3, Pointer var4);
|
||||||
|
|
||||||
|
Pointer CP_Port_OpenCom(String var1, int var2, int var3, int var4, int var5, int var6, int var7);
|
||||||
|
|
||||||
|
Pointer CP_Port_OpenLpt(String var1);
|
||||||
|
|
||||||
|
Pointer CP_Port_OpenUsb(String var1, int var2);
|
||||||
|
|
||||||
|
Pointer CP_Port_OpenTcp(String var1, String var2, short var3, int var4, int var5);
|
||||||
|
|
||||||
|
Pointer CP_Port_OpenBtSpp(String var1, int var2);
|
||||||
|
|
||||||
|
Pointer CP_Port_OpenBtBle(String var1, int var2);
|
||||||
|
|
||||||
|
int CP_Port_Write(Pointer var1, byte[] var2, int var3, int var4);
|
||||||
|
|
||||||
|
int CP_Port_Read(Pointer var1, byte[] var2, int var3, int var4);
|
||||||
|
|
||||||
|
int CP_Port_ReadUntilByte(Pointer var1, byte[] var2, int var3, int var4, byte var5);
|
||||||
|
|
||||||
|
int CP_Port_Available(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Port_SkipAvailable(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Port_IsConnectionValid(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Port_IsOpened(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Port_Close(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Port_AddOnPortOpenedEvent(CP_OnPortOpenedEvent_Callback var1, Pointer var2);
|
||||||
|
|
||||||
|
boolean CP_Port_AddOnPortOpenFailedEvent(CP_OnPortOpenFailedEvent_Callback var1, Pointer var2);
|
||||||
|
|
||||||
|
boolean CP_Port_AddOnPortClosedEvent(CP_OnPortClosedEvent_Callback var1, Pointer var2);
|
||||||
|
|
||||||
|
boolean CP_Port_AddOnPortWrittenEvent(CP_OnPortWrittenEvent_Callback var1, Pointer var2);
|
||||||
|
|
||||||
|
boolean CP_Port_AddOnPortReceivedEvent(CP_OnPortReceivedEvent_Callback var1, Pointer var2);
|
||||||
|
|
||||||
|
boolean CP_Port_RemoveOnPortOpenedEvent(CP_OnPortOpenedEvent_Callback var1);
|
||||||
|
|
||||||
|
boolean CP_Port_RemoveOnPortOpenFailedEvent(CP_OnPortOpenFailedEvent_Callback var1);
|
||||||
|
|
||||||
|
boolean CP_Port_RemoveOnPortClosedEvent(CP_OnPortClosedEvent_Callback var1);
|
||||||
|
|
||||||
|
boolean CP_Port_RemoveOnPortWrittenEvent(CP_OnPortWrittenEvent_Callback var1);
|
||||||
|
|
||||||
|
boolean CP_Port_RemoveOnPortReceivedEvent(CP_OnPortReceivedEvent_Callback var1);
|
||||||
|
|
||||||
|
boolean CP_Printer_AddOnPrinterStatusEvent(CP_OnPrinterStatusEvent_Callback var1, Pointer var2);
|
||||||
|
|
||||||
|
boolean CP_Printer_AddOnPrinterReceivedEvent(CP_OnPrinterReceivedEvent_Callback var1, Pointer var2);
|
||||||
|
|
||||||
|
boolean CP_Printer_AddOnPrinterPrintedEvent(CP_OnPrinterPrintedEvent_Callback var1, Pointer var2);
|
||||||
|
|
||||||
|
boolean CP_Printer_RemoveOnPrinterStatusEvent(CP_OnPrinterStatusEvent_Callback var1);
|
||||||
|
|
||||||
|
boolean CP_Printer_RemoveOnPrinterReceivedEvent(CP_OnPrinterReceivedEvent_Callback var1);
|
||||||
|
|
||||||
|
boolean CP_Printer_RemoveOnPrinterPrintedEvent(CP_OnPrinterPrintedEvent_Callback var1);
|
||||||
|
|
||||||
|
boolean CP_Printer_GetPrinterResolutionInfo(Pointer var1, IntByReference var2, IntByReference var3, IntByReference var4);
|
||||||
|
|
||||||
|
boolean CP_Printer_GetPrinterFirmwareVersion(Pointer var1, byte[] var2, int var3, IntByReference var4);
|
||||||
|
|
||||||
|
boolean CP_Printer_GetPrinterStatusInfo(Pointer var1, LongByReference var2, LongByReference var3, LongByReference var4);
|
||||||
|
|
||||||
|
boolean CP_Printer_GetPrinterReceivedInfo(Pointer var1, IntByReference var2, LongByReference var3);
|
||||||
|
|
||||||
|
boolean CP_Printer_GetPrinterPrintedInfo(Pointer var1, IntByReference var2, LongByReference var3);
|
||||||
|
|
||||||
|
boolean CP_Printer_GetPrinterLabelPositionAdjustmentInfo(Pointer var1, DoubleByReference var2, DoubleByReference var3, LongByReference var4);
|
||||||
|
|
||||||
|
boolean CP_Printer_SetPrinterLabelPositionAdjustmentInfo(Pointer var1, double var2, double var4);
|
||||||
|
|
||||||
|
boolean CP_Printer_ClearPrinterBuffer(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Printer_ClearPrinterError(Pointer var1);
|
||||||
|
|
||||||
|
int CP_Pos_QueryRTStatus(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_QueryPrintResult(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_KickOutDrawer(Pointer var1, int var2, int var3, int var4);
|
||||||
|
|
||||||
|
boolean CP_Pos_Beep(Pointer var1, int var2, int var3);
|
||||||
|
|
||||||
|
boolean CP_Pos_FeedAndHalfCutPaper(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Pos_FullCutPaper(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Pos_HalfCutPaper(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Pos_FeedLine(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_FeedDot(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintSelfTestPage(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintText(Pointer var1, String var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintTextInUTF8(Pointer var1, WString var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintTextInGBK(Pointer var1, WString var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintTextInBIG5(Pointer var1, WString var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintTextInShiftJIS(Pointer var1, WString var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintTextInEUCKR(Pointer var1, WString var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintBarcode(Pointer var1, int var2, String var3);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintBarcode_Code128Auto(Pointer var1, String var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintQRCode(Pointer var1, int var2, int var3, String var4);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintQRCodeUseEpsonCmd(Pointer var1, int var2, int var3, String var4);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintDoubleQRCode(Pointer var1, int var2, int var3, int var4, int var5, String var6, int var7, int var8, int var9, String var10);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintPDF417BarcodeUseEpsonCmd(Pointer var1, int var2, int var3, int var4, int var5, int var6, int var7, String var8);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintRasterImageFromFile(Pointer var1, int var2, int var3, String var4, int var5, int var6);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintRasterImageFromData(Pointer var1, int var2, int var3, byte[] var4, int var5, int var6, int var7);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintRasterImageFromPixels(Pointer var1, byte[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintHorizontalLine(Pointer var1, int var2, int var3);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintHorizontalLineSpecifyThickness(Pointer var1, int var2, int var3, int var4);
|
||||||
|
|
||||||
|
boolean CP_Pos_PrintMultipleHorizontalLinesAtOneRow(Pointer var1, int var2, int[] var3, int[] var4);
|
||||||
|
|
||||||
|
boolean CP_Pos_ResetPrinter(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetPrintSpeed(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetPrintDensity(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetSingleByteMode(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetCharacterSet(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetCharacterCodepage(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetMultiByteMode(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetMultiByteEncoding(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetMovementUnit(Pointer var1, int var2, int var3);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetPrintAreaLeftMargin(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetPrintAreaWidth(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetHorizontalAbsolutePrintPosition(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetHorizontalRelativePrintPosition(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetVerticalAbsolutePrintPosition(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetVerticalRelativePrintPosition(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetAlignment(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetTextScale(Pointer var1, int var2, int var3);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetAsciiTextFontType(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetTextBold(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetTextUnderline(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetTextUpsideDown(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetTextWhiteOnBlack(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetTextRotate(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetTextLineHeight(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetAsciiTextCharRightSpacing(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetKanjiTextCharSpacing(Pointer var1, int var2, int var3);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetBarcodeUnitWidth(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetBarcodeHeight(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetBarcodeReadableTextFontType(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Pos_SetBarcodeReadableTextPosition(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Page_SelectPageMode(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Page_SelectPageModeEx(Pointer var1, int var2, int var3, int var4, int var5, int var6, int var7);
|
||||||
|
|
||||||
|
boolean CP_Page_ExitPageMode(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Page_PrintPage(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Page_ClearPage(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Page_SetPageArea(Pointer var1, int var2, int var3, int var4, int var5);
|
||||||
|
|
||||||
|
boolean CP_Page_SetPageDrawDirection(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawRect(Pointer var1, int var2, int var3, int var4, int var5, int var6);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawBox(Pointer var1, int var2, int var3, int var4, int var5, int var6, int var7);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawText(Pointer var1, int var2, int var3, String var4);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawTextInUTF8(Pointer var1, int var2, int var3, WString var4);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawTextInGBK(Pointer var1, int var2, int var3, WString var4);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawTextInBIG5(Pointer var1, int var2, int var3, WString var4);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawTextInShiftJIS(Pointer var1, int var2, int var3, WString var4);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawTextInEUCKR(Pointer var1, int var2, int var3, WString var4);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawBarcode(Pointer var1, int var2, int var3, int var4, String var5);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawQRCode(Pointer var1, int var2, int var3, int var4, int var5, String var6);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawRasterImageFromFile(Pointer var1, int var2, int var3, int var4, int var5, String var6, int var7);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawRasterImageFromData(Pointer var1, int var2, int var3, int var4, int var5, byte[] var6, int var7, int var8);
|
||||||
|
|
||||||
|
boolean CP_Page_DrawRasterImageFromPixels(Pointer var1, int var2, int var3, byte[] var4, int var5, int var6, int var7, int var8, int var9, int var10);
|
||||||
|
|
||||||
|
boolean CP_BlackMark_EnableBlackMarkMode(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_BlackMark_DisableBlackMarkMode(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_BlackMark_SetBlackMarkMaxFindLength(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_BlackMark_FindNextBlackMark(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_BlackMark_SetBlackMarkPaperPrintPosition(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_BlackMark_SetBlackMarkPaperCutPosition(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_BlackMark_FullCutBlackMarkPaper(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_BlackMark_HalfCutBlackMarkPaper(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Label_EnableLabelMode(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Label_DisableLabelMode(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Label_CalibrateLabel(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Label_FeedLabel(Pointer var1);
|
||||||
|
|
||||||
|
boolean CP_Label_PageBegin(Pointer var1, int var2, int var3, int var4, int var5, int var6);
|
||||||
|
|
||||||
|
boolean CP_Label_PagePrint(Pointer var1, int var2);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawText(Pointer var1, int var2, int var3, int var4, int var5, String var6);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawTextInUTF8(Pointer var1, int var2, int var3, int var4, int var5, WString var6);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawTextInGBK(Pointer var1, int var2, int var3, int var4, int var5, WString var6);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawBarcode(Pointer var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, String var9);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawQRCode(Pointer var1, int var2, int var3, int var4, int var5, int var6, int var7, String var8);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawPDF417Code(Pointer var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, String var9);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawImageFromFile(Pointer var1, int var2, int var3, int var4, int var5, String var6, int var7, int var8);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawImageFromData(Pointer var1, int var2, int var3, int var4, int var5, byte[] var6, int var7, int var8, int var9);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawImageFromPixels(Pointer var1, int var2, int var3, byte[] var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawLine(Pointer var1, int var2, int var3, int var4, int var5, int var6, int var7);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawRect(Pointer var1, int var2, int var3, int var4, int var5, int var6);
|
||||||
|
|
||||||
|
boolean CP_Label_DrawBox(Pointer var1, int var2, int var3, int var4, int var5, int var6, int var7);
|
||||||
|
|
||||||
|
int CP_Proto_QueryBatteryLevel(Pointer var1, int var2);
|
||||||
|
|
||||||
|
public static class CP_Label_DrawImageFromData_Helper {
|
||||||
|
public CP_Label_DrawImageFromData_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean DrawImageFromBufferedImage(Pointer handle, int x, int y, int dstw, int dsth, BufferedImage image, int binaryzation_method, int compression_method) {
|
||||||
|
boolean result = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||||
|
ImageIO.write(image, "png", os);
|
||||||
|
byte[] data = os.toByteArray();
|
||||||
|
result = AutoReplyPrint.INSTANCE.CP_Label_DrawImageFromData(handle, x, y, dstw, dsth, data, data.length, binaryzation_method, compression_method);
|
||||||
|
} catch (Throwable var11) {
|
||||||
|
var11.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_Label_TextStyle {
|
||||||
|
private int style = 0;
|
||||||
|
|
||||||
|
public CP_Label_TextStyle(boolean bold, boolean underline, boolean highlight, boolean strikethrough, int rotation, int widthscale, int heightscale) {
|
||||||
|
int style = 0;
|
||||||
|
if (bold) {
|
||||||
|
style |= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (underline) {
|
||||||
|
style |= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (highlight) {
|
||||||
|
style |= 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strikethrough) {
|
||||||
|
style |= 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
style |= rotation << 4;
|
||||||
|
style |= widthscale << 8;
|
||||||
|
style |= heightscale << 12;
|
||||||
|
this.style = style;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStyle() {
|
||||||
|
return this.style;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnBluetoothDeviceDiscovered_Callback extends Callback {
|
||||||
|
void CP_OnBluetoothDeviceDiscovered(String var1, String var2, Pointer var3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnNetPrinterDiscovered_Callback extends Callback {
|
||||||
|
void CP_OnNetPrinterDiscovered(String var1, String var2, String var3, String var4, Pointer var5);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnPortClosedEvent_Callback extends Callback {
|
||||||
|
void CP_OnPortClosedEvent(Pointer var1, Pointer var2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnPortOpenFailedEvent_Callback extends Callback {
|
||||||
|
void CP_OnPortOpenFailedEvent(Pointer var1, String var2, Pointer var3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnPortOpenedEvent_Callback extends Callback {
|
||||||
|
void CP_OnPortOpenedEvent(Pointer var1, String var2, Pointer var3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnPortReceivedEvent_Callback extends Callback {
|
||||||
|
void CP_OnPortReceivedEvent(Pointer var1, Pointer var2, int var3, Pointer var4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnPortWrittenEvent_Callback extends Callback {
|
||||||
|
void CP_OnPortWrittenEvent(Pointer var1, Pointer var2, int var3, Pointer var4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnPrinterPrintedEvent_Callback extends Callback {
|
||||||
|
void CP_OnPrinterPrintedEvent(Pointer var1, int var2, Pointer var3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnPrinterReceivedEvent_Callback extends Callback {
|
||||||
|
void CP_OnPrinterReceivedEvent(Pointer var1, int var2, Pointer var3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface CP_OnPrinterStatusEvent_Callback extends Callback {
|
||||||
|
void CP_OnPrinterStatusEvent(Pointer var1, long var2, long var4, Pointer var6);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_Page_DrawRasterImageFromData_Helper {
|
||||||
|
public CP_Page_DrawRasterImageFromData_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean DrawRasterImageFromBufferedImage(Pointer handle, int x, int y, int dstw, int dsth, BufferedImage image, int binaryzation_method) {
|
||||||
|
boolean result = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||||
|
ImageIO.write(image, "png", os);
|
||||||
|
byte[] data = os.toByteArray();
|
||||||
|
result = AutoReplyPrint.INSTANCE.CP_Page_DrawRasterImageFromData(handle, x, y, dstw, dsth, data, data.length, binaryzation_method);
|
||||||
|
} catch (Throwable var10) {
|
||||||
|
var10.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_Port_EnumCom_Helper {
|
||||||
|
public CP_Port_EnumCom_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String[] EnumCom() {
|
||||||
|
IntByReference pcbNeeded = new IntByReference();
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_EnumCom((byte[]) null, 0, pcbNeeded);
|
||||||
|
if (pcbNeeded.getValue() > 0) {
|
||||||
|
byte[] pBuf = new byte[pcbNeeded.getValue()];
|
||||||
|
if (pBuf != null) {
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_EnumCom(pBuf, pBuf.length, (IntByReference) null);
|
||||||
|
String s = new String(pBuf);
|
||||||
|
String[] ss = s.split("\u0000");
|
||||||
|
return ss;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_Port_EnumLpt_Helper {
|
||||||
|
public CP_Port_EnumLpt_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String[] EnumLpt() {
|
||||||
|
IntByReference pcbNeeded = new IntByReference();
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_EnumLpt((byte[]) null, 0, pcbNeeded);
|
||||||
|
if (pcbNeeded.getValue() > 0) {
|
||||||
|
byte[] pBuf = new byte[pcbNeeded.getValue()];
|
||||||
|
if (pBuf != null) {
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_EnumLpt(pBuf, pBuf.length, (IntByReference) null);
|
||||||
|
String s = new String(pBuf);
|
||||||
|
String[] ss = s.split("\u0000");
|
||||||
|
return ss;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_Port_EnumUsb_Helper {
|
||||||
|
public CP_Port_EnumUsb_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String[] EnumUsb() {
|
||||||
|
IntByReference pcbNeeded = new IntByReference();
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_EnumUsb((byte[]) null, 0, pcbNeeded);
|
||||||
|
if (pcbNeeded.getValue() > 0) {
|
||||||
|
byte[] pBuf = new byte[pcbNeeded.getValue()];
|
||||||
|
if (pBuf != null) {
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Port_EnumUsb(pBuf, pBuf.length, (IntByReference) null);
|
||||||
|
String s = new String(pBuf);
|
||||||
|
String[] ss = s.split("\u0000");
|
||||||
|
return ss;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_Pos_PrintRasterImageFromData_Helper {
|
||||||
|
public CP_Pos_PrintRasterImageFromData_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean PrintRasterImageFromBufferedImage(Pointer handle, int dstw, int dsth, BufferedImage image, int binaryzation_method, int compression_method) {
|
||||||
|
boolean result = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||||
|
ImageIO.write(image, "png", os);
|
||||||
|
byte[] data = os.toByteArray();
|
||||||
|
result = AutoReplyPrint.INSTANCE.CP_Pos_PrintRasterImageFromData(handle, dstw, dsth, data, data.length, binaryzation_method, compression_method);
|
||||||
|
} catch (Throwable var9) {
|
||||||
|
var9.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_PrinterStatus {
|
||||||
|
private long error_status = 0L;
|
||||||
|
private long info_status = 0L;
|
||||||
|
|
||||||
|
public CP_PrinterStatus(long error_status, long info_status) {
|
||||||
|
this.error_status = error_status;
|
||||||
|
this.info_status = info_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long errorStatus() {
|
||||||
|
return this.error_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long infoStatus() {
|
||||||
|
return this.info_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_OCCURED() {
|
||||||
|
return this.error_status != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_CUTTER() {
|
||||||
|
return (this.error_status & 1L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_FLASH() {
|
||||||
|
return (this.error_status & 2L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_NOPAPER() {
|
||||||
|
return (this.error_status & 4L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_VOLTAGE() {
|
||||||
|
return (this.error_status & 8L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_MARKER() {
|
||||||
|
return (this.error_status & 16L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_ENGINE() {
|
||||||
|
return (this.error_status & 32L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_OVERHEAT() {
|
||||||
|
return (this.error_status & 64L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_COVERUP() {
|
||||||
|
return (this.error_status & 128L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ERROR_MOTOR() {
|
||||||
|
return (this.error_status & 256L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean INFO_LABELPAPER() {
|
||||||
|
return (this.info_status & 2L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean INFO_LABELMODE() {
|
||||||
|
return (this.info_status & 4L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean INFO_HAVEDATA() {
|
||||||
|
return (this.info_status & 8L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean INFO_NOPAPERCANCELED() {
|
||||||
|
return (this.info_status & 16L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean INFO_PAPERNOFETCH() {
|
||||||
|
return (this.info_status & 32L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean INFO_PRINTIDLE() {
|
||||||
|
return (this.info_status & 64L) != 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean INFO_RECVIDLE() {
|
||||||
|
return (this.info_status & 128L) != 0L;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_Printer_GetPrinterFirmwareVersion_Helper {
|
||||||
|
public CP_Printer_GetPrinterFirmwareVersion_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String GetPrinterFirmwareVersion(Pointer handle) {
|
||||||
|
IntByReference pcbNeeded = new IntByReference();
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Printer_GetPrinterFirmwareVersion(handle, (byte[]) null, 0, pcbNeeded);
|
||||||
|
if (pcbNeeded.getValue() > 0) {
|
||||||
|
byte[] pBuf = new byte[pcbNeeded.getValue()];
|
||||||
|
if (pBuf != null) {
|
||||||
|
AutoReplyPrint.INSTANCE.CP_Printer_GetPrinterFirmwareVersion(handle, pBuf, pBuf.length, (IntByReference) null);
|
||||||
|
String s = new String(pBuf);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CP_RTSTATUS_Helper {
|
||||||
|
public CP_RTSTATUS_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_DRAWER_OPENED(long status) {
|
||||||
|
return (status >> 0 & 4L) == 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_OFFLINE(long status) {
|
||||||
|
return (status >> 0 & 8L) == 8L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_COVERUP(long status) {
|
||||||
|
return (status >> 8 & 4L) == 4L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_FEED_PRESSED(long status) {
|
||||||
|
return (status >> 8 & 8L) == 8L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_NOPAPER(long status) {
|
||||||
|
return (status >> 8 & 32L) == 32L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_ERROR_OCCURED(long status) {
|
||||||
|
return (status >> 8 & 64L) == 64L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_CUTTER_ERROR(long status) {
|
||||||
|
return (status >> 16 & 8L) == 8L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_UNRECOVERABLE_ERROR(long status) {
|
||||||
|
return (status >> 16 & 32L) == 32L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_DEGREE_OR_VOLTAGE_OVERRANGE(long status) {
|
||||||
|
return (status >> 16 & 64L) == 64L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_PAPER_NEAREND(long status) {
|
||||||
|
return (status >> 24 & 12L) == 12L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean CP_RTSTATUS_PAPER_TAKEOUT(long status) {
|
||||||
|
return (status >> 24 & 4L) == 4L;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class GetLibraryPath_Helper {
|
||||||
|
public GetLibraryPath_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String GetLibraryPath() {
|
||||||
|
if (Platform.isWindows()) {
|
||||||
|
return Platform.is64Bit() ? "/autoreplyprint/win64/autoreplyprint.dll" : "/autoreplyprint/win32/autoreplyprint.dll";
|
||||||
|
} else if (Platform.isLinux()) {
|
||||||
|
return Platform.is64Bit() ? "/autoreplyprint/linux-x64/libautoreplyprint.so" : "/autoreplyprint/linux-x86/libautoreplyprint.so";
|
||||||
|
} else {
|
||||||
|
return Platform.isMac() ? "/autoreplyprint/mac/libautoreplyprint.so" : "autoreplyprint";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.utils;
|
||||||
|
|
||||||
|
import com.sun.jna.Library;
|
||||||
|
import com.sun.jna.Native;
|
||||||
|
import com.sun.jna.Platform;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class AutoReplyPrint2 {
|
||||||
|
|
||||||
|
|
||||||
|
public static AutoReplyPrint2Sdk getAutoReplyPrint2SDK() throws AutoReplyPrint2RegistrationException {
|
||||||
|
try {
|
||||||
|
return Native.load(GetLibraryPath_Helper.GetLibraryPath(), AutoReplyPrint2Sdk.class);
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
log.info("[AutoReplyPrint2][AutoReplyPrint2.getAutoReplyPrint2SDK] SDK注册失败 {}", e.getMessage());
|
||||||
|
throw new AutoReplyPrint2RegistrationException("Failed to load AutoReplyPrint2Sdk library: ", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义接口映射本地库中的函数。
|
||||||
|
*/
|
||||||
|
public interface AutoReplyPrint2Sdk extends Library {
|
||||||
|
/**
|
||||||
|
* 获取打印机固件版本
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String CPPrinterGetPrinterFirmwareVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义自定义异常类,用于表示注册控件时发生的错误
|
||||||
|
*/
|
||||||
|
public static class AutoReplyPrint2RegistrationException extends Exception {
|
||||||
|
public AutoReplyPrint2RegistrationException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AutoReplyPrint2RegistrationException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class GetLibraryPath_Helper {
|
||||||
|
public GetLibraryPath_Helper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String GetLibraryPath() {
|
||||||
|
if (Platform.isWindows()) {
|
||||||
|
return Platform.is64Bit() ? "/autoreplyprint/win64/autoreplyprint.dll" : "/autoreplyprint/win32/autoreplyprint.dll";
|
||||||
|
} else if (Platform.isLinux()) {
|
||||||
|
return Platform.is64Bit() ? "/autoreplyprint/linux-x64/libautoreplyprint.so" : "/autoreplyprint/linux-x86/libautoreplyprint.so";
|
||||||
|
} else {
|
||||||
|
return Platform.isMac() ? "/autoreplyprint/mac/libautoreplyprint.so" : "autoreplyprint";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.utils;
|
||||||
|
|
||||||
|
import com.sun.jna.Native;
|
||||||
|
import com.sun.jna.win32.StdCallLibrary;
|
||||||
|
|
||||||
|
public interface MyLibrary extends StdCallLibrary {
|
||||||
|
MyLibrary INSTANCE = (MyLibrary) Native.load("D:\\DPKJ\\yinyitong-zhongyuyuan-dll\\src\\main\\resources\\autoreplyprint\\win64\\autoreplyprint.dll", MyLibrary.class);
|
||||||
|
|
||||||
|
// 映射DLL中的函数
|
||||||
|
String CP_Printer_GetPrinterFirmwareVersion();
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.utils;
|
||||||
|
|
||||||
|
public class MyNativeClass {
|
||||||
|
public static native void ICC_Reader_Open(String devName);
|
||||||
|
|
||||||
|
static {
|
||||||
|
System.load("D:\\DPKJ\\yinyitong-zhongyuyuan-dll\\src\\main\\resources\\win32-x86\\UnPack.dll");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ICC_Reader_Open("USB1");
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
|||||||
|
package com.dpkj.modules.autoReplyPrint.utils;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
public class TestUtils {
|
||||||
|
public static byte[] ReadFromFile(String fileName) {
|
||||||
|
byte[] data = null;
|
||||||
|
try {
|
||||||
|
InputStream in = new FileInputStream(fileName);
|
||||||
|
data = new byte[in.available()];
|
||||||
|
in.read(data);
|
||||||
|
in.close();
|
||||||
|
} catch (Throwable tr) {
|
||||||
|
tr.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void showMessageOnUiThread(final String msg) {
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
JOptionPane.showMessageDialog(null, msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package com.dpkj.modules.cardReader.constant;
|
||||||
|
|
||||||
|
public interface StatusConstant {
|
||||||
|
// 执行成功
|
||||||
|
String IFD_OK = "0";
|
||||||
|
|
||||||
|
// 卡片类型不对
|
||||||
|
String IFD_ICC_TypeError = "-1";
|
||||||
|
|
||||||
|
// 无卡
|
||||||
|
String IFD_ICC_NoExist = "-2";
|
||||||
|
|
||||||
|
// 有卡未上电
|
||||||
|
String IFD_ICC_NoPower = "-3";
|
||||||
|
|
||||||
|
// 卡片无应答
|
||||||
|
String IFD_ICC_NoResponse = "-4";
|
||||||
|
|
||||||
|
// 卡片状态异常
|
||||||
|
String IFD_ICC_StatusErr = "-5";
|
||||||
|
|
||||||
|
// 读写器执行指令失败
|
||||||
|
String IFD_ICC_ExecuteErr = "-6";
|
||||||
|
|
||||||
|
// 读卡器连接错
|
||||||
|
String IFD_ConnectError = "-11";
|
||||||
|
|
||||||
|
// 未建立连接(没有执行打开设备函数)
|
||||||
|
String IFD_UnConnected = "-12";
|
||||||
|
|
||||||
|
// (动态库)不支持该命令
|
||||||
|
String IFD_BadCommand = "-13";
|
||||||
|
|
||||||
|
// (发给动态库的)命令参数出错
|
||||||
|
String IFD_ParameterError = "-14";
|
||||||
|
|
||||||
|
// 信息校验和出错
|
||||||
|
String IFD_CheckSumError = "-15";
|
||||||
|
|
||||||
|
// 超时
|
||||||
|
String IFD_TimeOut = "-16";
|
||||||
|
|
||||||
|
// 读取固件信息错误
|
||||||
|
String IFD_ReadErr = "-17";
|
||||||
|
|
||||||
|
// 底层返回数据长度错误
|
||||||
|
String IFD_DeviceDataLen = "-18";
|
||||||
|
|
||||||
|
// 卡片数据异常错误
|
||||||
|
String IFD_CardDataErr = "-19";
|
||||||
|
|
||||||
|
// 标志位不支持
|
||||||
|
String IFD_TAGNoExist = "-20";
|
||||||
|
|
||||||
|
// 读取文件异常
|
||||||
|
String IFD_FileDataErr = "-21";
|
||||||
|
|
||||||
|
// 设备返回数据异常
|
||||||
|
String IFD_DeviceDataErr = "-22";
|
||||||
|
|
||||||
|
// 加载动态库失败
|
||||||
|
String IFD_LoadDllError = "-23";
|
||||||
|
|
||||||
|
// 用户取消操作
|
||||||
|
String IFD_UserCancel = "-24";
|
||||||
|
|
||||||
|
// 密码长度错误
|
||||||
|
String IFD_KeyLengthErr = "-25";
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.dpkj.modules.cardReader.controller;
|
||||||
|
|
||||||
|
import com.dpkj.common.vo.Result;
|
||||||
|
import com.dpkj.modules.cardReader.service.CardReaderService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多合一读卡器
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("cardReader")
|
||||||
|
public class CardReaderController {
|
||||||
|
@Autowired
|
||||||
|
private CardReaderService cardReaderService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接设备
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("connectedDevice")
|
||||||
|
public Result<?> connectedDevice(@RequestParam(name = "devName") String devName) {
|
||||||
|
try {
|
||||||
|
return cardReaderService.connectedDevice(devName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.info("设备连接失败 {}", e.getMessage());
|
||||||
|
return Result.error("设备连接失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.dpkj.modules.cardReader.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dpkj.common.vo.Result;
|
||||||
|
|
||||||
|
public interface CardReaderService {
|
||||||
|
|
||||||
|
Result<?> connectedDevice(String devName);
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.dpkj.modules.cardReader.service.impl;
|
||||||
|
|
||||||
|
import com.dpkj.common.vo.Result;
|
||||||
|
import com.dpkj.modules.cardReader.service.CardReaderService;
|
||||||
|
import com.dpkj.modules.cardReader.utils.CardReaderUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class CardReaderServiceImpl implements CardReaderService {
|
||||||
|
|
||||||
|
private CardReaderUtil.CardReaderSdk cardReaderSdk = CardReaderUtil.getCardReaderSDK();
|
||||||
|
|
||||||
|
public CardReaderServiceImpl() throws CardReaderUtil.CardReaderRegistrationException {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<?> connectedDevice(String devName) {
|
||||||
|
Long aLong = cardReaderSdk.ICC_Reader_Open(devName);
|
||||||
|
log.info("连接状态{}", aLong);
|
||||||
|
return Result.ok(aLong);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,418 @@
|
|||||||
|
package com.dpkj.modules.cardReader.utils;
|
||||||
|
|
||||||
|
import com.sun.jna.Library;
|
||||||
|
import com.sun.jna.Native;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class CardReaderUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 多合一读卡器 实例,同时注册 CardReaderSdk 控件。
|
||||||
|
*
|
||||||
|
* @return CardReaderSdk 实例
|
||||||
|
* @throws CardReaderRegistrationException 如果注册控件失败,抛出此异常
|
||||||
|
*/
|
||||||
|
public static CardReaderSdk getCardReaderSDK() throws CardReaderRegistrationException {
|
||||||
|
try {
|
||||||
|
return Native.load("UnPack", CardReaderSdk.class);
|
||||||
|
//return Native.load("SSSE32", CardReaderSdk.class);
|
||||||
|
//return Native.load("autoreplyprint", CardReaderSdk.class);
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
log.info("[CardReader][AutoReplyPrint2.getCardReaderSDK] SDK注册失败 {}", e.getMessage());
|
||||||
|
throw new CardReaderRegistrationException("Failed to load CardReaderSdk library: ", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void convertAndPassStringAsJCharArray(String filePath) {
|
||||||
|
// 将字符串转换为char[]
|
||||||
|
char[] chars = filePath.toCharArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义接口映射本地库中的函数。
|
||||||
|
*/
|
||||||
|
public interface CardReaderSdk extends Library {
|
||||||
|
/**
|
||||||
|
* 连接指定设备与电脑端口,即打开端口
|
||||||
|
* @param devName 接口名称,如”USB1”
|
||||||
|
* @return >0成功,<=0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_Open(String devName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭已打开的电脑接口
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @return =0成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_Close(Long ReaderHandle);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读写器产生蜂鸣
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param time 蜂鸣时间,以毫秒为单位
|
||||||
|
* @return =0成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_PosBeep(Long ReaderHandle, Long time);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取动态库及设备版本信息
|
||||||
|
* @return 设备及动态库版本信息 =0成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_Libinfo();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从EEPROM读取数据
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param offset 偏移地址(起始地址)
|
||||||
|
* @param length 要读取的数据的长度
|
||||||
|
* @return 读取的数据 =0成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_ReadEEPROM(Long ReaderHandle, int offset, int length);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 往EEPROM写入数据
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param offset 偏移地址(起始地址)
|
||||||
|
* @param length 要写入的数据的长度
|
||||||
|
* @param buffer 待写入的数据
|
||||||
|
* @return =0成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_WriteEEPROM(Long ReaderHandle, int offset, int length, String buffer);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放语音(SSSE32.dll暴露函数中未发现该函数,但是文档中有)
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param voiceType 语音类型:
|
||||||
|
* 1、请插卡
|
||||||
|
* 2、请刷卡
|
||||||
|
* 3、读卡错误
|
||||||
|
* 4、请输入密码
|
||||||
|
* 5、密码错误
|
||||||
|
* 6、操作成功
|
||||||
|
* 7、操作超时
|
||||||
|
* 8、操作失败
|
||||||
|
* 9、请取回卡
|
||||||
|
* 10、请重新输入密码
|
||||||
|
* 11、请再次输入密码
|
||||||
|
* 12、请输入新密码
|
||||||
|
* 13、请输入旧密码
|
||||||
|
* 14、请确认新密码
|
||||||
|
* @return =0成功,非0失败
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
Long ICC_Reader_DispSound(Long ReaderHandle, String voiceType);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接触 CPU 卡上电复位,返回值数据格式为十六进制字符串
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param ICCSlotNo ICC插槽号 0x01 :大卡座 ;
|
||||||
|
* 0x02 :副卡座 ;
|
||||||
|
* 0x11:SAM1卡座;
|
||||||
|
* 0x12:SAM2卡座;
|
||||||
|
* 0x13:SAM3卡座;
|
||||||
|
* 0x14:SAM4卡座
|
||||||
|
* 0x3x:非接CPU卡
|
||||||
|
* @return 上电返回ATR值,数据格式为十六进制字符串
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_PowerOnHEX(Long ReaderHandle, String ICCSlotNo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CPU 卡下电
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param ICCSlotNo ICC插槽号 0x01 :大卡座 ;
|
||||||
|
* 0x02 :副卡座 ;
|
||||||
|
* 0x11:SAM1卡座;
|
||||||
|
* 0x12:SAM2卡座;
|
||||||
|
* 0x13:SAM3卡座;
|
||||||
|
* 0x14:SAM4卡座
|
||||||
|
* 0x3x:非接CPU卡
|
||||||
|
* @return =0成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_PowerOff(Long ReaderHandle, String ICCSlotNo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取卡座状态
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param ICCSlotNo ICC插槽号 0x01 :大卡座 ;
|
||||||
|
* 0x02 :副卡座 ;
|
||||||
|
* 0x11:SAM1卡座;
|
||||||
|
* 0x12:SAM2卡座;
|
||||||
|
* 0x13:SAM3卡座;
|
||||||
|
* 0x14:SAM4卡座
|
||||||
|
* 0x3x:非接CPU卡
|
||||||
|
* @return = 0 表示卡座有卡,其他见状态码
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_GetStatus(Long ReaderHandle, String ICCSlotNo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接触 CPU 卡执行APDU命令
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param ICCSlotNo ICC插槽号 0x01 :大卡座 ;
|
||||||
|
* 0x02 :副卡座 ;
|
||||||
|
* 0x11:SAM1卡座;
|
||||||
|
* 0x12:SAM2卡座;
|
||||||
|
* 0x13:SAM3卡座;
|
||||||
|
* 0x14:SAM4卡座
|
||||||
|
* 0x3x:非接CPU卡
|
||||||
|
* @param CommandAPDU APDU命令数据,以十六进制字符串形式输入
|
||||||
|
* @return 大于 0 表示执行成功,其值为 Response_APDU 的数据长度.否则表示执行失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_ApplicationHEX(Long ReaderHandle, String ICCSlotNo, String CommandAPDU);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4442卡片上电,数据以十六进制字符串输出
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @return 返回卡片上电信息 = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_4428_PowerOnHEX(Long ReaderHandle);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4442卡片下电
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @return = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_4442_PowerOff(Long ReaderHandle);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取4442卡的指定字段内容,以十六进制字符串输出
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param offset 起始地址,需小于256
|
||||||
|
* @param len 数据长度,offset+len需小于256
|
||||||
|
* @return 返回卡片读取信息 = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_4428_ReadHEX(Long ReaderHandle, int offset, int len);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写 4442 卡的指定字段内容,以十六进制字符串输入参数
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param offset 起始地址,需小于256
|
||||||
|
* @param len 数据长度,offset+len需小于256
|
||||||
|
* @param data 待写入卡片数据
|
||||||
|
* @return 返回卡片读取信息 = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_4428_WriteHEX(Long ReaderHandle, int offset, int len, String data);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4442卡认证密钥
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param keyHex 卡密钥
|
||||||
|
* @return = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long ICC_Reader_4442_Verify(Long ReaderHandle, String keyHex);
|
||||||
|
|
||||||
|
/** ----- 非接触操作函数 -------------- */
|
||||||
|
/**
|
||||||
|
* 查找天线磁场区域内有无卡,只有卡片上电后才能查找到
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @return = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long PICC_Reader_Request(Long ReaderHandle);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 天线操作
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param flag 00-关场强 01-开场强
|
||||||
|
* @return = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long PICC_Reader_RFControl(Long ReaderHandle, String flag);
|
||||||
|
|
||||||
|
|
||||||
|
/** --------------- 非接 CPU 卡操作函数 ------------ */
|
||||||
|
/**
|
||||||
|
* 非接TypeA CPU卡上电复位,输出十六进制字符串(SSSE32.dll暴露函数中未发现该函数,但是文档中有)
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @return 输出上电成功返回的卡片复位信息(ATS) 返回ATS长度,大于0 表示成功,其他失败
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
Long PICC_Reader_PowerOnTypeAHEX(Long ReaderHandle);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 非接TypeB CPU卡上电复位,输出十六进制字符串(SSSE32.dll暴露函数中未发现该函数,但是文档中有)
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @return 输出上电成功返回的卡片复位信息(ATS) 返回ATS长度,大于0 表示成功,其他失败
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
Long PICC_Reader_PowerOnTypeBHEX(Long ReaderHandle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 非接触 CPU 卡执行APDU命令,命令以十六进制字符串传输(SSSE32.dll暴露函数中未发现该函数,但是文档中有)
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @param CommandAPDU APDU命令数据,以十六进制字符串形式输入
|
||||||
|
* @return APDU命令执行后,响应的数据,返回数据为十六进制字符串
|
||||||
|
* 大于 0 表示执行成功,其值为 Response_APDU 的数据长度.否则表示执行失败
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
Long PICC_Reader_ApplicationHEX(Long ReaderHandle, String CommandAPDU);
|
||||||
|
|
||||||
|
|
||||||
|
/** ---------------- 二代证/外国人居留证/港澳台居住证 --------------- */
|
||||||
|
/**
|
||||||
|
* 读取身份证物理ID号
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @return 返回身份证物理ID信息 = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long PICC_Reader_Read_CardID(Long ReaderHandle);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取身份证物理ID号
|
||||||
|
* @param ReaderHandle ICCReaderOpen函数所返回的值
|
||||||
|
* @return 返回错误信息 = 0 表示成功,非0失败
|
||||||
|
*/
|
||||||
|
Long PICC_Reader_ReadIDCard(Long ReaderHandle);
|
||||||
|
|
||||||
|
/** 以下函数须在 “PICCReaderReadIDCard” 函数执行成功之后调用,否则获取不到有效信息 */
|
||||||
|
/**
|
||||||
|
* 获取证件类型
|
||||||
|
* @return
|
||||||
|
* 0:居民身份证
|
||||||
|
* 1:外国人永久居留证
|
||||||
|
* 2:港澳台居民居住证
|
||||||
|
* 4:新外国人永久居留证
|
||||||
|
*/
|
||||||
|
Integer GetCardType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名(类型为 1 时表示:外国人中文姓名)
|
||||||
|
*/
|
||||||
|
Integer GetName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别
|
||||||
|
*/
|
||||||
|
Integer GetSex();
|
||||||
|
/**
|
||||||
|
* 民族
|
||||||
|
*/
|
||||||
|
Integer GetNation();
|
||||||
|
/**
|
||||||
|
* 出生日期
|
||||||
|
*/
|
||||||
|
Integer GetBirth();
|
||||||
|
/**
|
||||||
|
* 住址
|
||||||
|
*/
|
||||||
|
Integer GetAddress();
|
||||||
|
/**
|
||||||
|
* 公民身份证号码(类型为 1时表示:外国人居留证号码)
|
||||||
|
*/
|
||||||
|
Integer GetCertNo();
|
||||||
|
/**
|
||||||
|
* 签发机关
|
||||||
|
*/
|
||||||
|
Integer GetDepartemt();
|
||||||
|
/**
|
||||||
|
* 有效起始日期
|
||||||
|
*/
|
||||||
|
Integer GetEffectDate();
|
||||||
|
/**
|
||||||
|
* 有效截止日期
|
||||||
|
*/
|
||||||
|
Integer GetExpireDate();
|
||||||
|
/**
|
||||||
|
* bmp 格式照片数据
|
||||||
|
*/
|
||||||
|
Integer GetBmpFileData();
|
||||||
|
/**
|
||||||
|
* 生成照片
|
||||||
|
* TODO 入参参考文中3.4.1
|
||||||
|
*/
|
||||||
|
Integer GetBmpFile();
|
||||||
|
/**
|
||||||
|
* 是否含存在指纹信息:存在时返回 512 或者 1024
|
||||||
|
* 不存在时返回 0
|
||||||
|
*/
|
||||||
|
Integer IsFingerExist();
|
||||||
|
/**
|
||||||
|
* 获取指纹数据:成功时返回获取到的字节长度
|
||||||
|
*/
|
||||||
|
Integer GetFingerprint();
|
||||||
|
/**
|
||||||
|
* 外国人英文姓名
|
||||||
|
*/
|
||||||
|
Integer GetEnName();
|
||||||
|
/**
|
||||||
|
* 外国人国籍代码,符合GB/T2659-2000规定
|
||||||
|
*/
|
||||||
|
Integer GetNationalityCode();
|
||||||
|
/**
|
||||||
|
* 港澳台通行证号码
|
||||||
|
*/
|
||||||
|
Integer GetTXZHM();
|
||||||
|
/**
|
||||||
|
* 港澳台通行证签发次数
|
||||||
|
*/
|
||||||
|
Integer GetTXZQFCS();
|
||||||
|
/**
|
||||||
|
* 外国人换证次数
|
||||||
|
*/
|
||||||
|
Integer GetHZCS();
|
||||||
|
|
||||||
|
/** ------------ 社保卡 ---------*/
|
||||||
|
/**
|
||||||
|
* 选择社保卡社会保障系统环境后,通过 PSAM 卡对社保卡进行内部认证,通过后将卡内的基本信息读出返回。
|
||||||
|
* @param iType 操作卡的类型
|
||||||
|
* 1-接触式操作卡;
|
||||||
|
* 2-非接触式操作卡;
|
||||||
|
* 3-自动寻卡,接触式操作卡优先;
|
||||||
|
* 4-自动寻卡,非接触式操作卡优先
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Long iReadCardBas(Integer iType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基于加密机的读基本信息(步骤一)
|
||||||
|
* 选择社会保障系统环境后,返回内部认证和外部认证所需信息。
|
||||||
|
* @param iType 操作卡的类型
|
||||||
|
* 1-接触式操作卡;
|
||||||
|
* 2-非接触式操作卡;
|
||||||
|
* 3-自动寻卡,接触式操作卡优先;
|
||||||
|
* 4-自动寻卡,非接触式操作卡优先
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Long iReadCardBas_HSM_Step1(Integer iType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基于加密机的读基本信息(步骤二)
|
||||||
|
* 根据加密机返回的内部认证和外部认证结果数据对社保卡进行内部认证和外部认证,通过后将卡内的基本信息读出返回。
|
||||||
|
* @param pKey 加密机返回的内部认证和外部认证结果数据,依次为:内部认证结果数据
|
||||||
|
* (即内部认证鉴别数据(16 位)和内部认证鉴别所需的原始信息(16 位)拼接组
|
||||||
|
* 成)、外部认证结果数据(即外部认证鉴别数据(16 位)和外部认证鉴别所需的
|
||||||
|
* 原始信息(16 位)拼接组成)。各数据项之间以“|”分割,且最后一个数据项以“|”结尾。
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Long iReadCardBas_HSM_Step2(String pKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义自定义异常类,用于表示注册控件时发生的错误
|
||||||
|
*/
|
||||||
|
public static class CardReaderRegistrationException extends Exception {
|
||||||
|
public CardReaderRegistrationException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CardReaderRegistrationException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,7 +29,104 @@ public class PrinterUtil {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return Native.load("Msprintsdk.x64", MsPrintSdk.class);
|
// return Native.load("Msprintsdk.x64", MsPrintSdk.class);
|
||||||
|
|
||||||
|
return new MsPrintSdk() {
|
||||||
|
@Override
|
||||||
|
public Integer SetPrintPort(String strPort, int baudRate) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer SetPrintConn(int iConnWay, String strName, String strValue) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer SetUsbportauto() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer GetStatus() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer GetStatusspecial() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer SetInit() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void PrintQrcode(String s, int i, int i1, int i2) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void SetLeftmargin(int i) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer PrintString(String s, int i) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer PrintRemainQR() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer SetReadZKmode(int i) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer PrintCutpaper(int i) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void SetHTseat(String s, int i) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void PrintNextHT() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer PrintDiskbmpfile(String strPath) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer PrintDiskimgfile(String strPath) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer PrintMarkpositionPrint() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer PrintMarkpositioncut() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer PrintMarkcutpaper(int iMode) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
} catch (UnsatisfiedLinkError e) {
|
} catch (UnsatisfiedLinkError e) {
|
||||||
log.info("[printer][PrinterUtil.getPrintSDK] SDK注册失败 {}", e.getMessage());
|
log.info("[printer][PrinterUtil.getPrintSDK] SDK注册失败 {}", e.getMessage());
|
||||||
throw new PrinterRegistrationException("Failed to load MsPrintSdk library: ", e);
|
throw new PrinterRegistrationException("Failed to load MsPrintSdk library: ", e);
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.dpkj.modules.receiptsPrint.controller;
|
||||||
|
|
||||||
|
import com.dpkj.modules.receiptsPrint.service.ReceiptsPrintService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小票打印控制层
|
||||||
|
*
|
||||||
|
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025-01-14 14:25:49
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/receiptsPrint")
|
||||||
|
public class ReceiptsPrintController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReceiptsPrintService receiptsPrintService;
|
||||||
|
|
||||||
|
@GetMapping("/test")
|
||||||
|
private void test(){
|
||||||
|
this.receiptsPrintService.test();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.dpkj.modules.receiptsPrint.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小票打印服务接口
|
||||||
|
*
|
||||||
|
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
|
||||||
|
* @version 1.0
|
||||||
|
* @since 2025-01-14 14:23:35
|
||||||
|
*/
|
||||||
|
public interface ReceiptsPrintService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试
|
||||||
|
*/
|
||||||
|
void test();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.dpkj.modules.receiptsPrint.service.impl;
|
||||||
|
|
||||||
|
import com.dpkj.modules.receiptsPrint.service.ReceiptsPrintService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="https://gitee.com/shi-chongli">石头人</a>
|
||||||
|
* @since 2025-01-14 14:24:15
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class ReceiptsPrintServiceImpl implements ReceiptsPrintService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void test() {
|
||||||
|
//System.out.println(AutoReplyPrint.CP_CharacterSet_CHINA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
3
src/main/resources/autoreplyprint/linux-x64/.gitignore
vendored
Normal file
3
src/main/resources/autoreplyprint/linux-x64/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
autoreplyprint.h
|
||||||
|
libautoreplyprint.so*
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ldd libautoreplyprint.so
|
||||||
|
|
||||||
4
src/main/resources/autoreplyprint/linux-x64/update.sh
Normal file
4
src/main/resources/autoreplyprint/linux-x64/update.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cp ../../../autoreplyprint_src/autoreplyprint_main/autoreplyprint.h .
|
||||||
|
cp ../../build-autoreplyprint-Qt_5_6_3_x64_static-Release/libautoreplyprint.so* .
|
||||||
|
|
||||||
3
src/main/resources/autoreplyprint/linux-x86/.gitignore
vendored
Normal file
3
src/main/resources/autoreplyprint/linux-x86/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
autoreplyprint.h
|
||||||
|
libautoreplyprint.so*
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ldd libautoreplyprint.so
|
||||||
|
|
||||||
4
src/main/resources/autoreplyprint/linux-x86/update.sh
Normal file
4
src/main/resources/autoreplyprint/linux-x86/update.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cp ../../../autoreplyprint_src/autoreplyprint_main/autoreplyprint.h .
|
||||||
|
cp ../../build-autoreplyprint-Qt_5_6_3_x86_static-Release/libautoreplyprint.so* .
|
||||||
|
|
||||||
3
src/main/resources/autoreplyprint/mac/.gitignore
vendored
Normal file
3
src/main/resources/autoreplyprint/mac/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
autoreplyprint.h
|
||||||
|
libautoreplyprint*.dylib
|
||||||
|
|
||||||
2
src/main/resources/autoreplyprint/mac/dependencies.txt
Normal file
2
src/main/resources/autoreplyprint/mac/dependencies.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ldd libautoreplyprint.so
|
||||||
|
|
||||||
4
src/main/resources/autoreplyprint/mac/update.sh
Normal file
4
src/main/resources/autoreplyprint/mac/update.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cp ../../../autoreplyprint_src/autoreplyprint_main/autoreplyprint.h .
|
||||||
|
cp ../../build-autoreplyprint-Desktop_Qt_5_12_0_clang_64bit-Release/libautoreplyprint*.dylib .
|
||||||
|
|
||||||
4
src/main/resources/autoreplyprint/win32/.gitignore
vendored
Normal file
4
src/main/resources/autoreplyprint/win32/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
autoreplyprint.dll
|
||||||
|
autoreplyprint.exp
|
||||||
|
autoreplyprint.lib
|
||||||
|
autoreplyprint.h
|
||||||
4
src/main/resources/autoreplyprint/win32/copydll.bat
Normal file
4
src/main/resources/autoreplyprint/win32/copydll.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
copy ..\..\build-autoreplyprint-QT5_6_3_VC2015_STATIC_32-Release\release\autoreplyprint.dll . /y
|
||||||
|
copy ..\..\build-autoreplyprint-QT5_6_3_VC2015_STATIC_32-Release\release\autoreplyprint.exp . /y
|
||||||
|
copy ..\..\build-autoreplyprint-QT5_6_3_VC2015_STATIC_32-Release\release\autoreplyprint.lib . /y
|
||||||
|
copy ..\..\..\autoreplyprint_src\autoreplyprint_main\autoreplyprint.h . /y
|
||||||
4
src/main/resources/autoreplyprint/win64/.gitignore
vendored
Normal file
4
src/main/resources/autoreplyprint/win64/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
autoreplyprint.dll
|
||||||
|
autoreplyprint.exp
|
||||||
|
autoreplyprint.lib
|
||||||
|
autoreplyprint.h
|
||||||
4
src/main/resources/autoreplyprint/win64/copydll.bat
Normal file
4
src/main/resources/autoreplyprint/win64/copydll.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
copy ..\..\build-autoreplyprint-QT5_6_0_VC2015_STATIC_64-Release\release\autoreplyprint.dll . /y
|
||||||
|
copy ..\..\build-autoreplyprint-QT5_6_0_VC2015_STATIC_64-Release\release\autoreplyprint.exp . /y
|
||||||
|
copy ..\..\build-autoreplyprint-QT5_6_0_VC2015_STATIC_64-Release\release\autoreplyprint.lib . /y
|
||||||
|
copy ..\..\..\autoreplyprint_src\autoreplyprint_main\autoreplyprint.h . /y
|
||||||
10
src/main/resources/autoreplyprint/目录说明.txt
Normal file
10
src/main/resources/autoreplyprint/目录说明.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
考虑到应用场景
|
||||||
|
1 WIN10系统编译32位,64位动态库。
|
||||||
|
可能要到XP系统下面去使用,开发例子程序。
|
||||||
|
比如VS2005 C++ C#
|
||||||
|
也可能去其他系统下面使用,开发例子程序。
|
||||||
|
2 可能要生成多种系统下的库,一起放到某个位置
|
||||||
|
|
||||||
|
考虑到以上应用场景
|
||||||
|
1 决定每个目录单独一个文件夹,同时包括头文件和库文件。
|
||||||
|
2 使用的时候,直接目录复制过去即可使用。
|
||||||
350
src/main/resources/win32-x86-64/SSSE32.H
Normal file
350
src/main/resources/win32-x86-64/SSSE32.H
Normal file
@@ -0,0 +1,350 @@
|
|||||||
|
#ifndef SSSE32_H
|
||||||
|
#define SSSE32_H
|
||||||
|
#include <windows.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
//״̬<D7B4><CCAC>
|
||||||
|
#define IFD_OK 0 //ִ<>гɹ<D0B3>
|
||||||
|
#define IFD_ICC_TypeError -1 //<2F><>Ƭ<EFBFBD><C6AC><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>
|
||||||
|
#define IFD_ICC_NoExist -2 //<2F><EFBFBD>
|
||||||
|
#define IFD_ICC_NoPower -3 //<2F>п<EFBFBD>δ<EFBFBD>ϵ<EFBFBD>
|
||||||
|
#define IFD_ICC_NoResponse -4 //<2F><>Ƭ<EFBFBD><C6AC>Ӧ<EFBFBD><D3A6>
|
||||||
|
#define IFD_ConnectError -11 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD>
|
||||||
|
#define IFD_UnConnected -12 //δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(û<><C3BB>ִ<EFBFBD>д<EFBFBD><D0B4>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>)
|
||||||
|
#define IFD_BadCommand -13 //(<28><>̬<EFBFBD><CCAC>)<29><>֧<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
#define IFD_ParameterError -14 //(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̬<EFBFBD><CCAC><EFBFBD>)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
#define IFD_CheckSumError -15 //<2F><>ϢУ<CFA2><D0A3>ͳ<EFBFBD><CDB3><EFBFBD>
|
||||||
|
#define IFD_OutTime -20 //<2F><>ϢУ<CFA2><D0A3>ͳ<EFBFBD><CDB3><EFBFBD>
|
||||||
|
#define IFD_False -21 //<2F><><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ʧ<EFBFBD><CAA7>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
//
|
||||||
|
/*############<23>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#################*/
|
||||||
|
long WINAPI ICC_Reader_Open(char* dev_Name);
|
||||||
|
long WINAPI ICC_Reader_Close(long ReaderHandle);
|
||||||
|
long WINAPI ICC_PosBeep(long ReaderHandle, unsigned char time);//<2F><><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_EnterDFU (long ReaderHandle); //<2F><><EFBFBD><EFBFBD>USB<53><42><EFBFBD>س<EFBFBD><D8B3><EFBFBD>״̬
|
||||||
|
long WINAPI ICC_Reader_LeaveDFU (long ReaderHandle); //<2F>뿪USB<53><42><EFBFBD>س<EFBFBD><D8B3><EFBFBD>״̬
|
||||||
|
long WINAPI ICC_Reader_Libinfo(char* info);
|
||||||
|
long WINAPI ICC_Reader_ReadEEPROM (long ReaderHandle,int offset,int length,unsigned char *buffer);//<2F><>eeprom<6F><6D>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_WriteEEPROM (long ReaderHandle,int offset,int length,unsigned char *buffer);//<2F><>eepromд<6D><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Machine_Reset(long ReaderHandle);
|
||||||
|
void WINAPI ICC_Reader_PPS(bool IsEnable);
|
||||||
|
long WINAPI ICC_Reader_GetDeviceVersion(long ReaderHandle, unsigned char *VDate);
|
||||||
|
long WINAPI ICC_Reader_GetKeybordVersion(long ReaderHandle,char *VDate);
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_GetDeviceSN(long ReaderHandle,char* dev_Ser); //<2F><>ȡ<EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD>кţ<D0BA><C5A3><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>ȡ
|
||||||
|
long WINAPI ICC_Reader_SetDeviceSN(long ReaderHandle,char* dev_Ser); //<2F><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD>к<EFBFBD>
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_ContatctInfo(long ReaderHandle,char *VDate); //<2F><>ȡ<EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD>ܱ<EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_NoContatctInfo(long ReaderHandle,char *VDate);//<2F><>ȡ<EFBFBD>ǽӹ<C7BD><D3B9>ܱ<EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_GetDeviceCSN(long ReaderHandle,unsigned char *data);
|
||||||
|
long WINAPI ICC_DispInfo(long ReaderHandle,unsigned char row,unsigned char list,char *data); //<2F><>ʾ<EFBFBD><CABE>Ϣ
|
||||||
|
long WINAPI ICC_DispSound(long ReaderHandle,unsigned char type,unsigned char nMode); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>Ϣ type(1~14) nMode==0<><30><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>nMode==1<><31><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/*
|
||||||
|
1<><31><EFBFBD><EFBFBD>忨 2<><32><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2> 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4<><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5<><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6<><36><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD> 7<><37><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ 8<><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7> 9<><39><EFBFBD><EFBFBD>ȡ<EFBFBD>ؿ<EFBFBD> 10<31><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 11<31><31><EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD><D9B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 12<31><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 13<31><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 14<31><34><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
long WINAPI ICC_CtlLight(long ReaderHandle);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_ChangeLight(long ReaderHandle,unsigned char mode);//<2F>ı<EFBFBD><C4B1><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD> mode=1 <20><><EFBFBD><EFBFBD> mode=0<><30><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_GetInputPass(long ReaderHandle, unsigned char ctime, unsigned char *rlen, unsigned char start,unsigned char stop,unsigned char * cpass);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD>ʱ start==0<><30><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><C3BC>̣<EFBFBD>start==1<><31><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><C3BC><EFBFBD>
|
||||||
|
long WINAPI ICC_GetInputPassID(long ReaderHandle, unsigned char ctime, unsigned char *rlen, unsigned char start,unsigned char stop,unsigned char * cardID,unsigned char * cpass);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD>ʱ,<2C><>ID
|
||||||
|
long WINAPI ICC_GetTimeOut(long ReaderHandle,unsigned char flag);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>롢<EFBFBD><EBA1A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
||||||
|
long WINAPI ICC_PassGet(long ReaderHandle,unsigned char *rlen,unsigned char time,unsigned char start,unsigned char stop,unsigned char * cpass);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_PassGetID(long ReaderHandle,unsigned char *rlen,unsigned char time,unsigned char start,unsigned char stop,unsigned char * cardID,unsigned char * cpass);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_PassCheck(long ReaderHandle,unsigned char *rlen,unsigned char * cpass); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>
|
||||||
|
long WINAPI ICC_PassSetDES(long ReaderHandle,unsigned char DES); //<2F><><EFBFBD>ü<EFBFBD><C3BC><EFBFBD>ģʽ3des or des
|
||||||
|
long WINAPI ICC_PassSetDevID(long ReaderHandle,unsigned char *devID);//<2F><><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD>豸ID
|
||||||
|
long WINAPI ICC_PassGetDevID(long ReaderHandle,unsigned char *devID);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>豸ID
|
||||||
|
long WINAPI ICC_PassSetKeyLen(long ReaderHandle,unsigned char len);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>볤<EFBFBD><EBB3A4>
|
||||||
|
long WINAPI ICC_Reader_Auto(long ReaderHandle,int t_IntType);
|
||||||
|
long WINAPI PICC_Reader_ID_N(long ReaderHandle,unsigned char *GetData);
|
||||||
|
/*###############################################*/
|
||||||
|
|
||||||
|
long WINAPI ICC_PassGetSG(long ReaderHandle,unsigned char *rlen,unsigned char * cpass);
|
||||||
|
long WINAPI ICC_GetInputPassSG(long ReaderHandle, unsigned char *rlen,unsigned char * cpass);
|
||||||
|
|
||||||
|
/*############<23>Ӵ<EFBFBD>CPU<50><55><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#################*/
|
||||||
|
long WINAPI ICC_Reader_pre_PowerOn(long ReaderHandle,unsigned char ICC_Slot_No,unsigned char* Response);//<2F>ϵ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_hot_PowerOn(long ReaderHandle,unsigned char ICC_Slot_No,unsigned char* Response);//<2F>ϵ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_Zpre_PowerOn(long ReaderHandle,unsigned char ICC_Slot_No,unsigned char* Response);//ס<><D7A1><EFBFBD><EFBFBD>С<EFBFBD><D0A1>
|
||||||
|
long WINAPI ICC_Reader_PowerOn(long ReaderHandle,unsigned char ICC_Slot_No,unsigned char* Response);//<2F>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD> <20><>+<2B><>
|
||||||
|
long WINAPI ICC_Reader_PowerOnHEX(long ReaderHandle,unsigned char ICC_Slot_No,unsigned char* Response);//<2F>ϵ<EFBFBD> <20><>+<2B><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||||
|
/*
|
||||||
|
<09><><EFBFBD><EFBFBD>ICC_Slot_No<4E><6F>0x01
|
||||||
|
SAM1:0x11
|
||||||
|
SAM2:0x12
|
||||||
|
SAM3:0x13
|
||||||
|
SAM4:0x14
|
||||||
|
<09><>ͬ
|
||||||
|
|
||||||
|
*/
|
||||||
|
long WINAPI ICC_Reader_PowerOff(long ReaderHandle,unsigned char ICC_Slot_No);//<2F>µ<EFBFBD>
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_GetStatus(long ReaderHandle,unsigned char ICC_Slot_No);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>״̬
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_Application(long ReaderHandle,unsigned char ICC_Slot_No,
|
||||||
|
long Lenth_of_Command_APDU,unsigned char* Command_APDU,
|
||||||
|
unsigned char* Response_APDU); //ִ<><D6B4>apdu<64><75><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_LongApplication(long ReaderHandle,unsigned char ICC_Slot_No,
|
||||||
|
long Lenth_of_Command_APDU,unsigned char* Command_APDU,
|
||||||
|
unsigned char* Response_APDU); //ִ<><D6B4>apdu<64><75><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||||
|
|
||||||
|
//cpuetu=01<30><31>02<30><32>03<30><33>04<30><34><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD>ʷֱ<CAB7>Ϊ9600<30><30>19200<30><30>38400<30><30>115200
|
||||||
|
//unsigned char cpupro ---- <20><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> =0<><30>ʾT=0Э<30><D0AD> =1<><31>ʾT=1Э<31><D0AD>
|
||||||
|
long WINAPI ICC_SetCpupara(long ReaderHandle,unsigned char ICC_Slot_No,unsigned char cpupro,unsigned char cpuetu);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_SetCpuETU(long ReaderHandle,unsigned char ICC_Slot_No,unsigned char cpupro,unsigned char cpuetu);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
|
long WINAPI PICC_Reader_SetTypeA(long ReaderHandle);//<2F><><EFBFBD>ö<EFBFBD>typeA
|
||||||
|
long WINAPI PICC_Reader_SetTypeB(long ReaderHandle);//<2F><><EFBFBD>ö<EFBFBD>typeB
|
||||||
|
long WINAPI PICC_Reader_Select(long ReaderHandle,unsigned char cardtype);//ѡ<><D1A1>Ƭ<EFBFBD><C6AC>41Ϊtypea,M1 42Ϊtypeb,TypeB<65><42>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ѡ<EFBFBD><D1A1>
|
||||||
|
long WINAPI PICC_Reader_Request(long ReaderHandle);//typea M1<4D><31><EFBFBD><EFBFBD>Ƭ
|
||||||
|
long WINAPI PICC_Reader_RFControl(long ReaderHandle,short flag);//flag=0 <20>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD> flag=1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI PICC_Reader_anticoll(long ReaderHandle,unsigned char *uid);//<2F><><EFBFBD><EFBFBD>ײ typea M1<4D><31>Ƭ
|
||||||
|
|
||||||
|
/*############ M1<4D><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#################*/
|
||||||
|
long WINAPI PICC_Reader_M1Rest(long ReaderHandle,unsigned char *uid);
|
||||||
|
long WINAPI PICC_Reader_Authentication(long ReaderHandle,unsigned char Mode, unsigned char SecNr);//<2F><>֤<EFBFBD><D6A4>Կ M1
|
||||||
|
long WINAPI PICC_Reader_Authentication_Pass(long ReaderHandle,unsigned char Mode, unsigned char SecNr,unsigned char *PassWord);//<2F><>֤<EFBFBD><D6A4>ԿM1 <20><><EFBFBD><EFBFBD>Կ<EFBFBD><D4BF><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI PICC_Reader_Readval(long ReaderHandle,unsigned char Addr,unsigned long *value); //<2F><>ֵ
|
||||||
|
long WINAPI PICC_Reader_Initval(long ReaderHandle,unsigned char Addr,unsigned long value);//<2F><>ʼ<EFBFBD><CABC>ֵ
|
||||||
|
long WINAPI PICC_Reader_Increment(long ReaderHandle,unsigned char Addr,unsigned long value); //<2F><>ֵ
|
||||||
|
long WINAPI PICC_Reader_Decrement(long ReaderHandle,unsigned char Addr,unsigned long value);//<2F><>ֵ
|
||||||
|
long WINAPI PICC_Reader_Read(long ReaderHandle,unsigned char Addr,unsigned char *Data); //<2F><>ȡ<EFBFBD><C8A1>ƬM1
|
||||||
|
long WINAPI PICC_Reader_Write(long ReaderHandle,unsigned char Addr,unsigned char *Data);//д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>M1
|
||||||
|
long WINAPI PICC_Reader_LoadKey(long ReaderHandle,unsigned char Mode,unsigned char SecNr,unsigned char *Key);//װ<><D7B0><EFBFBD><EFBFBD>Կ
|
||||||
|
long WINAPI PICC_Reader_ReadHEX(long ReaderHandle,unsigned char Addr,unsigned char *DataHex); //<2F><>ȡ<EFBFBD><C8A1>ƬM1
|
||||||
|
|
||||||
|
long WINAPI PICC_Reader_WriteHEX(long ReaderHandle,unsigned char Addr,unsigned char *DataHex);//д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>M1
|
||||||
|
/*
|
||||||
|
SecNr:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
Mode<EFBFBD><EFBFBD>01 02 03 <20>ֱ<EFBFBD>Ϊ<EFBFBD><CEAA>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԿKeyA
|
||||||
|
04 05 06 <20>ֱ<EFBFBD>Ϊ<EFBFBD><CEAA>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԿKEYB
|
||||||
|
*/
|
||||||
|
/*############ ID <20><><EFBFBD><EFBFBD> #####################################*/
|
||||||
|
long WINAPI PICC_Reader_IdCard(long ReaderHandle,unsigned char *Number);
|
||||||
|
|
||||||
|
/*############ TypeA CPU <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> #################*/
|
||||||
|
long WINAPI PICC_Reader_PowerOnTypeA(long ReaderHandle,unsigned char* Response);//<2F>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD> ʧ<><CAA7>С<EFBFBD><D0A1>0
|
||||||
|
|
||||||
|
/*############ TypeB CPU <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#################*/
|
||||||
|
long WINAPI PICC_Reader_PowerOnTypeB(long ReaderHandle,unsigned char* Response);//<2F>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD> ʧ<><CAA7>С<EFBFBD><D0A1>0
|
||||||
|
long WINAPI ICC_Reader_ApplicationHEX(long ReaderHandle,unsigned char ICC_Slot_No,
|
||||||
|
char* Command_APDU,
|
||||||
|
char* Response_APDU); //ִ<><D6B4>apdu<64><75><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
|
long WINAPI PICC_Reader_Application(long ReaderHandle,
|
||||||
|
long Lenth_of_Command_APDU,unsigned char* Command_APDU,
|
||||||
|
unsigned char* Response_APDU); //type a/bִ<62><D6B4>apdu<64><75><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD> ʧ<><CAA7>С<EFBFBD><D0A1>0
|
||||||
|
|
||||||
|
long WINAPI HD_USBkey(long ReaderHandle,unsigned char _Adr, int len);//ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
//############################### <20><><EFBFBD><EFBFBD> Flash ##########################################################
|
||||||
|
long WINAPI ICC_Reader_ReadFlash(long ReaderHandle,int offset,int len,unsigned char *data);
|
||||||
|
long WINAPI ICC_Reader_WriteFlash(long ReaderHandle,int offset,int len,unsigned char *data);
|
||||||
|
|
||||||
|
//############################### <20><><EFBFBD><EFBFBD><EFBFBD>֤ ############################################################
|
||||||
|
|
||||||
|
long WINAPI PICC_Read_SAM(long ReaderHandle,unsigned char* strSam);
|
||||||
|
long WINAPI Base64_encode(char *bytes_to_encode, int in_len,int *out_len,char * t_outpData);//Base64<36><34><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
long WINAPI iReadCertInfo(long m_hReader,int iType, char *pPhotoPath, char *pPhotoData, char *Info);
|
||||||
|
long WINAPI PICC_Reader_ID_Request(long ReaderHandle);//<2F><><EFBFBD>֤Ѱ<D6A4><D1B0>
|
||||||
|
long WINAPI PICC_Reader_ID_Select(long ReaderHandle);//<2F><><EFBFBD>֤ѡ<D6A4><D1A1>
|
||||||
|
long WINAPI PICC_Reader_ID_Read(long ReaderHandle,unsigned char* Response);//<2F><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI PICC_Reader_ID_Read2(long ReaderHandle,unsigned char *data);/*<2A><>ȡ<EFBFBD><C8A1><EFBFBD>֤ <20><>Ӷ<EFBFBD>ȡָ<C8A1><D6B8><EFBFBD><EFBFBD>Ϣ*/
|
||||||
|
long WINAPI PICC_Reader_Read_CardID(long ReaderHandle,unsigned char* Response);//<2F><><EFBFBD><EFBFBD><EFBFBD>֤ID
|
||||||
|
long WINAPI PICC_Reader_ReadIDMsgWG(long ReaderHandle, const char* pBmpFile, char *pName, char *pSex, char *pNation, char *pBirth, char *pAddress, char *pCertNo, char *pDepartment , char *pEffectData, char *pExpire,char * pErrMsg,char * cardtype);
|
||||||
|
long WINAPI PICC_Reader_ReadIDMsg(long ReaderHandle, const char* pBmpFile, char *pName, char *pSex, char *pNation, char *pBirth, char *pAddress, char *pCertNo, char *pDepartment , char *pEffectData, char *pExpire,char * pErrMsg);
|
||||||
|
long WINAPI PICC_Reader_ReadIDInfo(long ReaderHandle, const char* pBmpFile, char *pName, char *pSex, char *pNation, char *pBirth, char *pAddress, char *pCertNo, char *pDepartment , char *pEffectData, char *pExpire,char * pErrMsg);
|
||||||
|
long WINAPI PICC_Reader_ReadIDMsg2(long ReaderHandle, char *pName, char *pSex, char *pNation, char *pBirth, char *pAddress, char *pCertNo, char *pDepartment , char *pEffectData, char *pExpire,unsigned char * tupian,char * pErrMsg);//ͼƬ<CDBC><C6AC>Ϣ<EFBFBD>洢<EFBFBD><E6B4A2>tupian<61><6E><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI PICC_Reader_ReadIDInfo2(long ReaderHandle,const char* pBmpFile,char *pName, char *pSex, char *pNation, char *pBirth, char *pAddress, char *pCertNo, char *pDepartment , char *pEffectData, char *pExpire,char *pFing,char * pErrMsg,char *pCardDex,char *pOrganID,char *txzhm , char * qfcs);
|
||||||
|
long WINAPI PICC_Reader_ID_CertInfo (long ReaderHandle, const char*pBmpFile, char *pName, char *pSex, char *pNation, char *pBirth, char*pAddress, char *pCertNo, char *pDepartment , char *pEffectData, char*pExpire, char *pPassPortNO, char *pSignTimes, char *pIDType, char*PhotoInBase64 );
|
||||||
|
//<2F><>Ӷ<EFBFBD>ȡָ<C8A1><D6B8><EFBFBD><EFBFBD>Ϣ <20><><EFBFBD>pBmpFile==NULL<4C><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>봫<EFBFBD><EBB4AB>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>磺C:/zhaopian/zp.bmp
|
||||||
|
long WINAPI PICC_Reader_ReadIDPhotoInfo(long ReaderHandle, char* pBmpFileData, char *pName, char *pSex, char *pNation, char *pBirth, char *pAddress, char *pCertNo, char *pDepartment , char *pEffectData, char *pExpire,char * pErrMsg);
|
||||||
|
|
||||||
|
//################################<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>################################################################
|
||||||
|
long WINAPI Rcard(long ReaderHandle,unsigned char ctime,int track,unsigned char *rlen,unsigned char *getdata);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_GetMagCardMode(long ReaderHandle,unsigned char *GetData); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
|
||||||
|
long WINAPI ICC_Reader_SetMagCardMode(long ReaderHandle,int mode, unsigned char* InData); //<2F><><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
|
||||||
|
long WINAPI PICC_Reader_SetMsg(long ReaderHandle ,unsigned char t_flag, unsigned char *SendData,int t_len, unsigned char *GetData);
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////2G 20170411
|
||||||
|
long WINAPI PICC_Reader_2G_IPCtrl(long ReaderHandle,unsigned char type,unsigned char cIPlen,unsigned char *ipData,unsigned char cPortlen,unsigned char *portData);//<2F><><EFBFBD><EFBFBD>IP
|
||||||
|
long WINAPI PICC_Reader_2G_TimeCON(long ReaderHandle,unsigned char TimeConfig);//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||||
|
long WINAPI PICC_Reader_2G_IPState(long ReaderHandle,unsigned char typeState);//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||||
|
|
||||||
|
long WINAPI ICC_GetInputPassEx(long ReaderHandle, unsigned char ctime, int *rlen, unsigned char * cpass, int disinfo,unsigned char type);//xians yuyin
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////20170712
|
||||||
|
|
||||||
|
long WINAPI PICC_Reader_OpenClose(long ReaderHandle,unsigned char typeState) ;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
/*######################ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD>λ############*/
|
||||||
|
long WINAPI ICC_CtrScanCode(long ReaderHandle,int InFlag, int WFlag) ;
|
||||||
|
long WINAPI ICC_ScanCodeSM(long ReaderHandle, int time ,unsigned char*pCodeInfo,int WFlag);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
long WINAPI ICC_ScanCodeStar(long ReaderHandle, unsigned char*pCodeInfo,int WFlag);
|
||||||
|
|
||||||
|
long WINAPI ICC_ScanCodeStop(long ReaderHandle ,unsigned char*pCodeInfo,int WFlag);
|
||||||
|
|
||||||
|
long WINAPI ICC_ScanCodeRead(long ReaderHandle, unsigned char*pCodeInfo);
|
||||||
|
|
||||||
|
long WINAPI StrToHex(unsigned char *Src, int len,unsigned char *Des);
|
||||||
|
long WINAPI HexToStr(unsigned char *Src,int len,unsigned char *Des );
|
||||||
|
/*#####################<23><>Ļ<EFBFBD><C4BB>ʾ#####################*/
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_DownloadPhoto(long ReaderHandle,int Pnumber, char* Addr);
|
||||||
|
long WINAPI ICC_Reader_DownloadParamControl(long ReaderHandle,int FlagNO, long TimeData );
|
||||||
|
long WINAPI ICC_Reader_ShowQRCode(long ReaderHandle,long momey, int lent,unsigned char * Addr );
|
||||||
|
long WINAPI ICC_Reader_CloseQRCode(long ReaderHandle );
|
||||||
|
|
||||||
|
long WINAPI ICC_GetBankCardNo(long ReaderHandle,int nType,unsigned char* bankCardNo,int* bankCardNoLen) ;//<2F><><EFBFBD>п<EFBFBD><D0BF><EFBFBD><EFBFBD><EFBFBD> nType = 0x00 ѡ<><D1A1>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD><EFBFBD>0x01ѡ<31><D1A1>ǽӿ<C7BD> <20><><EFBFBD><EFBFBD>0λִ<CEBB>гɹ<D0B3><C9B9><EFBFBD><EFBFBD><EFBFBD>0ʧ<30><CAA7>
|
||||||
|
long WINAPI PICC_Reader_SSCardInfo1(long ReaderHandle,unsigned char* pSSCardID ,unsigned char* pIDNum , unsigned char* pName ,unsigned char* pSex ,unsigned char* pBorn ) ;
|
||||||
|
|
||||||
|
long WINAPI PICC_Reader_SSCard(long ReaderHandle,unsigned char* pSSCardID );
|
||||||
|
|
||||||
|
long WINAPI ReadMifare(long ReaderHandle,int block,unsigned char * password, unsigned char* ReData);
|
||||||
|
|
||||||
|
long WINAPI WriteMifare(long ReaderHandle,int block,unsigned char * password, unsigned char* ReData);
|
||||||
|
|
||||||
|
long WINAPI PICC_Reader_GATIDMsg(long ReaderHandle, const char* pBmpFile, char *pName, char *pSex , char *pBirth, char *pAddress, char *pCertNo, char *pDepartment , char *pEffectData, char *pExpire,char * txIDNO , char * number,char* zhengjialx,char * pErrMsg);
|
||||||
|
/*###############################<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#######################*/
|
||||||
|
|
||||||
|
|
||||||
|
int WINAPI IC_Init(int Port); //<2F><><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||||
|
int WINAPI IC_Exit(); //<2F>ر<EFBFBD><D8B1>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD>
|
||||||
|
int WINAPI IC_CardRead(const char *file_name, char *data); //<2F><>ȡ<EFBFBD><C8A1>Ƭ<EFBFBD>ļ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> file_name <20><>Ҫ<EFBFBD><D2AA>ȡ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>0001
|
||||||
|
int WINAPI IC_CardNo(char *data); //<2F><>ȡ<EFBFBD><C8A1>Ƭ<EFBFBD><C6AC><EFBFBD>к<EFBFBD>
|
||||||
|
int WINAPI IC_CardInfo(char *data); //<2F><>ȡ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD><C6AC>Ϣ
|
||||||
|
int WINAPI IC_CardRandom(char *data); //<2F><>ȡ<EFBFBD><C8A1>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
int WINAPI IC_CardWrite(const char *info); //д<><D0B4> info<66><6F><EFBFBD><EFBFBD><EFBFBD>뱨<EFBFBD><EBB1A8><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>14<31><34><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>14<31><34><EFBFBD><EFBFBD>|<7C><><EFBFBD>ָ<D6B8><EEA3AC><EFBFBD>磺1|2|3|4|5|6|7|8|9|10|11|12|13|14|<7C><>
|
||||||
|
int WINAPI ICC_GetStatus(int so);
|
||||||
|
/*##################4428*/
|
||||||
|
/*############ 4428 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#################*/
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_4428_PowerOn(long ReaderHandle,unsigned char *data); //4428<32><38><EFBFBD>ϵ<EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4428_PowerOnHEX(long ReaderHandle,unsigned char *dataHex); //4428<32><38><EFBFBD>ϵ磬<CFB5><E7A3AC><EFBFBD><EFBFBD>HEX<45><58>
|
||||||
|
long WINAPI ICC_Reader_4428_PowerOff(long ReaderHandle); //4428<32><38><EFBFBD>µ<EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4428_Read(long ReaderHandle,int offset,int len,unsigned char *data); //4428<32><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4428_ReadHEX(long ReaderHandle,int offset,int len,unsigned char *dataHex); //4428<32><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD>HEX<45><58>
|
||||||
|
long WINAPI ICC_Reader_4428_Write(long ReaderHandle,int offset,int len,unsigned char *data); //4428<32><38>д<EFBFBD><D0B4><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4428_WriteHEX(long ReaderHandle,int offset,int len,unsigned char *dataHEX); //4428<32><38>д<EFBFBD><D0B4><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD>HEX<45><58>
|
||||||
|
long WINAPI ICC_Reader_4428_Verify(long ReaderHandle,unsigned char *key); //4428<32><38><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>Կ
|
||||||
|
long WINAPI ICC_Reader_4428_VerifyHEX(long ReaderHandle,unsigned char *keyHex); //4428<32><38><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>Կ<EFBFBD><D4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԿΪHEX<45><58>
|
||||||
|
long WINAPI ICC_Reader_4428_Change(long ReaderHandle,unsigned char *newkey); //4428<32><38><EFBFBD><EFBFBD><DEB8><EFBFBD>Կ
|
||||||
|
long WINAPI ICC_Reader_4428_ChangeHEX(long ReaderHandle,unsigned char *newkeyHex); //4428<32><38><EFBFBD><EFBFBD><DEB8><EFBFBD>Կ<EFBFBD><D4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԿΪHEX<45><58>
|
||||||
|
long WINAPI ICC_Reader_4428_ReadProtect(long ReaderHandle,int offset,int len,unsigned char *data); //4428<32><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4428_WriteProtect(long ReaderHandle,int offset,int len,unsigned char *data); //4428<32><38>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4428_ReadCount(long ReaderHandle); //<2F><>ȡ4428<32><38><EFBFBD><EFBFBD>Կʣ<D4BF><CAA3><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD> <20><><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>0~8<><38>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*############ 4442<34><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#################*/
|
||||||
|
long WINAPI ICC_Reader_ChangeSlot(long ReaderHandle,unsigned char icc_slot_no);/*<2A>л<EFBFBD><D0BB><EFBFBD>2<EFBFBD><32>2<EFBFBD><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
|
long WINAPI ICC_Reader_4442_PowerOn(long ReaderHandle,unsigned char *data); //4442<34><32><EFBFBD>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4442_PowerOff(long ReaderHandle); //4442<34><32><EFBFBD>µ<EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4442_Read(long ReaderHandle,int offset,int len,unsigned char *data); //4442<34><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4442_Write(long ReaderHandle,int offset,int len,unsigned char *data); //4442<34><32>д<EFBFBD><D0B4><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4442_Verify(long ReaderHandle,unsigned char *key); //4442<34><32><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>Կ
|
||||||
|
long WINAPI ICC_Reader_4442_Change(long ReaderHandle,unsigned char *newkey); //4442<34><32><EFBFBD><EFBFBD><DEB8><EFBFBD>Կ
|
||||||
|
long WINAPI ICC_Reader_4442_ReadProtect(long ReaderHandle,int offset,int len,unsigned char *data); //4442<34><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4442_WriteProtect(long ReaderHandle,int offset,int len,unsigned char *data); //4442<34><32>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
long WINAPI ICC_Reader_4442_ReadCount(long ReaderHandle); //<2F><>ȡ4442<34><32><EFBFBD><EFBFBD>Կʣ<D4BF><CAA3><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD> <20><><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>0~3<><33>
|
||||||
|
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_4442_ReadData(long ReaderHandle,int offset,int len,unsigned char *data);
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_4442_WriteData(long ReaderHandle,unsigned char *key,int offset,int len,unsigned char *data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*############ 15693 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#################*/
|
||||||
|
|
||||||
|
long WINAPI PICC_Reader_Inventory(long ReaderHandle,unsigned char* Response_APDU);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>ڵõ<DAB5><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
|
||||||
|
long WINAPI PICC_Reader_15693_Read(long ReaderHandle,unsigned char blk_add,unsigned char* Response_APDU);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ1<C8A1><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
||||||
|
long WINAPI PICC_Reader_15693_Write(long ReaderHandle,unsigned char blk_add,unsigned char* data,
|
||||||
|
unsigned char* Response_APDU);//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF>ֻ<EFBFBD><D6BB>дһ<D0B4><D2BB><EFBFBD>飩
|
||||||
|
long WINAPI PICC_Reader_API(long ReaderHandle,unsigned char* data,unsigned char* Response_APDU);//Data[0] 0<><30><EFBFBD><EFBFBD>дAPI,1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>API
|
||||||
|
long WINAPI PICC_Reader_DSFID(long ReaderHandle,unsigned char* data,unsigned char* Response_APDU);//Data[0] 0<><30><EFBFBD><EFBFBD>дDSFID,1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DSFID
|
||||||
|
long WINAPI PICC_Reader_LockDataBlock(long ReaderHandle,unsigned char blk_add,unsigned char* Response_APDU);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>ע<EFBFBD>⣺<EFBFBD>˹<EFBFBD><CBB9>̲<EFBFBD><CCB2><EFBFBD><EFBFBD>棨<EFBFBD><E6A3A8><EFBFBD>ܽ<EFBFBD><DCBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ<DEB8>
|
||||||
|
long WINAPI PICC_Reader_SystemInfor(long ReaderHandle,unsigned char *Response_APDU);//<2F><><EFBFBD>ڵõ<DAB5><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>Ϣ
|
||||||
|
|
||||||
|
|
||||||
|
long WINAPI ICC_Reader_ICData(long ReaderHandle,char * Name, char * CardNo, char * ID , char* ksbm,char * gmbb);
|
||||||
|
long WINAPI hs_ReadMFEF06(HANDLE icdev,char *IDnum,char *name,char *exname,char *sex,char *nation,char *addr,char *birthday);
|
||||||
|
long WINAPI hs_ReadMFEF05(HANDLE icdev,char *pincode,char *cardtype,char *version,char *orgnum,char *starttime,char *endtime,char *cardnum);
|
||||||
|
|
||||||
|
long WINAPI ReadSiHB(long ReaderHandle , char* SiCode,char*Ver,char*CardNo,char*IdNo,char* Name,char*Sex);
|
||||||
|
long WINAPI PICC_Reader_SSCardSZID(long ReaderHandle , char* pIDNum );
|
||||||
|
long WINAPI PICC_Reader_SFZID(long ReaderHandle, char *pCertNo,char * pErrMsg);
|
||||||
|
long WINAPI PICC_Reader_selectType(long ReaderHandle,char* TypeID);
|
||||||
|
long WINAPI ICC_ScanCode(long ReaderHandle, unsigned char*pCodeInfo, int outTine);
|
||||||
|
long WINAPI iReadCardBas(int iType, char* pOutInfo);
|
||||||
|
long WINAPI iReadCardBas_HSM_Step1(int iType, char* pOutInfo);
|
||||||
|
long WINAPI iReadCardBas_HSM_Step2(char *pKey, char* pOutInfo);
|
||||||
|
long WINAPI iGetDevUID(char *pOutInfo);
|
||||||
|
long WINAPI ICC_SelscetScan(long ReaderHandle, unsigned char*pCodeInfo , int * lent);
|
||||||
|
long WINAPI ICC_StopSelscetScan(long ReaderHandle);
|
||||||
|
long WINAPI PICC_IDCard_Read(long ReaderHandle,const char *pcBmpPath, char *pcTypeID, char *Info, char *pcErrMsg);
|
||||||
|
|
||||||
|
|
||||||
|
int WINAPI iOpenPort( char * pErrMsg);
|
||||||
|
int WINAPI iClosePort(char* pErrMsg);
|
||||||
|
int WINAPI iReadPin (int pCtrlType,int outtime, char* pErrMsg ,char *pInputPin);
|
||||||
|
|
||||||
|
long WINAPI ixunReader(char *pInputPin);
|
||||||
|
long WINAPI PICC_Reader_ReadIDCard(long ReaderHandle,char * msg);
|
||||||
|
int WINAPI GetCardType();
|
||||||
|
int WINAPI GetName(char * Info);
|
||||||
|
int WINAPI GetSex(char * Info);
|
||||||
|
int WINAPI GetNation(char * Info);
|
||||||
|
int WINAPI GetBirth(char * Info);
|
||||||
|
int WINAPI GetAddress(char * Info);
|
||||||
|
int WINAPI GetCertNo(char * Info);
|
||||||
|
int WINAPI GetDepartemt(char * Info);
|
||||||
|
int WINAPI GetEffectDate(char * Info);
|
||||||
|
int WINAPI GetExpireDate(char * Info);
|
||||||
|
int WINAPI GetBmpFileData(char * Info);
|
||||||
|
int WINAPI GetBmpFile(char* pBmpfilepath);
|
||||||
|
int WINAPI IsFingerExist();
|
||||||
|
int WINAPI GetFingerprint(unsigned char* fpInfo);
|
||||||
|
int WINAPI GetEnName(char * Info);
|
||||||
|
int WINAPI GetNationalityCode(char * Info);
|
||||||
|
int WINAPI GetTXZHM(char * Info);
|
||||||
|
int WINAPI GetTXZQFCS(char * Info);
|
||||||
|
int WINAPI GetHZCS(char * Info);
|
||||||
|
|
||||||
|
|
||||||
|
int WINAPI OpenReader(int a1);
|
||||||
|
int WINAPI CloseReader();
|
||||||
|
int WINAPI CardRest(int a1, char * a2, int *a3);
|
||||||
|
int WINAPI SendCmd(int a1, char *a2, char *a3);
|
||||||
|
bool WINAPI CardHalt();
|
||||||
|
int WINAPI ReadIDPic(int a1, char * a2);
|
||||||
|
int WINAPI HD_PosBeep(int a1);
|
||||||
|
|
||||||
|
/*********************<2A><><EFBFBD>п<EFBFBD>*************************************/
|
||||||
|
int ICC_GetInfo(long ReaderHandle,int nType,char *TagList, char *AIDList,char *UserInfo);
|
||||||
|
int ICC_GetTxDetail(long ReaderHandle,int nType,char *AIDList,char *TrDtail);
|
||||||
|
int ICC_GenARQC(long ReaderHandle,int nType ,char *TxData,char *AIDList,char *ARQCLen,char *ascARQC,char *hexARQC);
|
||||||
|
int ICC_ARPC_ExeICScript(long ReaderHandle,int nType,char *TxData,char *ARPCLen, char *hexARPC,char *Status,char *TC, char *ScriptResult);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
0
src/main/resources/win32-x86-64/SSSE32.lib
Normal file
0
src/main/resources/win32-x86-64/SSSE32.lib
Normal file
BIN
src/main/resources/win32-x86-64/autoreplyprint.dll
Normal file
BIN
src/main/resources/win32-x86-64/autoreplyprint.dll
Normal file
Binary file not shown.
BIN
src/main/resources/win32-x86-64/autoreplyprint.exp
Normal file
BIN
src/main/resources/win32-x86-64/autoreplyprint.exp
Normal file
Binary file not shown.
3405
src/main/resources/win32-x86-64/autoreplyprint.h
Normal file
3405
src/main/resources/win32-x86-64/autoreplyprint.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/main/resources/win32-x86-64/autoreplyprint.lib
Normal file
BIN
src/main/resources/win32-x86-64/autoreplyprint.lib
Normal file
Binary file not shown.
4
src/main/resources/win32-x86-64/copydll.bat
Normal file
4
src/main/resources/win32-x86-64/copydll.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
copy ..\..\build-autoreplyprint-QT5_6_0_VC2015_STATIC_64-Release\release\autoreplyprint.dll . /y
|
||||||
|
copy ..\..\build-autoreplyprint-QT5_6_0_VC2015_STATIC_64-Release\release\autoreplyprint.exp . /y
|
||||||
|
copy ..\..\build-autoreplyprint-QT5_6_0_VC2015_STATIC_64-Release\release\autoreplyprint.lib . /y
|
||||||
|
copy ..\..\..\autoreplyprint_src\autoreplyprint_main\autoreplyprint.h . /y
|
||||||
BIN
src/main/resources/win32-x86/SSSE32.dll
Normal file
BIN
src/main/resources/win32-x86/SSSE32.dll
Normal file
Binary file not shown.
BIN
src/main/resources/win32-x86/UnPack.dll
Normal file
BIN
src/main/resources/win32-x86/UnPack.dll
Normal file
Binary file not shown.
@@ -1,13 +0,0 @@
|
|||||||
package com.dpkj.ems;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
@SpringBootTest
|
|
||||||
class EmsExpressBridgeApplicationTests {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void contextLoads() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
package com.dpkj.ems.utils;
|
|
||||||
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import cn.hutool.core.lang.Console;
|
|
||||||
import com.dpkj.Application;
|
|
||||||
import com.dpkj.common.config.FileConfig;
|
|
||||||
import com.dpkj.modules.express.service.PrinterService;
|
|
||||||
import com.dpkj.modules.express.utils.FileUtils;
|
|
||||||
import com.dpkj.modules.express.utils.PrinterUtil;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RunWith(SpringRunner.class)
|
|
||||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = Application.class)
|
|
||||||
class PrinterUtilTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PrinterService printerService;
|
|
||||||
@Autowired
|
|
||||||
private FileConfig fileConfig;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void getPrintSDK() throws PrinterUtil.PrinterRegistrationException {
|
|
||||||
PrinterUtil.MsPrintSdk sdk = PrinterUtil.getPrintSDK();
|
|
||||||
int i = sdk.SetUsbportauto();
|
|
||||||
Console.log(i);
|
|
||||||
|
|
||||||
int i1 = sdk.SetInit();
|
|
||||||
Console.log(i1);
|
|
||||||
|
|
||||||
int i2 = sdk.GetStatusspecial();
|
|
||||||
Console.log(i2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void t2() throws IOException {
|
|
||||||
String base64Path = "G:\\Temp\\text\\base64.txt";
|
|
||||||
String base64 = FileUtil.readString(FileUtil.file(base64Path), StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
String bpmPath = "G:\\Temp\\img";
|
|
||||||
List<BufferedImage> bufferedImages = FileUtils.convertBase64PdfToBufferedImage(base64);
|
|
||||||
FileUtils.saveBufferedImageToBmp(bufferedImages);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void t3() throws Exception {
|
|
||||||
String base64Path = "G:\\Temp\\text\\base64.txt";
|
|
||||||
String base64 = FileUtil.readString(FileUtil.file(base64Path), StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
// String bpmPath = "G:\\Temp\\img";
|
|
||||||
String bpmPath = fileConfig.getPath();
|
|
||||||
List<BufferedImage> bufferedImages = FileUtils.convertBase64PdfToBufferedImage(base64);
|
|
||||||
List<File> files = FileUtils.saveBufferedImageToBmp(bufferedImages);
|
|
||||||
|
|
||||||
/*for (File file : files) {
|
|
||||||
String filePath = file.getAbsolutePath();
|
|
||||||
printerService.printBmpByPath(filePath);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void t4() throws IOException {
|
|
||||||
String base64Path = "G:\\Temp\\text\\base64.txt";
|
|
||||||
String base64 = FileUtil.readString(FileUtil.file(base64Path), StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
List<BufferedImage> bufferedImages = FileUtils.convertBase64PdfToBufferedImage(base64);
|
|
||||||
System.out.println(bufferedImages);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package com.dpkj.ems.utils;
|
|
||||||
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import com.dpkj.modules.express.utils.FileUtils;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
class PrinterUtilTest2 {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void t4() throws IOException {
|
|
||||||
String base64Path = "G:\\Temp\\text\\base64.txt";
|
|
||||||
String base64 = FileUtil.readString(FileUtil.file(base64Path), StandardCharsets.UTF_8);
|
|
||||||
|
|
||||||
List<BufferedImage> bufferedImages = FileUtils.convertBase64PdfToBufferedImage(base64);
|
|
||||||
System.out.println(bufferedImages);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user