Device-WS2500PC

 view release on metacpan or  search on metacpan

lib/Device/WS2500PC.pm  view on Meta::CPAN

}

# Reads a response from the interface
# This routine reads a message from the interface, decodes it and does all integrity checking
# Params: bytes_expected  The number of *message* bytes expected, -1 if not known
#         response        A hash-reference which will be filled with the reponse
# Return: 1               Always true
# The filled in hash reference has the following keys:
# {ok}          1 if the response has been valid and passed all checks, 0 upon failure
# {raw}         Actual data received from the interface
# {message}     The actual message, already decoded without any headers
# {datalength}  The lenght in bytes of the message
# {checksum}    The checksum of the message
sub read_Response ($;$) {
	my $bytes_expected = shift;
	my $response	   = shift;
	
	print "Reading Response ... \n" if $data{'debug'};
	
	# Read data
	# As we do not know how many bytes we expect (due to special char encoding)



( run in 0.771 second using v1.01-cache-2.11-cpan-26ccb49234f )