npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

orca-rfid-reader

v0.0.4

Published

UHF RFID reader expo module for ORCA-50 handheld device

Downloads

507

Readme

Orca RFID Reader

UHF RFID reader module for ORCA-50 handheld device

Installation

To install run:

pnpm add orca-rfid-reader

or

npm install orca-rfid-reader

or

yarn add orca-rfid-reader

Usage

startReader

This makes the connection to UHF RFID reader and starts scanning the background. It starts an observer in the native code and returns a boolean indicating if the connection was successful.

It accepts two arguments:

  1. Serial port, which is the serial port to connect to for the UHF RFID reade. The value should be one of the values returned by listSerialPorts.
  2. Baud rate, which is the baud rate to use for the serial connection. The value should be one of the values returned by listBaudRates.
import { startReader } from "orca-rfid-reader";

const isConnected = await startReader("uhf", "/dev/ttyS4", 115200);

getReaderPower

This returns the current power of the UHF RFID reader. This value is normalized to a range of 0-100.

import { getReaderPower } from "orca-rfid-reader";

const power = getReaderPower();

setReaderPower

This sets the power of the UHF RFID reader. The value should be in the range of 0-100.

import { setReaderPower } from "orca-rfid-reader";

setReaderPower(50);

addRFIDReadListener

This adds a listener to the UHF RFID reader. The listener is called whenever a tag is read.

This won't receive any data until the reader is started.

import { addRFIDReadListener } from "orca-rfid-reader";

addRFIDReadListener(({ rssi, epc }) => {
	console.log(rssi, epc);
});

This returns a function that can be called to remove the listener.

listSerialPorts

This returns a list of available serial ports on the device (the options that can be passed to startReader).

import { listSerialPorts } from "orca-rfid-reader";

const ports = await listSerialPorts();

listBaudRates

This returns a list of available baud rates that can be passed to startReader. The available rates are hardcoded to the following values: [9600, 19200, 38400, 57600, 115200].

import { listBaudRates } from "orca-rfid-reader";

const baudRates = listBaudRates();

enableBeep

This enables the beep sound when a tag is read.

import { enableBeep } from "orca-rfid-reader";

enableBeep();

disableBeep

This disables the beep sound when a tag is read.

import { disableBeep } from "orca-rfid-reader";

disableBeep();

getBeepStatus

This returns the current status of the beep sound when a tag is read.

import { getBeepStatus } from "orca-rfid-reader";

const isBeepEnabled = getBeepStatus();

setMatchEPCs

This sets the EPCs to match against when reading tags. The EPCs should a string composed of EPCs separated by commas.

import { setMatchEPCs } from "orca-rfid-reader";

setMatchEPCs("E28011606000000000000000,E28011606000000000000001");

Based on the value of the matching criteria, the reader will beep when the tag is read.

resetMatchEPCs

This resets the EPCs to match against when reading tags.

import { resetMatchEPCs } from "orca-rfid-reader";

resetMatchEPCs();

We want this because when no EPCs are set, the reader will beep when any tag is read.

stopReader

This disconnects the UHF RFID reader and stops scanning. This should be called when the reader is no longer needed to free up resources and prevent battery drain.

import { stopReader } from "orca-rfid-reader";

stopReader();