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

cordova-plugin-mufucaca

v0.0.5

Published

Near Field Communication (NFC) Plugin for Multifunction-Campus-Cards from Karlsruhes Universities.

Downloads

4

Readme

cordova-plugin-mufucaca

This plugin allows to read the Multifuntional Campus Card from Karlsruhes students from KIT, DH, HsKa and PH. It is derived from phonegap-nfc because the card is a Mifare 1K-Tag, which is not supported by phonegap-nfc.

Supported Platforms

  • Android

Contents

Installing

Cordova

To install via NPM, use:

$ cordova plugin add cordova-plugin-mufucaca

To install from this repo, use:

$cordova plugin add https://github.com/0xC0DEBA5E/cordova-plugin-mufucaca

TypeScript

If you plan to use TypeScript, there is a TypeScript-wrapper for this project at: mufucaca-typescript.

MufuCaCa

The MufuCaCa object provides access to the functions of the plugin.

Methods

MufuCaCa.addTagDiscoveredListener

Registers an event listener for tags matching any tag type.

MufuCaCa.addTagDiscoveredListener(callback, [onSuccess], [onFailure]);

Parameters

  • callback: The callback that is called when a tag is detected.
  • onSuccess: (Optional) The callback that is called when the listener is added.
  • onFailure: (Optional) The callback that is called if there was an error.

Description

Function MufuCaCa.addTagDiscoveredListener registers the callback for tag events.

This event occurs when any tag is detected by the phone.

MufuCaCa.removeTagDiscoveredListener

Removes the previously registered event listener added via MufuCaCa.addTagDiscoveredListener.

MufuCaCa.removeTagDiscoveredListener(callback, [onSuccess], [onFailure]);

Parameters

  • callback: The previously registered callback.
  • onSuccess: (Optional) The callback that is called when the listener is successfully removed.
  • onFailure: (Optional) The callback that is called if there was an error during removal.

MufuCaCa.addReadResultListener

Registers an event listener for read results of the campus card.

MufuCaCa.addTagDiscoveredListener(callback, [onSuccess], [onFailure]);

Parameters

  • callback: The callback that is called when a new read result is available.
  • onSuccess: (Optional) The callback that is called when the listener is added.
  • onFailure: (Optional) The callback that is called if there was an error.

Description

Function MufuCaCa.addReadResultListener registers the callback for read result events.

This event occurs when a new read result from the campus card is available.

MufuCaCa.removeReadResultListener

Removes the previously registered event listener added via MufuCaCa.addTagDiscoveredListener.

MufuCaCa.removeReadResultListener(callback, [onSuccess], [onFailure]);

Parameters

  • callback: The previously registered callback.
  • onSuccess: (Optional) The callback that is called when the listener is successfully removed.
  • onFailure: (Optional) The callback that is called if there was an error during removal.

MufuCaCa.addAdapterStateListener

Registers an event listener for adapter state changes.

MufuCaCa.addAdapterStateListener(callback, [onSuccess], [onFailure]);

Parameters

  • callback: The callback that is called when a adapter state change is detected.
  • onSuccess: (Optional) The callback that is called when the listener is added.
  • onFailure: (Optional) The callback that is called if there was an error.

Description

Function MufuCaCa.addAdapterStateListener registers the callback for adapter state change events.

This event occurs when the user enables or disables nfc in the device-settings.

MufuCaCa.removeAdapterStateListener

Removes the previously registered event listener added via MufuCaCa.addAdapterStateListener.

MufuCaCa.removeAdapterStateListener(callback, [onSuccess], [onFailure]);

Parameters

  • callback: The previously registered callback.
  • onSuccess: (Optional) The callback that is called when the listener is successfully removed.
  • onFailure: (Optional) The callback that is called if there was an error during removal.

MufuCaCa.enabled

Check if NFC is available and enabled on this device.

MufuCaCa.enabled(onSuccess, onFailure);

Parameters

  • onSuccess: The callback that is called when NFC is enabled.
  • onFailure: The callback that is called when NFC is disabled or missing.

Description

Function MufuCaCa.enabled explicitly checks to see if the phone has NFC and if NFC is enabled. If everything is OK, the success callback is called. If there is a problem, the failure callback will be called with a reason code.

The reason will be NO_NFC if the device doesn't support NFC and NFC_DISABLED if the user has disabled NFC.

Note: that on Android the NFC status is checked before every API call NO_NFC or NFC_DISABLED can be returned in any failure function.

Credits

This project combines code from other projects. Special thanks go to phonegap-nfc (MIT-License) and kitcard-reader (GNU-GPL v2 License).

License

This software is dual-licensed under the GNU GPL v2 and MIT License. See LICENSE.txt for details.