Packagecom.myflashlab.air.extensions.rongta
Classpublic class Rongta
InheritanceRongta Inheritance Object

Initialize the printer ANE using Rongta.init();



Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
Public Constants
 ConstantDefined 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
Property Detail
connectedDevicesproperty
connectedDevices:Vector.<PrinterInterface>  [read-only]

(iOS) returns an array of connected printers in PrinterInterface objects. You can pass an instance of PrinterInterface to switchPrinter.


Implementation
    public static function get connectedDevices():Vector.<PrinterInterface>
listenerproperty 
listener:EventDispatcher  [read-only]

Use this listener to attach RongtaEvents.DEVICE_CONNECTION_STATE


Implementation
    public static function get listener():EventDispatcher
Method Detail
connect()method
public static function connect($printer:PrinterDevice = null):Boolean

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

Returns
Boolean — returns true if the connect operation is starting. if no device is selected, this will return false
createCmd()method 
public static function createCmd():Cmd

Create command object.

Returns
Cmd
disconnect()method 
public static function disconnect():void

Disconnect the app from the printer.

init()method 
public static function init():void

Call 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):void

Send Base64 String bytes to the printer.

Parameters

$bytes:String — commnads

Constant Detail
ANDROID_SDK_VConstant
public static const ANDROID_SDK_V:String = 2.0.23

CMD_ESCConstant 
public static const CMD_ESC:int = 1

CON_BLUETOOTHConstant 
public static const CON_BLUETOOTH:int = 1

EXTENSION_IDConstant 
public static const EXTENSION_ID:String = com.myflashlab.air.extensions.rongta

IOS_SDK_VConstant 
public static const IOS_SDK_V:String = 4.10.17

VERSIONConstant 
public static const VERSION:String = 0.0.1