CustomiOSApi 1.11
CustomiOSApi Class Reference

Factory class to get the printer driver class for supported model id More...

#import <CustomiOSApi.h>

Instance Methods

(NSString *) - GetAPIVersion
 Returns current API version More...
 
(void) - EnableLogAPI:
 
(NSArray *) - EnumWifiDevices:searchTime:
 Get the list of the available CUSTOM wifi/ethernet devices More...
 
(CustomPrinter *) - GetPrinterDriverWIFI:printerIpAddr:
 Connects to WiFi/Ethernet Printer device More...
 
(CustomPrinter *) - GetPrinterDriverWIFI:printerIpAddr:printerIpPort:
 Connects to WiFi/Ethernet Printer device More...
 
(NSArray *) - EnumBTDevices:
 Get the list of the available bluetooth devices More...
 
(CustomPrinter *) - GetPrinterDriverBT:btdevice:
 Connects to Bluetooth Printer device More...
 
(NSArray *) - EnumBLEDevices:searchTime:
 Get the list of the available BLE (bluetooth low energy) devices More...
 
(NSArray *) - EnumBLEDevices:searchTime:strBleGattServiceUUIDToFind:
 Get the list of the available BLE (bluetooth low energy) devices with a particular Service UUID More...
 
(CustomPrinter *) - GetPrinterDriverBLE:bledevice:
 Connects to BLE (bluetooth low energy) Printer device More...
 
(CustomPrinter *) - GetPrinterDriverBLE:bledevice:iBleTxMaxSize:iBleTxSleepms:strBleGattServiceUUID:strGattCarTx:strGattCarRx:
 Connects to BLE (bluetooth low energy) Printer device More...
 

Detailed Description

Factory class to get the printer driver class for supported model id

Method Documentation

◆ EnableLogAPI:

- (void) EnableLogAPI: (Boolean)  enable

Enable / disable the API log (default disabled)

Parameters
enableLog status

◆ EnumBLEDevices:searchTime:

- (NSArray *) EnumBLEDevices: (NSInteger) 
searchTime: (NSError **)  error 

Get the list of the available BLE (bluetooth low energy) devices

Parameters
searchTimeSearch BLE devices timeout (msec)
errorError pointer
Returns
The array of CBPeripheral of BLE devices

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum BLE devices (search devices)
NSArray* arrayBLE = [customApi EnumBLEDevices:3000 :&error];
//Save the 1st BLE Device found
CBPeripheral* ble1stDevice = [arrayBLE objectAtIndex:0];
Factory class to get the printer driver class for supported model id
Definition: CustomiOSApi.h:21

◆ EnumBLEDevices:searchTime:strBleGattServiceUUIDToFind:

- (NSArray *) EnumBLEDevices: (NSInteger) 
searchTime: (NSString *) 
strBleGattServiceUUIDToFind: (NSError **)  error 

Get the list of the available BLE (bluetooth low energy) devices with a particular Service UUID

Parameters
searchTimeSearch BLE devices timeout (msec)
strBleGattServiceUUIDToFindBLE (bluetooth low energy) GATT Service UUID to search
errorError pointer
Returns
The array of CBPeripheral of BLE devices

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum BLE devices (search devices with this particular UUID)
NSArray* arrayBLE = [customApi EnumBLEDevices:3000 :@"0003FA11-0000-1000-8000-00805F9B0131" :&error];
//Save the 1st BLE Device found
CBPeripheral* ble1stDevice = [arrayBLE objectAtIndex:0];

◆ EnumBTDevices:

- (NSArray *) EnumBTDevices: (NSError **)  error

Get the list of the available bluetooth devices

Parameters
errorError pointer
Returns
The array of EAAccessory of bluetooth devices

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum BT devices (search devices)
NSArray* arrayBT = [customApi EnumBTDevices:&error];
//Save the 1st BT Device found
EAAccessory* bt1stDevice = [arrayBT objectAtIndex:0];

◆ EnumWifiDevices:searchTime:

- (NSArray *) EnumWifiDevices: (NSInteger) 
searchTime: (NSError **)  error 

Get the list of the available CUSTOM wifi/ethernet devices

Parameters
searchTimeSearch wifi/ethernet devices timeout (msec)
errorError pointer
Returns
The array of NSString with IP ADDRESS of CUSTOM wifi/Ethernet devices

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum WIFI devices (search devices for 1.5 secs)
NSArray* arrayIP = [customApi EnumWifiDevices:1500 :&error];
//Save the 1st IP found
NSString* str1stDeviceIP = [arrayIP objectAtIndex:0];

◆ GetAPIVersion

- (NSString *) GetAPIVersion

Returns current API version

