Subject: | Signal strength reading fails on Vodafone data card |
(This is actually for version 1.44, but I couldn't select a higher
number than 1.43 for some reason)
When reading the signal strength from a Vodafone data card on a virtual
com port, the module fails to extract the number. This is caused by the
return value being incorrectly parsed; the function only reads the first
line of the the output, which in my case consists of a '['.
A quick fix to this problem is to change line 265 in Gsm.pm from
($code, $dBm) = $self->parse_answer($Device::Modem::STD_RESPONSE, 15000);
to
$dBm = $self->parse_answer($Device::Modem::STD_RESPONSE, 15000);
This is because the parse_error function actually returns the rest of
the response as a list when multiple return values are requested.
Another fix could be to store the return value in an array and parse this;
($code, @dBm) = ...
and join that array.
As it is, $code isn't used in the function, so my fix works well...but
isn't pretty.