ESC/POS 124Chars limit in QRcode printing - qr-code

I'm having an issue, regarding printing commands through ESC/POS to print a QR code, with more than 124 chars. I have seen different posts on Stack Overflow, but can't understand what is wrong with this.
To contextualize, the idea, is to print a qrcode in a receipt. The data is written to a text file, and after that is used by a service (rawbt) which prints the receipt in a thermal printer (those small ones)
I have a code that prints until 124 chars of data in qrcode correctly, but can't figure out how to print more in the same QR. extra text just shows up above QR code.
string QrData = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 XX";
int store_len = (QrData).Length + 3;
byte store_pL = (byte)(store_len % 256);
byte store_pH = (byte)(store_len / 256);
byte[] b = new byte[] { 29, 40, 107, 4, 0, 49, 65, 50, 0 };
byte[] b1 = new byte[] { 29, 40, 107, 3, 0, 49, 67, 9 };
byte[] b2 = new byte[] { 29, 40, 107, 3, 0, 49, 69, 48 };
byte[] b3 = new byte[] { 29, 40, 107, store_pL, store_pH, 49, 80, 48 };
byte[] bytes = Encoding.ASCII.GetBytes(QrData);
byte[] b4 = new byte[] { 29, 40, 107, 3, 0, 49, 81, 48 };
after that just use BinaryWriter to write this to the text file.
I've already tried other encodings, like utf-8 and iso-8859-1, but no luck.
Also did some play with store_pL and store_pH.
Did also some tests, when if the qrdata.length is > 124, adds up 128 to it, making the store_pL higher, and setting the store_pH to 0. If store_pH is higher than 0, no printing occurs.
note: this is a xamarin app.
Anyone knows please how to solve this?
Thanks in advance!

I am working with an Epson TM-m30II.
I found a solution for this problem. The problem is well described in this post:
EPSON ESCPOS QRCode >380 characters not print
In my program I worked with the java.io.PrintWriter. This apparently only supports the ASCII character set up to Dec(127) (https://en.wikipedia.org/wiki/ASCII).
If the QR is longer than 124 + 3 characters, an incorrect value is sent in the store_pL byte and the printer does not know the length of the transmitted data.
I solved the problem by not using the java.io.PrintWriter but the java.io.DataOutputStream.
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
public class EscPos {
public static void main(String[] args) throws IOException {
Socket sock = new Socket("192.168.10.45", 9100);
DataOutputStream outputStream = new DataOutputStream(sock.getOutputStream());
String qrCode = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 XX";
int store_len = qrCode.length() + 3;
byte store_pL = (byte) (store_len % 256);
byte store_pH = (byte) (store_len / 256);
outputStream.flush();
// https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=140 (165)
byte [] bSendFunktion165 = {(byte)0x1D, (byte)0x28, (byte)0x6B, (byte)0x04, (byte)0x00, (byte)0x31, (byte)0x41, (byte)0x32, (byte)0x00};
outputStream.write(bSendFunktion165);
//https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=141 (167)
byte [] bSendFunktion167 = {(byte)0x1D, (byte)0x28, (byte)0x6B, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x43, (byte)0x9};
outputStream.write(bSendFunktion167);
//https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=142 (169)
byte [] bSendFunktion169 = {(byte)0x1D, (byte)0x28, (byte)0x6B, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x45, (byte)0x30};
outputStream.write(bSendFunktion169);
//https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=143 (180)
byte [] bSendFunktion180 = {(byte)0x1D, (byte)0x28, (byte)0x6B, store_pL, store_pH, (byte)0x31, (byte)0x50, (byte)0x30};
outputStream.write(bSendFunktion180);
byte [] bSendQRCode = qrCode.getBytes();
outputStream.write(bSendQRCode);
//https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=143 (181)
byte [] bSendFunktion181 = {(byte)0x1D, (byte)0x28, (byte)0x6B, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x51, (byte)0x30};
outputStream.write(bSendFunktion181);
outputStream.flush();
outputStream.write((byte)0x0A);
outputStream.write((byte)0x0A);
outputStream.write((byte)0x0A);
outputStream.write((byte)0x0A);
byte [] bCut = {(byte)0x1D, (byte)0x56, (byte)0x30};
outputStream.write(bCut);
//------------------------------------------------------------------
outputStream.close();
sock.close();
}
}
I hope I could help you. Happy holidays
Steffi

Related

Can't replicate hashing of string

I need to reproduce a JS function that hashes a string with SHA-256 in r.
The said function is:
function hashPhrase (phrase) {
const buf = new ArrayBuffer(phrase.length * 2)
const bufView = new Uint16Array(buf)
const strLen = phrase.length
for (let i = 0; i < strLen; i++) {
bufView[i] = phrase.charCodeAt(i)
}
return window.crypto.subtle.digest('SHA-256', buf)
.then(hashArrayBuffer => {
let binary = ''
const bytes = new Uint8Array(hashArrayBuffer)
const len = bytes.byteLength
for (let i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i])
}
return Promise.resolve(window.btoa(binary))
})
}
Calling the function:
hashPhrase('test').then(x => { console.log(x) })
gives me:
/lIGdrGh2T2rqyMZ7qA2dPNjLq7rFj0eiCRPXrHeEOs=
as output.
I load openssl and try to use sha256 as function to hash the string.
library(openssl)
phrase = "test"
phraseraw = charToRaw(phrase)
base64_encode(sha256(phraseraw))
and the output is:
[1] "n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="
Don't know if the problem is the uint16 because in both cases I guess that the variable is being passed as raw.
I'll appreciate very much any help.
Because you created an Uint16Array, you are using two bytes per character and those values are presumably being stored in little-endian byte order. By default in R, since you just have ASCII characters, it is just using one byte per character. So with javascript you are digesting the bytes
[116, 0, 101, 0, 115, 0, 116, 0]
But with the R code you are digesting the bytes.
[116, 101, 115, 116]
If you really want to include those padded values in R like you do in javascript, you can convert to UTF16-LE before the digest
phrase = "test"
phraseraw = iconv(phrase,from="ASCII", to="UTF-16LE",toRaw = TRUE)[[1]]
base64_encode(sha256(phraseraw))
# [1] "/lIGdrGh2T2rqyMZ7qA2dPNjLq7rFj0eiCRPXrHeEOs="
So really just make sure you are encoding your string into bytes in the exact same way in both languages.

