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?
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.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.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
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.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.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks