altera2015 / usbserial

Flutter Android USB Serial plugin
BSD 3-Clause "New" or "Revised" License
128 stars 103 forks source link

Send value as string format. #18

Closed nuarneuer20 closed 5 years ago

nuarneuer20 commented 5 years ago

I need to send value to Ingenico iUC 180B device.

I need to send value as this format. This code from my C# program.

writedata = "\x02" + "C20000000000000100s" + "\x03"; _serialPort.Write(writedata);

Please help

kgamecarter commented 5 years ago

You can encode string by ASCII or UTF8 codec https://api.dartlang.org/stable/1.24.3/dart-convert/ASCII-constant.html

nuarneuer20 commented 5 years ago

Thanks bro. Already solved

pattystars commented 2 years ago

Do you happen to have an example on how this is completed?

If the usb_serial write only accepts Uint8 list format doesn't it change the output every time?

How do you write to a usb without using the Uint8 List requirement?

I am attempting to send "A\r\n" to a serial device that only accepts UTF-8 and ASCII. The Uint8 list converts the write to Uint8's and its not the same on the USB side.

Thanks,