How to decrypt a message using the Vigenere Cipher

Recently, I have been trying to educate myself on how to encrypt and decrypt using the Vigenere Cipher.
I have successfully encrypted the message and these are the steps I undertook to achieve encryption:
Encryption Key: Set
Message: Top secret
Step 1: Numerical representation of key is 18, 4, 19 (Using the table below)
Working Out:
Reminder:
P is the set of plaintext units
C is the set of ciphertext units
K is the set of keys
E: P x K -> C is the encryption function
D: C x K -> P is the decryption function
Plaintext: top secret
Ciphertext: ISIKIVJIM
Although I have managed to encrypt the message "top secret" I am struggling to decrypt messages using the Vigenere Cipher method using the numerical technique I used above. Can someone explain to me how I can decrypt lets say: ISIKIVJIM (the ciphertext from above) to its original plain text message which is "top secret".
Thanks.
As pointed out in the comments the decryption formula is : p = c - k mod 26, also note that we have to perform modular arithmetic so our answer for any input should belong in the range of 0 - 25, i.e if we get a negative number we can add 26(i.e the number we are taking modulo by) until we are within this range you can read more about this here :
https://en.wikipedia.org/wiki/Modular_arithmetic
So the decryption will be like :
L = 11 - 18 = -7 mod 26 = -7 + 26 = 19 = T
S = 18 - 4 = 14 mod 26 = 14 = O
I = 8 - 19 = -11 mod 26 = -11 + 26 = 15 = P
ans so on...
I have also written a c++ code : http://ideone.com/M3BAmq
I recently wrote a java program that encrypts and decrypts in Vigenere using bytes. You need to convert the plain text/ crypt text into byte array and pass it in.
public static byte [] encryptVigenere (byte [] pt, String key)
{
byte [] c_text = new byte [pt.length];
byte [] key_text = key.getBytes();
byte tmp;
int shift;
for (int i = 0, j = 0; i < pt.length; i++)
{
if (j >= key_text.length)
j = 0;
shift = key_text[j] - 65; //index of alphabet
tmp = (byte) (pt[i] + shift);
if (tmp > 'Z')
tmp = (byte) (pt[i] - (26-shift));
c_text[i] = tmp;
j++;
}
return c_text;
}
public static byte [] decryptVigenere (byte [] ct, String key)
{
byte [] p_text = new byte [ct.length];
byte [] key_text = key.getBytes();
byte tmp;
int shift;
for (int i = 0, j = 0; i < ct.length; i++)
{
if (j >= key_text.length)
j = 0;
shift = key_text[j] - 65; //index of alphabet
tmp = (byte) (ct[i] - shift);
if (tmp < 'A')
tmp = (byte) (ct[i] + (26-shift));
p_text[i] = tmp;
j++;
}
return p_text;
}

