cordova-plugin-dkcloudid-uart-nfc
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "cordova-plugin-dkcloudid-uart-nfc", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Plugin for handling NFC UART communication in Android using DKCloudID SDK", | ||
@@ -5,0 +5,0 @@ "main": "www/UARTPlugin.js", |
var exec = require('cordova/exec'); | ||
// Exportar el plugin como un objeto global para acceder desde JavaScript | ||
module.exports = { | ||
var UARTPlugin = { | ||
/** | ||
* Inicializa el dispositivo NFC. | ||
* @param {Function} successCallback - Callback para éxito. | ||
* @param {Function} errorCallback - Callback para error. | ||
*/ | ||
initialize: function(successCallback, errorCallback) { | ||
exec(successCallback, errorCallback, 'UARTPlugin', 'initialize', []); | ||
}, | ||
/** | ||
* Abre el puerto UART para la comunicación. | ||
* @param {Function} successCallback - Callback para éxito. | ||
* @param {Function} errorCallback - Callback para error. | ||
*/ | ||
openPort: function(successCallback, errorCallback) { | ||
exec(successCallback, errorCallback, 'UARTPlugin', 'openPort', []); | ||
}, | ||
readFromPort: function(successCallback, errorCallback) { | ||
exec(successCallback, errorCallback, 'UARTPlugin', 'readFromPort', []); | ||
}, | ||
writeToPort: function(data, successCallback, errorCallback) { | ||
exec(successCallback, errorCallback, 'UARTPlugin', 'writeToPort', [data]); | ||
/** | ||
* Escucha eventos de NFC. | ||
* @param {Function} successCallback - Callback cuando se detecta una tarjeta. | ||
* @param {Function} errorCallback - Callback para errores. | ||
*/ | ||
listenNFC: function(successCallback, errorCallback) { | ||
exec(successCallback, errorCallback, 'UARTPlugin', 'listenNFC', []); | ||
} | ||
}; | ||
module.exports = UARTPlugin; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
103259
83