Branch Coverage

blib/lib/Device/WS2500PC.pm
Criterion Covered Total %
branch 0 236 0.0


line true false branch
89 0 0 if $data eq ''
96 0 0 if ($char eq $data{'markers'}{$_} and not $printed)
101 0 0 unless $printed
118 0 0 unless exists $data{'commands'}{$token}
120 0 0 if scalar @_
129 0 0 if $data{'debug'}
153 0 0 if $data{'debug'}
165 0 0 if (length $$response{'raw'} >= 5) { }
172 0 0 if ($char1 eq $data{'markers'}{'ENQ'})
173 0 0 if ($char2 eq $data{'markers'}{'DC2'}) { }
0 0 elsif ($char2 eq $data{'markers'}{'DC3'}) { }
0 0 elsif ($char2 eq $data{'markers'}{'NAK'}) { }
178 0 0 if $data{'debug'}
183 0 0 if (ord $char1 == 255 and ord $char2 == 255)
193 0 0 if ($bytes_expected != -1 and $$response{'datalength'} != $bytes_expected and $$response{'ok'})
195 0 0 if $data{'debug'}
198 0 0 if (substr($$response{'raw'}, 0, 1) ne $data{'markers'}{'STX'} and $$response{'ok'})
200 0 0 if $data{'debug'}
202 0 0 if (substr($$response{'raw'}, length($$response{'raw'}) - 1, 1) ne $data{'markers'}{'ETX'} and $$response{'ok'})
204 0 0 if $data{'debug'}
207 0 0 if ($$response{'message'} eq $data{'markers'}{'NAK'} and $$response{'datalength'} == 1 and $$response{'ok'})
209 0 0 if $data{'debug'}
212 0 0 if ($$response{'ok'})
219 0 0 if (($calc_checksum & 255) != 0)
221 0 0 if $data{'debug'}
226 0 0 if $data{'debug'}
229 0 0 if $data{'debug'}
247 0 0 if $data{'debug'}
248 0 0 unless $port = 'Device::SerialPort'->new($interface)
249 0 0 unless $port->baudrate(19200)
250 0 0 unless $port->parity('even')
252 0 0 unless $port->databits(8)
253 0 0 unless $port->stopbits(2)
257 0 0 if $data{'debug'}
258 0 0 unless $port->dtr_active(0)
259 0 0 unless $port->rts_active(1)
261 0 0 unless $port->dtr_active(1)
262 0 0 unless $port->rts_active(0)
276 0 0 if $response{'ok'} and $response{'message'} eq $data{'markers'}{'ACK'}
279 0 0 $x != 100 ? :
0 0 if $data{'debug'}
280 0 0 if $x == 100
289 0 0 if $data{'debug'}
291 0 0 unless $data{'port'}->close
315 0 0 if scalar @_
319 0 0 if $data{'debug'}
320 0 0 unless init_Interface $port
328 0 0 if ($response{'ok'})
337 0 0 if $dcf_handling and not $dcfok
342 0 0 if $response{'ok'}
347 0 0 unless $response{'ok'}
377 0 0 if $data{'debug'}
378 0 0 unless init_Interface $port
386 0 0 if ($response{'ok'})
392 0 0 if ($status < 16) { }
0 0 elsif ($status == 16) { }
397 0 0 if $sensor =~ /^temp(\d+)$/
402 0 0 ord substr($response{'message'}, 13, 1) & 1 ? :
403 0 0 ord substr($response{'message'}, 13, 1) & 2 ? :
404 0 0 ord substr($response{'message'}, 13, 1) & 4 ? :
405 0 0 ord substr($response{'message'}, 13, 1) & 8 ? :
406 0 0 ord substr($response{'message'}, 13, 1) & 16 ? :
417 0 0 if $response{'ok'}
422 0 0 unless $$result{'valid'}
440 0 0 if scalar @_
442 0 0 if ($special eq '')
443 0 0 unless init_Interface $port
450 0 0 if ($response{'ok'})
455 0 0 if $special eq ''
457 0 0 unless $valid
458 0 0 unless $response{'ok'}
459 0 0 if $response{'message'} eq $data{'markers'}{'ACK'}
460 0 0 if $response{'message'} eq $data{'markers'}{'DLE'}
476 0 0 unless init_Interface $port
480 0 0 if ($response{'ok'} and $response{'message'} eq $data{'markers'}{'ACK'})
487 0 0 if $valid
542 0 0 if scalar @_
544 0 0 if $data{'debug'}
546 0 0 if ($doinit eq '' or $doinit eq 'noclose')
549 0 0 if $$result{'interface'}{'timestamp'} <= 0
552 0 0 unless ws2500_GetStatus $port, $result
555 0 0 unless init_Interface $port
564 0 0 if ($response{'ok'})
565 0 0 if (not $response{'message'} eq $data{'markers'}{'DLE'}) { }
577 0 0 if ($$result{'sensors'}{$sensor}{'status'} ne 'n/a') { }
580 0 0 if ($nibble % 2) { }
587 0 0 if $temp{'2'} & 8
598 0 0 if ($temp{'3'} <= 9) { }
614 0 0 if ($$result{'sensors'}{'wind'}{'status'} ne 'n/a') { }
620 0 0 if ord $data[$of + 23] & 16
622 0 0 if $accuracy == 0
623 0 0 if $accuracy == 1
624 0 0 if $accuracy == 2
625 0 0 if $accuracy == 3
633 0 0 if ($$result{'sensors'}{'inside'}{'status'} ne 'n/a') { }
638 0 0 if ord $data[$of + 26] & 128
643 0 0 if ((ord $data[$of + 27] & 15) <= 9) { }
657 0 0 if ($$result{'sensors'}{'rain'}{'status'} ne 'n/a') { }
667 0 0 if ($$result{'sensors'}{'light'}{'status'} ne 'n/a') { }
690 0 0 if $$result{'valid'}
692 0 0 if $doinit eq ''
695 0 0 if ($type eq 'next' and $$result{'valid'} and $$result{'dataset'}{'status'} eq 'dataset')
696 0 0 if ($doinit eq '') { }
704 0 0 unless $$result{'valid'}
731 0 0 if ($x == 0) { }
737 0 0 if ($res and $firstdataset{'valid'} and $firstdataset{'dataset'}{'status'} eq 'dataset') { }
748 0 0 if ($res and $result{'valid'} and $result{'dataset'}{'status'} eq 'dataset') { }
826 0 0 unless exists $$data{$token}
827 0 0 unless $$data{$token} =~ /^\d+$/
830 0 0 if $$data{'first'} < 0 or $$data{'first'} > 63
831 0 0 if $$data{'interval'} < 2 or $$data{'interval'} > 63
833 0 0 if $$data{$token} < 0 or $$data{$token} > 7
835 0 0 if $$data{'version'} < 1 or $$data{'version'} > 2
839 0 0 if $$data{'version'} == 1
845 0 0 unless init_Interface $port
849 0 0 if ($response{'ok'} and $response{'message'} eq $data{'markers'}{'ACK'})
856 0 0 if $valid
867 0 0 if $debug > 1 or $debug < 0