android hexToByteArray signed to unsigned

I've got the following function to make a conversion from a Hex String to a Byte array. Then, I calculate the Checksum:
private String CalcChecksum (String message) {
/**Get string's bytes*/
//byte[] bytes = DatatypeConverter.parseHexBinary(message.replaceAll("\\s","")).getBytes();
message = message.replaceAll("\\s","");
byte[] bytes = hexToByteArray(message);
byte b_checksum = 0;
for (int byte_index = 0; byte_index < bytes.length; byte_index++) {
b_checksum += bytes[byte_index];
}
int d_checksum = b_checksum; //Convert byte to int(2 byte)
int c2_checksum = 256 - d_checksum; //Hacer complemento a 2
String hexString = Integer.toHexString(c2_checksum); //Convertir el entero (decimal) a hexadecimal
return hexString;
}
public static byte[] hexToByteArray(String s) {
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i+1), 16));
}
return data;
}
Making some test, for example for the hex value "e0", the hexToByteArray is getting the value "-32". So the final returning value in the CalcChecksum is "17a".
What I need is to get unsigned values in the hexToByteArray function. This is because i need to send the Checksum in a hexString to a MCU where the Checksum is calculated with unsigned values, so isntead of get the "-32" value, it gets "224" and the final hex value is "7a" instead of "17a".
i think that doing some kind of conversion like when the byte result is a negative value, do something like 255 + "negative value" + 1. This will convert "-32" into "224".
The problem is that i'm trying to do it, but i'm having some errors making the conversions between bytes, int, etc...
So, how could i do?
For the moment, I think that this can be the solution.
Just including in the CalcChecksum function the next code after int d_checksum = b_checksum;:
if (d_checksum < 0) {
d_checksum = 255 + d_checksum + 1;
}

Multiple serial values from arduino to processing?

