Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
com-darryncampbell-enterprisebarcode
Advanced tools
Readme
This plugin defines an enterpriseBarcode
object which provides an API for interacting with the hardware scanner on Zebra devices. The enterpriseBarcode object is not available until after the deviceready
event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(enterpriseBarcode);
}
cordova plugin add https://github.com/darryncampbell/EnterpriseBarcodePoC.git
Requires Cordova 5.0 or higher otherwise your application will get build errors. When updating from a previous Cordova version it is necessary to re-add this plugin
Returns the available hardware scanners on the device
enterpriseBarcode.enumerate(enumerateSuccess, enumerateFailure);
The enterpriseBarcode.enumerate
function queries the device hardware for available scanners and returns them through the success callback
Barcode functionality is only available for Zebra mobile devices.
Output the available scanners to the console
enterpriseBarcode.enumerate(
function(scannersObj)
{
for(scanner in scannersObj.scanners)
{
console.log("Scanner: " + scanner.friendlyName);
}
},
function(status)
{
console.log("Failed to Enumerate Scanners: " + status.message);
}
);
The Scanners are also available through the enterpriseBarcode.scanners
property after the device ready event.
for(scanner in enterpriseBarcode.scanners)
{
console.log("Scanner: " + scanner.friendlyName);
}
Optional parameters to customize the Scanner settings can be provided either through the setProperties
method or through the enable
method. These settings will persist until the application is closed.
{ code11Enabled : true,
code128Enabled : true,
code39Enabled : false,
code93Enabled : false,
dataMatrixEnabled : false,
ean8Enabled : true,
ean13Enabled : true,
upcaEnabled : true,
upce1Enabled : false,
pdf417Enabled : true,
friendlyName : '2D Barcode Imager'};
Not all barcode scanners will support all symbologies, for instance 2D symbologies like PDF417 will not be supported on 1D laser scanners.
Enables the barcode scanner hardware and the associated trigger, so pressing the hardware trigger will initiate a scan.
enterpriseBarcode.enable(enableSuccess, enableFailure, barcodeOptions);
The Enable method will instruct the scanning hardware to initialise and attach the trigger that can subsequently be used to initiate a scan. The success callback is called firstly to indicate that the scanner has successfully enabled and subsequently on each barcode scan (see example)
enterpriseBarcode.enable(
function(scannedObj)
{
if (scannedObj.status == "enabled")
console.log("Scanner has successfully enabled");
else
{
console.log("Scan Data: " + scannedObj.data);
console.log("Scan Symbology: " + scannedObj.type);
console.log("Scan Time: " + scannedObj.timestamp);
}
},
function(status)
{
console.log("Enable Failure: " + status.message);
},
{
'friendlyName':'2D Barcode Imager'
}
);
Disables the currently enabled barcode scanner hardware and disconnects the associated trigger.
enterpriseBarcode.disable(disableSuccess, disableFailure);
The Disable method will instruct the currently enabled scanning hardware to deinitialise. Calling disable
without having previously enabled a scanner will have no effect.
enterpriseBarcode.disable(
function(status)
{
console.log("Disable Success: " + status.message);
},
function(status)
{
console.log("Disable Failure: " + status.message);
}
);
Sets any of the properties listed under barcodeOptions to the currently enabled scanner. If there is no currently enabled scanner then this method has no effect.
enterpriseBarcode.setProperties(
function(status)
{
console.log("Set Properties Success: " + status.message);
},
function(status)
{
console.log("Set Properties Failure: " + status.message);
},
{
'code11Enabled':true,
'code39Enabled':false
}
);
Retrieves the properties listed under barcodeOptions from the currently enabled scanner. If there is no currently enabled scanner then this method has no effect.
enterpriseBarcode.getProperties(
function(props)
{
document.getElementById("code11Check").checked = props.code11Enabled;
document.getElementById("code39Check").checked = props.code39Enabled;
},
function(data)
{
console.log("Get Properties Failure: " + status.message);
}
);
FAQs
Proof of Concept Cordova Wrapper for Symbol Mobile Devices which use EMDK
The npm package com-darryncampbell-enterprisebarcode receives a total of 6 weekly downloads. As such, com-darryncampbell-enterprisebarcode popularity was classified as not popular.
We found that com-darryncampbell-enterprisebarcode demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.