Plugin to connect and interact with PowaPOS devices
- T-Series
##Example application
Coming soon
From master (latest)
cordova plugin add https://github.com/geo242/cordova-plugin-powapos
Stable (npm)
cordova plugin add cordova-plugin-powapos
Using cordova CLI
cordova plugin rm cordova-plugin-powapos
- iOS >=7.0
- Android - coming soon
Cordova initializes the plugin as window.plugins.powaPOS
object.
window.plugins.powaPOS.connect(onSuccess, onError)
window.plugins.powaPOS.scannerBeep(beepType, onSuccess, onError)
window.plugins.powaPOS.scannerAutoScanOnOff(autoScan, onSuccess, onError)
window.plugins.powaPOS.openCashDrawer(onSuccess, onError)
window.plugins.powaPOS.printReceipt(receiptContent, onSuccess, onError)
All methods returning promises, but you can also use standard callback functions.
For listening for any events generated by the device, you can either:
- Override the handleDataReceived method
window.plugins.powaPOS.handleDataReceived(data)
- Listen for window event
window.addEventListener('PowaPOS', function (event) { console.log(event.dataType); console.log(event.data); })
- PowaTSeries_deviceConnectedAtPort
- PowaTSeries_deviceDisconnectedAtPort
- PowaTSeries_connectionStateChanged
- PowaTSeries_bootcodeUpdateProgress
- PowaTSeries_ftdiDeviceReceivedData
- PowaTSeries_hidDeviceConnectedAtPort
- PowaTSeries_hidDeviceDisconnectedAtPort
- PowaTSeries_hidDeviceReceivedData
- PowaTSeries_receivedData
- PowaTSeries_updateProgress
- PowaTSeries_tseriesCashDrawerAttached
- PowaTSeries_tseriesCashDrawerDetached
- PowaTSeries_tseriesDidFinishInitializing
- PowaTSeries_tseriesDidFinishUpdating
- PowaTSeries_tseriesDidFinishUpdatingBootcode
- PowaTSeries_tseriesDidStartUpdating
- PowaTSeries_tseriesFailedUpdatingBootcode
- PowaTSeries_tseriesOutOfPaper
- PowaTSeries_tseriesPrinterResult
- PowaS10Scanner_connectionStateChanged
- PowaS10Scanner_scannedBarcode
- PowaS10Scanner_scannedBarcodeData
- PowaScanner_scannerDidFinishInitializing
- rotationSensor
The plugin is not available until deviceready
event is fired.
document.addEventListener('deviceready', function () {
// window.plugins.powaPOS is now available
window.plugins.powaPOS.connect();
}, false);
##iOS
Plugin is written in Swift. All XCode project options to enable swift support are set up automatically after plugin is installed.
##License
This software is released under the Apache 2.0 License.
© 2015 iVerticle - All rights reserved