Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
convert string to hex
hello, how can i convert QString to hex this is part of my code :
if a=="ffaabbccdd" is working fine but
if a=="veyselolgun" it is not work correctly
can anyone help me
Mark81 last edited by
Your code just assigns to
avariable the content of your
QLineEdit. It's not clear what do you mean with "convert to hex". Hex it just a presentation format, not the number itself. If you have an hex string (like "ffaabbccdd") you can convert it to a number:
QString a = "ffaabbccdd"; qDebug() << a.toLongLong(nullptr, 16); // output: 1098081094877
and of course it won't work with "veyselolgun" because it's not a valid hex string.
i want to send to card reader when i entry to Qlineedit veyselolgun data, and i want to receive this data veyselolgun from card reader
for example when i entry to Qlineedit aabbccddeeff data, it sending to card reader and i am receiving response that is aabbccddeeff from card reader
i hope i express what i want to do
What exactly is your card reader expecting ?
Example: write to block 40: “00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F” //this is what i send but i want to send for example "hello world" or "data was written"
REQUEST : HOST->READER: 02 1B 00 3E DF 78 12 A6 28 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 1C 03
ACKOWLEDGE : READER->HOST: 02 08 00 3E 00 00 34 03
RESPONSE : READER->HOST: 02 0D 00 3E FF 01 04 DF 78 01 A6 CB 03
when i want to read block of 40 i have to show that :
Example: read block 40 (0x28)
Successful read of “00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F”:
REQUEST : HOST->READER: 02 0B 00 3E DF 78 02 A5 28 1F 03
ACK : READER->HOST: 02 08 00 3E 00 00 34 03
RESPONSE : READER->HOST: 02 1D 00 3E FF 01 14 DF 78 11 A5 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F D8 03 //if i write hello worldworld i have to read that :
02 1D 00 3E FF 01 14 DF 78 11 A5 hello worldworld D8 03 of course D8 03 will be changed
Can you provide a link to the protocol you should use with that reader ?
This post is deleted!
can you send me your email adress from private message because there is no it on website, i have a pdf sorry i am late to reply because i have no reputation
@veysel.olgun Don't ask others for their email address!
You can upload the document to some sharing service (drop box for example) and post the link here.
sorry for that, i will load dropbox
page number 14-17
hello i solved the problem thank you all
What was it ?
it is about send to text data selected block and after take the text data selected block, actually if i show it it will be more understandable. i know it is easy to do but i was forced while converting.
(https://ddgobkiprc33d.cloudfront.net/2ff2c1a2-d1bd-4501-8519-8b81632ac359.png) i know ui is not good for now