异常判定在出错时才打印,检测时通信异常蜂鸣器响一声

取消一些通信日志打印
This commit is contained in:
ranchuan
2024-01-06 09:59:58 +08:00
parent 307eb513ef
commit b76c04d072
11 changed files with 29 additions and 16 deletions

View File

@@ -182,7 +182,7 @@ void can_host::recv_data_cb()
// 不分段
slave.clear();
slave.append(payload);
qDebug()<<"can recv from:"<<slave_addr<<slave.get_data().toHex(' ');
// qDebug()<<"can recv from:"<<slave_addr<<slave.get_data().toHex(' ');
if (dst_addr == 0){
if (irq_fun){
irq_fun(myarray(slave.get_data()));
@@ -206,7 +206,7 @@ void can_host::recv_data_cb()
// 尾段
slave.append(payload);
if (slave.get_pack_num() - 1 == seg_num){
qDebug()<<"can recv from:"<<slave_addr<<slave.get_data().toHex(' ');
// qDebug()<<"can recv from:"<<slave_addr<<slave.get_data().toHex(' ');
if (dst_addr == 0){
if (irq_fun){
irq_fun(myarray(slave.get_data()));
@@ -229,7 +229,7 @@ void can_host::recv_data_cb()
int can_host::write(int dst,myarray data)
{
qDebug()<<"can send to:"<<dst<<data.toHex(' ');
// qDebug()<<"can send to:"<<dst<<data.toHex(' ');
append(dst, 1, data);
// qDebug("can send end.");
return data.size();

View File

@@ -35,7 +35,7 @@ int if_uart::write(myarray data)
// qWarning() << "Cant send data , TcpClient socket not connect.";
return 0;
}
qDebug("uart send:%s", data.toHex(' ').data());
// qDebug("uart send:%s", data.toHex(' ').data());
int wb = serial_->write(data);
if ((!serial_->flush()) || (wb != data.size()))