From: Dobrica Pavlinusic Date: Mon, 26 Jul 2010 21:47:09 +0000 (+0200) Subject: document public methods X-Git-Tag: RFID-Biblio-0.02~155 X-Git-Url: http://git.rot13.org/?p=Biblio-RFID.git;a=commitdiff_plain;h=8287b8b842ad3209d491179e861cb1a1f66d4b1b document public methods --- diff --git a/lib/RFID/Serial.pm b/lib/RFID/Serial.pm index 9c32a6d..d23642c 100644 --- a/lib/RFID/Serial.pm +++ b/lib/RFID/Serial.pm @@ -51,6 +51,12 @@ sub new { return $self; } +=head2 port + + my $serial_obj = $self->port; + +=cut + sub port { my $self = shift; @@ -68,9 +74,29 @@ sub port { } -sub init { - warn "no init"; -} +=head1 MANDATORY IMPLEMENTATIONS + +Each reader must implement following hooks as sub-classes. + +=head2 init + + $self->init; + +=head2 inventory + + my @tags = $self->invetory; + +=head2 read_blocks + + my $hash = $self->read_blocks $tag; + +All blocks are under key which is tag UID + + $hash = { 'E000000123456789' => [ undef, 'block1', 'block2', ... ] }; + +L sends tag UID with data payload, so we might expect +to receive response from other tags from protocol specification, + =head1 EXPORT @@ -113,7 +139,7 @@ sub as_hex { =head2 hex_tag - print hex_tag $bytes; + print hex_tag $8bytes; =cut