Biblio...Reader(3pm)

✨ Biblio::RFID::Reader β€” the perl manual page but make it cute ✨

okay so bestie, welcome to Biblio...Reader πŸ’– this lil page lives in the User Contributed Perl Documentation section of the perl man pages, and it's your backstage pass to the whole Biblio::RFID::Reader situation. grab a strawberry πŸ“ and let's go.


πŸŽ€ NAME πŸŽ€

Biblio::RFID::Reader β€” literally the simplest way to write RFID applications in perl. no cap. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: this module probes all available readers for you β€” like it goes around asking everyone "hey are you there, are you real" β€” and then it uses calls from Biblio::RFID::Reader::API to invoke whichever reader is the correct one. so you don't have to play matchmaker yourself. it just knows. πŸ‘‘


πŸ’– FUNCTIONS πŸ’–

new

my $rfid = Biblio::RFID::Reader->new( 'optional reader filter' );

you're making a new object, periodt. you can hand it an optional reader filter if you're feeling picky about which reader you wanna vibe with. ✨

tags

my @visible = $rfid->tags(
              enter => sub { my $tag = shift; },
              leave => sub { my $tag = shift; },
              reader => sub { my $reader = shift; ref($reader) =~ m/something/ },
);

this one gives you back all the visible tags in a list β€” @visible, iconic. and you can pass it callbacks: an enter sub for when a tag shows up, a leave sub for when a tag dips out, and a reader sub where you get the reader handed to you and you can do your own regex match on ref($reader) to filter. main character filtering energy. 🫢

blocks

my $blocks_arrayref = $rfid->blocks( $tag );

hand it a $tag, get back a $blocks_arrayref. it's giving "here are the blocks, bestie." 🌸

afi

my $afi = $rfid->afi( $tag );

give it a $tag, it gives you the $afi. short, sweet, slays. ⭐

to_hash

$self->to_hash( $tag );

turns your $tag situation into a hash. that's the whole thing. πŸ’œ

debug

$self->debug(1); # or more

crank up the debug level! 1 is a lil bit of debug, or go higher for # or more because sometimes you just need the whole group chat to know what's happening. πŸ›βœ¨

from_reader

my $reader = $self->from_reader( $tag );

you hand over a $tag and it hands you back the $reader. reciprocal queen behavior. πŸ‘‘


πŸ™ˆ PRIVATE πŸ™ˆ

these are the behind-the-scenes ones β€” iykyk, don't @ them from your app code unless you know what you're doing, bestie.

_invalidate_tag

$rfid->_invalidate_tag( $tag );

yep. it invalidates the tag. that's it, that's the tweet. πŸ’€

_available

Probe each RFID reader supported and returns succefull ones

my $rfid_readers = Biblio::RFID::Reader->_available( $regex_filter );

it goes through every RFID reader it supports, probes them all, and hands back the ones that came through β€” the succefull ones. you can pass a $regex_filter too. ✨


🌈 AUTOLOAD 🌈

On any other function calls, we just marshall to all readers

translation: if you call literally any other function that isn't listed above, it just marshalls that call out to all the readers. chaotic? maybe. convenient? absolutely. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

RFID reader implementations

these are the actual reader implementations doing the heavy lifting, go show them some love:

  • Biblio::RFID::Reader::3M810
  • Biblio::RFID::Reader::CPRM02
  • Biblio::RFID::Reader::librfid

and that's the page, bestie!! πŸŽ€πŸ’– this was brought to you by perl v5.36.0, dated 2023-05-24, from the User Contributed Perl Documentation corner of the universe. stay slay, stay probed, and may all your readers be available. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from