Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use serialport->write(myCharArray,offset,count) to send my data.

I convert::tochar 0x3E and 0x02 to a unsign char array and send them,and i use serialPort->read(myAnotherCharArray,offset,count)to read back the feedback but fail,it always contain 0.

I can use hyper terminal to communicate with my device.In hyper terminal,i send '>' and ' '(i cant show this in ,anyway i hold alt and key in 02 and release the alt key).What is the format of this 2 data i send?

Is it wrong to use convert::tochar to convert my hex to a char??

Anyone please teach me how to send the same data as in hyper terminal(the setting in hyper terminal is default) by using serial port.
Posted

1 solution

The value x02 is a byte value, although it has no visual representation in the ASCII character set (if memory serves it is the STX character). If you wish to send this byte to your remote device then just send it, do not try and convert it to something else.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900