Skip to content

Commit

Permalink
[-] Added fix for FFD 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Kravtsov committed Feb 3, 2022
1 parent 6d25616 commit 1df710d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Source/Core/src/com/shtrih/jpos/fiscalprinter/FSService.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,14 @@ private void checkData() throws Exception {
//saveToFile(data, String.format("FSDocument_%04d.bin", packetNumber));

// P-protocol version 0x0102 -> 0x0120
if ((data.length >= 30) && (data[6] == 0x01) && (data[7] == 0x02)
if ((data.length >= 30) && (data[6] == 0x01)
&& (data[28] == 0) && (data[29] == 0)) {
data[7] = 0x20;
if (data[7] == 0x01) {
data[7] = 0x10;
}
if (data[7] == 0x02) {
data[7] = 0x20;
}
}
//saveToFile(data, String.format("OFDDocument_%04d.bin", packetNumber));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.shtrih.util;

public class ServiceVersion {
public static final String VERSION = "640-1-geba6e7e";
public static final String VERSION = "640-2-g6d25616";
}
2 changes: 1 addition & 1 deletion Source/FiscalPrinterTest/Res/jpos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- <prop name="portName" type="String" value="COM8"/> -->
<!--Baudrate 2400;4800;9600;19200;38400;57600;115200;230400;460800 -->
<!--<prop name="portName" type="String" value="192.168.137.111:7778"/>-->
<prop name="portName" type="String" value="COM4"/>
<prop name="portName" type="String" value="COM8"/>
<prop name="baudRate" type="String" value="115200"/>
<!--Default department-->
<prop name="department" type="String" value="0"/>
Expand Down

0 comments on commit 1df710d

Please sign in to comment.