Skip to content

geo242/StarIOPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StarIOPlugin

Phonegap plugin for Star Micronics bluetooth printer works with Android and iOS :

How to use :

cordova plugin add https://github.com/InteractiveObject/StarIOPlugin.git

API

Printer discovery

window.plugins.starPrinter.portDiscovery(function(error, printerList){
  if (error) {
    console.error(error);
  } else {
    console.log(printerList[0].name);
    console.log(printerList[0].macAddress);
  }
});

Printer status

window.plugins.starPrinter.checkStatus(name, function(error, result){
  if (error) {
    console.error(error);
  } else {
    console.log(result.offline ? "printer is offline : "printer is online);
  }
});

Print receipt

var myReceipt = "Title \n\n -- Price\r\r\r 20$\n\n ---\n";
window.plugins.starPrinter.printReceipt(name, myReceipt, function(error, result){
  if (error) {
    console.error(error);
  } else {
    console.log("printReceipt finished");
  }
  
});

Demo application : https://github.com/InteractiveObject/StarIOPluginDemo

About

StarIO printer phonegap plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published