1.0.7 • Published 6 months ago

cordova-plugin-neptune-zebra-rfid v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Cordova Plugin for Zebra RFID Scanning

Overview The Cordova Plugin for Zebra RFID Scanning allows Cordova applications to interface with Zebra MC3300x devices for RFID scanning using Zebra's DataWedge API. This plugin enables developers to easily start and stop scans and handle RFID data within their apps.

Features Start and stop RFID scans programmatically. Receive scanned RFID data in real time. Built for Zebra MC3300x devices with DataWedge configured. Requirements Cordova CLI: Version 10.0.0 or higher. Android SDK: Version 21 or higher. Zebra Device: MC3300x or compatible Zebra RFID reader. DataWedge: Configured on the device. Installation Install the plugin using the following command:

bash Copy code cordova plugin add cordova-plugin-zebra-rfid Or install directly from NPM:

bash Copy code npm install cordova-plugin-zebra-rfid Usage Initialize the Plugin Initialize the plugin and set up a listener for scanned data:

javascript Copy code document.addEventListener('deviceready', function () { ZebraRFID.initialize( function (data) { console.log('Scanned RFID data:', data); }, function (error) { console.error('Error initializing RFID:', error); } ); }); Start Scanning Trigger RFID scanning:

javascript Copy code ZebraRFID.startScan( function () { console.log('RFID scanning started.'); }, function (error) { console.error('Error starting RFID scan:', error); } ); Stop Scanning Stop RFID scanning:

javascript Copy code ZebraRFID.stopScan( function () { console.log('RFID scanning stopped.'); }, function (error) { console.error('Error stopping RFID scan:', error); } ); Full Example javascript Copy code document.addEventListener('deviceready', function () { console.log('Device is ready.');

ZebraRFID.initialize(
    function (data) {
        console.log('Scanned RFID data:', data);
    },
    function (error) {
        console.error('Error initializing RFID:', error);
    }
);

document.getElementById('startScan').addEventListener('click', function () {
    ZebraRFID.startScan(
        function () {
            console.log('RFID scanning started.');
        },
        function (error) {
            console.error('Error starting scan:', error);
        }
    );
});

document.getElementById('stopScan').addEventListener('click', function () {
    ZebraRFID.stopScan(
        function () {
            console.log('RFID scanning stopped.');
        },
        function (error) {
            console.error('Error stopping scan:', error);
        }
    );
});

}); Configuring Zebra DataWedge Ensure your Zebra MC3300x is configured correctly:

Open DataWedge on the device. Create a new profile for your app. Configure the following settings: Intent Output: Enable and set the action to com.symbol.datawedge.api.RESULT_ACTION. Intent Delivery: Set to Broadcast Intent. For more details, consult the Zebra DataWedge documentation.

API ZebraRFID.initialize(success, error) Initializes the plugin and sets up the scan receiver.

success: Callback function invoked when a scan result is received. error: Callback function invoked if there’s an initialization error. ZebraRFID.startScan(success, error) Starts the RFID scanning process.

success: Callback function invoked when the scan starts successfully. error: Callback function invoked if there’s an error starting the scan. ZebraRFID.stopScan(success, error) Stops the RFID scanning process.

success: Callback function invoked when the scan stops successfully. error: Callback function invoked if there’s an error stopping the scan. Troubleshooting Ensure DataWedge is correctly configured with the right Intent action and delivery method. Verify that the Zebra MC3300x is compatible and has the latest firmware. License This plugin is licensed under the MIT License. See the LICENSE file for details.

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago