Commit ca250ba1 authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Connection: refine some logging messages and levels

parent d5813503
......@@ -57,7 +57,7 @@ sub init {
my $port = Device::SerialPort->new($portname);
if (!defined($port)) {
$logger->warn("Could not open serial port \"$portname\".");
$logger->error("Could not open serial port \"$portname\".");
return undef;
}
......@@ -335,7 +335,6 @@ sub sanitize_config {
}
$msg_type = _parse_return_message($rcv_buf[0], \%err, \%fd);
$logger->debug(sprintf("Received %s message (while waiting for ready before sending).", defined($msg_type) ? $msg_type : "invalid"));
print Dumper(\%err);
if (!defined($msg_type) || $msg_type ne 'READY') {
$logger->error(sprintf("Received message is not a valid READY message (but %s).", defined($msg_type) ? $msg_type : "invalid"));
return {msg_type => $msg_type, fault_detect => \%fd, error => \%err};
......@@ -375,7 +374,7 @@ sub sanitize_config {
if (!defined($msg_type) || $msg_type ne 'CONF_DONE') {
$logger->warn(sprintf("Received message is not a valid CONF_DONE message (but %s).", defined($msg_type) ? $msg_type : "invalid"));
if (($underrun_try_cnt-- > 0) && (!defined($msg_type) || $msg_type eq 'UNDERRUN')) {
$logger->info(sprintf("Retrying to fetch CONF_DONE after reception of UNDERRUN."));
$logger->info(sprintf("Retrying to fetch CONF_DONE."));
$underrun_occurred++;
goto retry_underrun;
}
......@@ -587,7 +586,7 @@ sub _parse_return_message {
}
if ($par != 0) {
$logger->error(sprintf("Return message parity error (msg=0x%02x).", $message_byte));
$logger->warn(sprintf("Return message parity error (msg=0x%02x).", $message_byte));
return undef;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment