I have been able to write serial port. I need to get integer value from line edit, then send the value through serial port.
Code:
unsigned char c = ui->lineEdit->text().toInt();
How can i send all 255 ascii values through serial port?
Printable View
I have been able to write serial port. I need to get integer value from line edit, then send the value through serial port.
Code:
unsigned char c = ui->lineEdit->text().toInt();
How can i send all 255 ascii values through serial port?
you said also:Quote:
How can i send all 255 ascii values through serial port?
So I don't understand the question.Quote:
I have been able to write serial port.
If you can write to the serial port, where is the problem?
i can send values like 1,2,5, A,},R. They all are single character. Now i need to send decimal 65 or hex 41. Im thinking of sending it as its ASCII 'A'. How do i do it?
Exactly.Quote:
i can send values like 1,2,5, A,},R. They all are single character.
That is ALL you can do.
How these bytes are interpreted, is the job of the receiving end.
You are not sending the bytes "as ASCII" you interpret them as ASCII when you receive the bytes.
The same stream can be interpreted by the receiving end as ASCII binary or hex or what ever else.
Then how am i gonna send value 41. Actually this value gets calculated in sender side. Should i send 'A' then?
Simply by sending a byte with the decimal value of 41.Quote:
Then how am i gonna send value 41
On the receiving side this can be displayed as an 'A', or used to calculate the meaning of life by adding 1 to it and displaying the decimal outcome.