Skip to content

geo242/cordova-plugin-powapos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova PowaPOS Plugin

Plugin to connect and interact with PowaPOS devices

Supported PowaPOS Devices

  • T-Series

##Example application

Coming soon

Installation

From master (latest)

cordova plugin add https://github.com/geo242/cordova-plugin-powapos

Stable (npm)

cordova plugin add cordova-plugin-powapos

Removing the Plugin from project

Using cordova CLI

cordova plugin rm cordova-plugin-powapos

Supported Platforms

  • iOS >=7.0
  • Android - coming soon

Using the plugin

Cordova initializes the plugin as window.plugins.powaPOS object.

Methods

  • 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.

Events

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); })
Event Data Types
  • 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

Plugin initialization

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);

Platform specifics

##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

About

Cordova plugin to connect to PowaPOS devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published