You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I use this plug-in to open the serial port com1, the message information displayed on the serial tool is incorrect. I sent aa06000000000000000000ff, but the serial tool shows 00 80 80 80 00 00 00 00 00 00 00.
Then I used the serial port tool to open com1, then closed it, and then used the plug-in to open com1, and the sent message was displayed on the serial port tool, and whatever I sent was displayed. What is the reason.
void sendData(String sendData) async {
List dataList = [];
int len = sendData.length ~/ 2;
for (int i = 0; i < len; i++) {
String data = sendData.trim().substring(2 * i, 2 * (i + 1));
int? d = _hexToInt2(data);
dataList.add(d!);
}
var bytes = Uint8List.fromList(dataList);
_serialPort!.write(bytes);
}
The text was updated successfully, but these errors were encountered:
After I use this plug-in to open the serial port com1, the message information displayed on the serial tool is incorrect. I sent aa06000000000000000000ff, but the serial tool shows 00 80 80 80 00 00 00 00 00 00 00.
Then I used the serial port tool to open com1, then closed it, and then used the plug-in to open com1, and the sent message was displayed on the serial port tool, and whatever I sent was displayed. What is the reason.
code show as below:
void open(String portName, int baudRate) async {
_serialPort = SerialPort(portName);
var config = SerialPortConfig();
config.baudRate = 9600;
config.parity = 0;
config.bits = 8;
// config.cts = 0;
// config.rts = 0;
config.stopBits = 1;
config.xonXoff = 0;
_serialPort!.config = config;
_readData();
}
void sendData(String sendData) async {
List dataList = [];
int len = sendData.length ~/ 2;
for (int i = 0; i < len; i++) {
String data = sendData.trim().substring(2 * i, 2 * (i + 1));
int? d = _hexToInt2(data);
dataList.add(d!);
}
var bytes = Uint8List.fromList(dataList);
_serialPort!.write(bytes);
}
The text was updated successfully, but these errors were encountered: