| Package | com.myflashlab.air.extensions.rongta |
| Class | public class Rongta |
| Inheritance | Rongta Object |
Rongta.init();
| Property | Defined By | ||
|---|---|---|---|
| connectedDevices : Vector.<PrinterInterface> [static] [read-only]
(iOS) returns an array of connected printers in PrinterInterface objects. | Rongta | ||
| listener : EventDispatcher [static] [read-only]
Use this listener to attach RongtaEvents.DEVICE_CONNECTION_STATE
| Rongta | ||
| Method | Defined By | ||
|---|---|---|---|
connect($printer:PrinterDevice = null):Boolean [static]
Connects the app to the printer. | Rongta | ||
[static]
Create command object. | Rongta | ||
disconnect():void [static]
Disconnect the app from the printer. | Rongta | ||
init():void [static]
Call this to init the printer SDK as the first thing you should do when working with this ANE. | Rongta | ||
showChooseDialog($callback:Function):void [static]
(Android) opens a native window allowing user to scan and find bluetooth printers. | Rongta | ||
showConnectedDevices($callback:Function):void [static]
(Android) opens a native window containing a list of connected printers which you can switch to. | Rongta | ||
startScan($callback:Function):void [static]
(iOS) start scanning for finding a bluetooth printer. | Rongta | ||
stopScan():void [static]
(iOS) stop the scanning process. | Rongta | ||
switchPrinter($printerInterface:PrinterInterface):void [static]
(iOS) switch between connected devices. | Rongta | ||
writeMsg($bytes:String):void [static]
Send Base64 String bytes to the printer. | Rongta | ||
| Constant | Defined By | ||
|---|---|---|---|
| ANDROID_SDK_V : String = 2.0.23 [static] | Rongta | ||
| CMD_ESC : int = 1 [static] | Rongta | ||
| CON_BLUETOOTH : int = 1 [static] | Rongta | ||
| EXTENSION_ID : String = com.myflashlab.air.extensions.rongta [static] | Rongta | ||
| IOS_SDK_V : String = 4.10.17 [static] | Rongta | ||
| VERSION : String = 0.0.1 [static] | Rongta | ||
| connectedDevices | property |
connectedDevices:Vector.<PrinterInterface> [read-only]
(iOS) returns an array of connected printers in PrinterInterface objects. You can pass an instance
of PrinterInterface to switchPrinter.
public static function get connectedDevices():Vector.<PrinterInterface>| listener | property |
listener:EventDispatcher [read-only]
Use this listener to attach RongtaEvents.DEVICE_CONNECTION_STATE
public static function get listener():EventDispatcher| connect | () | method |
public static function connect($printer:PrinterDevice = null):BooleanConnects the app to the printer.
(iOS) You must pass the PrinterDevice object returned from the startScan method so the
ANE knows which printer to connect to.
(Android) You must call this method after user has selected the printer from method showChooseDialog
or showConnectedDevices
Parameters
$printer:PrinterDevice (default = null) |
Boolean — returns true if the connect operation is starting. if no device is selected, this will return false
|
| createCmd | () | method |
| disconnect | () | method |
public static function disconnect():voidDisconnect the app from the printer.
| init | () | method |
public static function init():voidCall this to init the printer SDK as the first thing you should do when working with this ANE.
| showChooseDialog | () | method |
public static function showChooseDialog($callback:Function):void(Android) opens a native window allowing user to scan and find bluetooth printers.
Parameters
$callback:Function — is called when the native window is closed. function($state:int, $msg:String, $connectionType:int):void
|
| showConnectedDevices | () | method |
public static function showConnectedDevices($callback:Function):void(Android) opens a native window containing a list of connected printers which you can switch to.
Parameters
$callback:Function — is called when the native window is closed. function($devices:Array, $selectedDevice:String):void
|
| startScan | () | method |
public static function startScan($callback:Function):void(iOS) start scanning for finding a bluetooth printer.
Parameters
$callback:Function — is called when the scan is finished. function($devices:Vector.<PrinterDevice>, $error:Error):void
|
| stopScan | () | method |
public static function stopScan():void(iOS) stop the scanning process.
| switchPrinter | () | method |
public static function switchPrinter($printerInterface:PrinterInterface):void
(iOS) switch between connected devices. Pass PrinterInterface instance returned from
Rongta.connectedDevices.
Parameters
$printerInterface:PrinterInterface |
| writeMsg | () | method |
public static function writeMsg($bytes:String):voidSend Base64 String bytes to the printer.
Parameters
$bytes:String — commnads
|
| ANDROID_SDK_V | Constant |
public static const ANDROID_SDK_V:String = 2.0.23| CMD_ESC | Constant |
public static const CMD_ESC:int = 1| CON_BLUETOOTH | Constant |
public static const CON_BLUETOOTH:int = 1| EXTENSION_ID | Constant |
public static const EXTENSION_ID:String = com.myflashlab.air.extensions.rongta| IOS_SDK_V | Constant |
public static const IOS_SDK_V:String = 4.10.17| VERSION | Constant |
public static const VERSION:String = 0.0.1