I have a small problem.
I am passing information from an arduino attached 3 axis accelerometer + 3 axis magnetometer + compass heading. These are scaled to midi ranges (0-127).
ARDUINO:
This is passed in a serial print with a format like 76a45b120c23d12e23f34g
Serial.print(shiftAx);
Serial.print("a");
Serial.print(shiftAy);
Serial.print("b");
Serial.print(shiftAz);
Serial.print("c");
Serial.print(shiftMx);
Serial.print("d");
Serial.print(shiftMy);
Serial.print("e");
Serial.print(shiftMz);
Serial.print("f");
Serial.print(shiftHead);
Serial.print("g");
I can see this works using my serial monitor. (however I am unsure as to print it as println at "g" or not.)
PROCESSING 2:
I buffer until g
in my void setup()
port = new Serial(this, "/dev/tty.usbmodem411", 9600);
port.bufferUntil('g');
i have the function
void serialEvent (Serial port)
{
data = port.readStringUntil('g');
AxVal = data.substring(0, data.indexOf('a'));
AyVal = data.substring(data.indexOf("a") + 1, data.indexOf("b"));
AzVal = data.substring(data.indexOf("b") + 1, data.indexOf("c"));
MxVal = data.substring(data.indexOf("c") + 1, data.indexOf("d"));
MyVal = data.substring(data.indexOf("d") + 1, data.indexOf("e"));
MzVal = data.substring(data.indexOf("e") + 1, data.indexOf("f"));
HeadVal = data.substring(data.indexOf("f") + 1, data.indexOf("g"));
}
THE PROBLEM
So this doesn't work. No text displayed. (its just a simple fill(), text())
I don't see why. Is the problem my protocol (if I can call it that), how I'm unpacking the string? Or some other problem.
I am very confused.
I can get it to work with just two values as in this tutorial
notes:
The arduino main loop is on delay(100);
arduino is at 9600 baud rate
I shall attach the whole sketches if needed to help me, which I shall extend my thanks beforehand.
CODE:
PROCESSING
import themidibus.*; //Import the library
import javax.sound.midi.MidiMessage; //Import the MidiMessage classes http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/midi/MidiMessage.html
import javax.sound.midi.SysexMessage;
import javax.sound.midi.ShortMessage;
import processing.serial.*;
MidiBus myBus; // The MidiBus
Serial port;
String AxVal = " ", AyVal = " ", AzVal = " ";
String MxVal = " ", MyVal = " ", MzVal = " ";
String HeadVal = " ";
String AxString="Ax",AyString = "Ay",AzString = "Az";
String MxString="Mx",MyString = "My",MzString = "Mz";
String HeadString="Heading";
String data = " ";
PFont font;
int status_byte = 0xB0; // send control change
int channel_byte = 0; // On channel 0
int first_byte; // cc number;
int second_byte; // value
void setup()
{
size(1000,500);
port = new Serial(this, "/dev/tty.usbmodem411", 9600);
port.bufferUntil('g');
font = loadFont("NanumBrush-48.vlw");
textFont(font, 48);
MidiBus.list(); // List all available Midi devices on STDOUT. This will show each device's index and name.
myBus = new MidiBus(this, 1, 0); // Create a new MidiBus object
}
void draw()
{
background(0,0,0);
//first_byte = 1;
//second_byte = int(AxVal); // But with less velocity
//myBus.sendMessage(status_byte, channel_byte, first_byte, second_byte);
fill(46, 209, 2);
text(AxVal, 60, 75);
text(AxString, 60, 125);
//first_byte = 2;
//second_byte = int(AyVal); // But with less velocity
//myBus.sendMessage(status_byte, channel_byte, first_byte, second_byte);
fill(0, 160, 153);
text(AyVal, 120, 75);
text(AyString,120,125);
// first_byte = 3;
//second_byte = int(AzVal); // But with less velocity
//myBus.sendMessage(status_byte, channel_byte, first_byte, second_byte);
fill(0, 160, 153);
text(AzVal, 180, 75);
text(AzString,180,125);
/*
first_byte = 4;
second_byte = int(MxVal); // But with less velocity
myBus.sendMessage(status_byte, channel_byte, first_byte, second_byte);
fill(0, 160, 153);
text(MxVal, 240, 75);
text(MxString,240,125);
first_byte = 5;
second_byte = int(MyVal); // But with less velocity
myBus.sendMessage(status_byte, channel_byte, first_byte, second_byte);
fill(0, 160, 153);
text(MyVal, 300, 75);
text(MyString,300,125);
first_byte = 6;
second_byte = int(MzVal); // But with less velocity
myBus.sendMessage(status_byte, channel_byte, first_byte, second_byte);
fill(0, 160, 153);
text(MzVal, 360, 75);
text(MzString,360,125);
first_byte = 7;
second_byte = int(HeadVal); // But with less velocity
myBus.sendMessage(status_byte, channel_byte, first_byte, second_byte);
fill(0, 160, 153);
text(HeadVal, 420, 75);
text(HeadString,420,125);
*/
}
void serialEvent (Serial port)
{
data = port.readStringUntil('g');
data = data.substring(0, data.length() - 1);
AxVal = data.substring(0, data.indexOf('a'));
AyVal = data.substring(data.indexOf("a") + 1, data.indexOf("b"));
AzVal = data.substring(data.indexOf("b") + 1, data.length());
/*
index = data.indexOf("c")+1;
MxVal = data.substring(index, data.indexOf("d"));
index = data.indexOf("d")+1;
MyVal = data.substring(index, data.indexOf("e"));
index = data.indexOf("e")+1;
MzVal = data.substring(index, data.indexOf("f"));
index = data.indexOf("f")+1;
HeadVal = data.substring(index, data.indexOf("g"));
*/
}
/*
void serialEvent (Serial port)
{
data = port.readStringUntil('g');
AxVal = data.substring(0, data.indexOf('a'));
AyVal = data.substring(data.indexOf("a") + 1, data.indexOf("b"));
AzVal = data.substring(data.indexOf("b") + 1, data.indexOf("c"));
MxVal = data.substring(data.indexOf("c") + 1, data.indexOf("d"));
MyVal = data.substring(data.indexOf("d") + 1, data.indexOf("e"));
MzVal = data.substring(data.indexOf("e") + 1, data.indexOf("f"));
HeadVal = data.substring(data.indexOf("f") + 1, data.indexOf("g"));
}
ARDUINO:
// Add lastvalue check
#include <Wire.h>
#include <LSM303DLH.h>
LSM303DLH glove;
//set max min magnetometer
int maxMx = +353, maxMy = +527, maxMz = 426;
int minMx = -700, minMy = -477, minMz = -561;
int maxA = 2019;
int minAx = -1043, minAy = -2048, minAz = -2048;
int shiftMx,shiftMy,shiftMz;
int shiftAx,shiftAy,shiftAz;
float shiftHeadTemp;
int shiftHead;
void setup()
{
Wire.begin();
glove.enableDefault();
Serial.begin(9600);
}
void loop()
{
glove.read();
shiftMx = ((glove.m.x - minMx) / (maxMx - minMx)) * 127;
shiftMy = ((glove.m.y - minMy) / (maxMy - minMy)) * 127;
shiftMz = ((glove.m.z - minMz) / (maxMz - minMz)) * 127;
shiftAx = ((glove.a.x - minAx) / (maxA - minAx)) * 127;
shiftAy = ((glove.a.y - minAy) / (maxA - minAy)) * 127;
shiftAz = ((glove.a.z - minAz) / (maxA - minAz)) * 127;
shiftHeadTemp = (glove.heading((LSM303DLH::vector){0,-1,0}));
shiftHead = (shiftHeadTemp/360)*127;
if (shiftMx < 0){shiftMx=0;}
if (shiftMx >127){shiftMx=127;}
if (shiftMy < 0){shiftMy=0;}
if (shiftMy >127){shiftMy=127;}
if (shiftMz < 0){shiftMz=0;}
if (shiftMz >127){shiftMz=127;}
if (shiftAx < 0){shiftAx=0;}
if (shiftAx >127){shiftAx=127;}
if (shiftAy < 0){shiftAy=0;}
if (shiftAy >127){shiftAy=127;}
if (shiftAz < 0){shiftAz=0;}
if (shiftAz >127){shiftAz=127;}
if (shiftHead < 0){shiftHead=0;}
if (shiftHead >127){shiftHead=127;}
Serial.print(shiftAx);
Serial.print("a");
Serial.print(shiftAy);
Serial.print("b");
Serial.print(shiftAz);
Serial.print("c");
Serial.print(shiftMx);
Serial.print("d");
Serial.print(shiftMy);
Serial.print("e");
Serial.print(shiftMz);
Serial.print("f");
Serial.print(shiftHead);
Serial.println("g");
delay(100);
}
I can't test your code right now but here are some ideas.
You could send JSON from your Arduino to processing. Here is the example I'm using in one of my own project but you could easily adapt it to suit your needs:
void sendJson(){
String json;
json = "{\"accel\":{\"x\":";
json = json + getXYZ(0);
json = json + ",\"y\":";
json = json + getXYZ(1);
json = json + ",\"z\":";
json = json + getXYZ(2);
json = json + "},\"gyro\":{\"yaw\":";
json = json + getYPR(0);
json = json + ",\"pitch\":";
json = json + getYPR(1);
json = json + ",\"roll\":";
json = json + getYPR(2);
json = json + "}}";
Serial.println(json);
}
The good thing about JSON is that it is easily "parsable" with processing using the getType() function. No more readUntil, it all goes like this: (note that in void setup() you need to change port.bufferUntil('g'); to port.bufferUntil('\n'); because in the Arduino, json is sent with Serial.println();)
void serialEvent (Serial port){
String json = port.readString();
shiftAx = getInt("shiftAx");
shiftAy = getInt("shiftAy"); // and so on...
}
You will have to change your code a little but it will be a lot more maintainable in the long run, say if you add more sensors. You'll just need to change the json in arduino and simply get the value in processing.
Another thing: you could use the constrain function to constrain your value between 0 and 127.
value = constrain(value, 0, 127);
Hope it helps!
I've got the same issue in c# ( the second parameter, in c# is the length of the substracting string). However, I saw that if I do not wait a little bit of time, the string transmitted is not always in the same form: such that: somtime, your string will be (value)a(value)b(value)c(value)d(value)e(value)f(value)g , BUT other times will be: (value)a(value)b(value)c(value)d(value) and the next string will be e(value)f(value)g(value)a(value)b(value) and so on... Well after all, all the data will be transmited, but it will not have the same structure, so I added a little bit of delay before every serial reading (to be sure that the previous serial string was read till the and and every timpe I get the string in the same form), and it works fine for me. Hope it is helpful for you too.

Unknown time and date format

I'm using code that someone else wrote to load a file format that I can't find any docs or specs for. The file format is *.vpd which is the output of varioport readers used for EKG's.
It reads out 4 bytes for the time and 4 bytes for the date and are each stored in a 4 element array. In a test file I have, the 4 time bytes are { 19, 38, 3, 0 } and the 4 date bytes are { 38, 9, 8, 0 }. It could also be a 32-bit int, and the guy who wrote this is reading it wrong. Judging by the trailing 0 on both, I would assume little endian in which case the values of time and date as int32's are 206355 and 526630 respectively.
Do you know of any time/date formats that are expressed in 4 bytes (or a single int)? I'm hopelessly lost at the moment.
EDIT: I should add that I don't know what the values could be, apart from that the date is likely to be within the last few years.
The code, there are no comments associated with it.
s.Rstime = fread(fid, 4, 'uint8');
s.Rsdate = fread(fid, 4, 'uint8');
In the Varioport VPD file format, BCD (binary coded decimal) code is used for date and time. You had no chance to guess this, because the fread calls you posted are obviously nonsense. You are reading at the wrong places.
Try this in C/C++ (matlab code will look very similar):
typedef struct
{
int channelCount;
int scanRate;
unsigned char measureDate[3];
unsigned char measureTime[3];
...
}
VPD_FILEINFO;
...
unsigned char threeBytes[3];
size_t itemsRead = 0;
errno_t err = _tfopen_s(&fp, filename, _T("r+b"));
// n.b.: vpd files have big-endian byte order!
if (err != 0)
{
_tprintf(_T("Cannot open file %s\n"), filename);
return false;
}
// read date of measurement
fseek(fp, 16, SEEK_SET);
itemsRead = fread(&threeBytes, 1, 3, fp);
if (itemsRead != 3)
{
_tprintf(_T("Error trying to read measureDate\n"));
return false;
}
else
{
info.measureDate[0] = threeBytes[0]; // day, binary coded decimal
info.measureDate[1] = threeBytes[1]; // month, binary coded decimal
info.measureDate[2] = threeBytes[2]; // year, binary coded decimal
}
// read time of measurement
fseek(fp, 12, SEEK_SET);
itemsRead = fread(&threeBytes, 1, 3, fp);
if (itemsRead != 3)
{
_tprintf(_T("Error trying to read measureTime\n"));
return false;
}
else
{
info.measureTime[0] = threeBytes[0]; // hours, binary coded decimal
info.measureTime[1] = threeBytes[1]; // minutes, binary coded decimal
info.measureTime[2] = threeBytes[2]; // seconds, binary coded decimal
}
...
_tprintf(_T("Measure date == %x %x %x\n"),
info.measureDate[0],
info.measureDate[1],
info.measureDate[2]);
_tprintf(_T("Measure time == %x %x %x\n"),
info.measureTime[0],
info.measureTime[1],
info.measureTime[2]);
It's not important anymore, I doubt anyone would be able to answer it anyway.

Resources