Files
2025-06-24 17:39:33 +08:00

41 lines
927 B
JavaScript

var exec = require('cordova/exec');
var uhf = function Uhf() {};
uhf.open = function({success, error}) {
exec(success, error, 'UHF', 'open', []);
};
uhf.close = function({success, error}) {
exec(success, error, 'UHF', 'close', []);
};
uhf.getPower = function({success, error}) {
exec(success, error, 'UHF', 'getPower', []);
};
uhf.setPower = function({power, success, error}) {
exec(success, error, 'UHF', 'setPower', [power]);
};
uhf.inventory = function({success, error, sound}) {
if(sound == undefined) {
sound = true;
}
exec(success, error, 'UHF', 'inventory', [sound]);
};
uhf.stopInventory = function({success, error}) {
exec(success, error, 'UHF', 'stopInventory', []);
};
uhf.inventoryOnce = function({success, error, sound}) {
if(sound == undefined) {
sound = true;
}
exec(success, error, 'UHF', 'inventoryOnce', [sound]);
};
module.exports = uhf;