Returns
current API version

◆ GetPrinterDriverBLE:bledevice:

- (CustomPrinter *) GetPrinterDriverBLE: (CBPeripheral *) 
bledevice: (NSError **)  error 

Connects to BLE (bluetooth low energy) Printer device

Parameters
bledeviceCBPeripheral* of the device
errorError pointer
Returns
Printer driver class according to its model/printer ID

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum BLE devices (search devices)
NSArray* arrayBLE = [customApi EnumBLEDevices:3000 :&error];
//Open the 1st device found
CustomPrinter* cp = [customApi GetPrinterDriverBLE:[arrayBLE objectAtIndex:0] :&error];
Class definition for CUSTOM printers. Defines functionality to print text/image, read/write data to p...
Definition: CustomPrinter.h:21

◆ GetPrinterDriverBLE:bledevice:iBleTxMaxSize:iBleTxSleepms:strBleGattServiceUUID:strGattCarTx:strGattCarRx:

- (CustomPrinter *) GetPrinterDriverBLE: (CBPeripheral *) 
bledevice: (NSInteger) 
iBleTxMaxSize: (NSInteger) 
iBleTxSleepms: (NSString *) 
strBleGattServiceUUID: (NSString *) 
strGattCarTx: (NSString *) 
strGattCarRx: (NSError **)  error 

Connects to BLE (bluetooth low energy) Printer device

Parameters
bledeviceCBPeripheral* of the device
iBleTxMaxSizeWrite packet maximum size
iBleTxSleepmsSleep (in milliseconds) after the write (0 if it isn't necessary)
strBleGattServiceUUIDBLE (bluetooth low energy) GATT Service UUID
strGattCarTxBLE (bluetooth low energy) GATT Service Characteristic UUID for Tx
strGattCarRxBLE (bluetooth low energy) GATT Service Characteristic UUID for Rx
errorError pointer
Returns
Printer driver class according to its model/printer ID

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum BLE devices (search devices with this particular UUID)
NSArray* arrayBLE = [customApi EnumBLEDevices:3000 :@"0003FA11-0000-1000-8000-00805F9B0131" :&error];
//Open the 1st device found
CustomPrinter* cp = [customApi GetPrinterDriverBLE:[arrayBLE objectAtIndex:0] :180 :0 :@"0003FA11-0000-1000-8000-00805F9B0131" :@"00031202-0000-1000-8000-00805F9B0133" :@"00031201-0000-1000-8000-00805F9B0131" :&error];

◆ GetPrinterDriverBT:btdevice:

- (CustomPrinter *) GetPrinterDriverBT: (EAAccessory *) 
btdevice: (NSError **)  error 

Connects to Bluetooth Printer device

Parameters
btdeviceEAAccessory* of the device
errorError pointer
Returns
Printer driver class according to its model/printer ID

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum BT devices (search devices)
NSArray* arrayBT = [customApi EnumBTDevices:&error];
//Open the 1st device found
CustomPrinter* cp = [customApi GetPrinterDriverBT:[arrayBT objectAtIndex:0] :&error];

◆ GetPrinterDriverWIFI:printerIpAddr:

- (CustomPrinter *) GetPrinterDriverWIFI: (NSString *) 
printerIpAddr: (NSError **)  error 

Connects to WiFi/Ethernet Printer device

Parameters
printerIpAddrPrinter IP Address
errorError pointer
Returns
Printer driver class according to its model/printer ID

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum WIFI devices (search devices for 1.5 secs)
NSArray* arrayIP = [customApi EnumWifiDevices:1500 :&error];
//Open the 1st device found (on default 9100 port)
CustomPrinter* cp = [customApi GetPrinterDriverWIFI:[arrayIP objectAtIndex:0] :&error];

◆ GetPrinterDriverWIFI:printerIpAddr:printerIpPort:

- (CustomPrinter *) GetPrinterDriverWIFI: (NSString *) 
printerIpAddr: (NSInteger) 
printerIpPort: (NSError **)  error 

Connects to WiFi/Ethernet Printer device

Parameters
printerIpAddrPrinter IP Address
printerIpPortPrinter IP Port
errorError pointer
Returns
Printer driver class according to its model/printer ID

Example usage:

//Create the Error Object
NSError *error = nil;
//Create Main Object
CustomiOSApi customApi = [[CustomiOSApi alloc] init];
//Enum WIFI devices (search devices for 1.5 secs)
NSArray* arrayIP = [customApi EnumWifiDevices:1500 :&error];
//Open the 1st device found (on 9100 port)
CustomPrinter* cp = [customApi GetPrinterDriverWIFI:[arrayIP objectAtIndex:0] :9100 :&error];