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

flomio_cordova_plugin

v1.0.6

Published

Flomio SDK integration enables NFC, BLE, and UHF RFID reader hardware.

Downloads

4

Readme

Flomio Cordova Plugin

Flomio's SDK plugin for Cordova / Meteor

Important: targeting of specific readers via their UID is not supported, but will be in SDK v2.0. In the mean time, please omit any readerUid arguments. This means that all readers will be targeted with any functions you call

Requires Flomio SDK version 1.9

Installation

cordova create flomio-plugin-example-app && cd $_
--
meteor create flomio-plugin-example-app && cd $_
  • Add the plugin to it.
cordova plugin add https://github.com/flomio/flomio_cordova_plugin.git
--
meteor add cordova:com.flomio.sdk@https://github.com/flomio/flomio_cordova_plugin/tarball/<latest-commit-code>
  • Register plugin within config.xml of your app in Cordova. Meteor takes care of this for you (so skip this step).
<feature name="FlomioPlugin">
    <param name="ios-package" value="FlomioPlugin" />
</feature>
  • Implement a simple code snippet to test your setup.
function resultCallback(result)
{
	console.log(result);
}
flomioPlugin.init();
flomioPlugin.selectReaderType("flojack-msr");
flomioPlugin.startReader(resultCallback);  // note: reader UID is omitted so all connected devices will start polling
  • Prepare the app.
cordova prepare
--
meteor add-platform ios
  • Open the generated Xcode project located at platforms/ios or with Meteor, .meteor/local/cordova-build/platforms/ios.

  • Drag and drop the Flomio SDK folder into the project (check "Create groups" and "Add to targets").

  • Add -lc++ to "Other Linker Flags" under "Build Settings".

  • Build and run the app on an iOS device.

API

Required for operation

  • init()

    Initialises the plugin, preparing it for first use in the current session

  • selectReaderType(readerType)

    Activates the specified reader type for the current session. Choice of FloJack-BZR, FloJack-MSR, FloBLE-EMV or FloBLE-Plus

    String readerType: <"flojack-bzr", "flojack-msr", "floble-emv" or "floble-plus">

Optional methods

  • setReaderSettings(readerSettings, [optional]readerUid)

    Configures settings for a target reader for the current session. Every setting in readerSettings is optional

    Object readerSettings
    {
    	int scanPeriod,  // scan period in ms
    	bool scanSound,  // toggle scan sound on/off
    	String operationState: <"read-uid", "read-data-blocks" or "write-data-blocks">,
    	int startBlock,  // the data block from which to start reading
    	String messageToWrite  // default message to write
    }

    String readerUid: the unique ID number of the target reader

  • getReaderSettings(resultCallback, readerUid)

    Retrieves settings for a target reader

    function resultCallback(result)
    Object result
    {
    	int scanPeriod,  // scan period in ms
    	bool scanSound,  // toggle scan sound on/off
    	String operationState: <"read-uid", "read-data-blocks" or "write-data-blocks">,
    	int startBlock,  // the data block from which to start reading
    	String messageToWrite  // default message to write
    }

    String readerUid: unique ID number of the target reader

  • onReaderStatusChange(resultCallback)

    Assign a callback function to fire when the status of any reader changes

    function resultCallback(result)
    Object result
    {
    	String readerUid,  // unique ID number of the reader
    	bool connected,  // whether or not the reader is connected
    	int batteryLevel  // battery level of the reader in %
    }
  • onFlobleConnect(resultCallback)

    Assign a callback function for when a new FloBLE device connects to the mobile device

    function resultCallback(result)
    Object result
    {
    	String readerUid  // unique ID number of the reader
    }
  • startReader(resultCallback, readerUid)

    Start polling for proximity ID tags with a connected FloJack reader

    function resultCallback(result)
    Object result
    {
    	String tagUid,  // unique ID number of the tag
    	String readerUid  // unique ID number of the reader
    }

    String readerUid: unique ID number of the target reader

  • stopReader(readerUid)

    Stop polling on the target reader

    String readerUid: unique ID number of the target reader

  • sendApdu(resultCallback, readerUid, apdu)

    Sends an APDU command to the target reader and receives the response APDU

    function resultCallback(result)
    Object result
    {
    	String responseApdu  // hexidecimal format
    }

    String readerUid: unique ID number of the target reader

    String apdu: command to be sent to the target reader (hexadecimal format)