Select your printer model

Parameters are refined by the selected printer.

start


Starts searching for the specified device type.

Each device is reported by the callback as it is detected.

Syntax

 
+ (int) start:(Epos2FilterOption *)filterOption delegate:(id<Epos2DiscoveryDelegate>)delegate;

Parameter

filterOption

In order to filter the search result, set the filter option in the Epos2FilterOption type and specify it in the parameter. When nil is specified, search is run with the default settings.

The following information is stored in the Epos2FilterOption type.

  • portType
    Selects the port to search.
  • Value

    Description

    EPOS2_PORTTYPE_ALL (default)

    Search for all devices which can be connected via TCP, Bluetooth, USB or BLE.

    EPOS2_PORTTYPE_TCP

    Search for devices connected to the network.

    EPOS2_PORTTYPE_BLUETOOTH

    Search for devices which can be connected via Bluetooth.

    EPOS2_PORTTYPE_USB

    Search for devices which can be connected via USB.

    EPOS2_PORTTYPE_BLUETOOTH_LE

    Search for devices that can be connected via Bluetooth Low Energy.

  • broadcast
    Specify a Broadcast Address for TCP search as a string.
  • Value

    Description

    "255.255.255.255" (default)

    -

  • deviceModel
    Specifies the device model to search for.
  • Value

    Description

    EPOS2_MODEL_ALL

    Search for all models.

  • deviceType
    Specifies the device type to search for.
    The device type settings other than "EPOS2_TYPE_ALL" can be used for the following systems connected using Wi-Fi or Ethernet.
    • Customer Display Models (SSL/TLS communication only)
    • TM Printer + DM-D + barcode scanner model
    • TM Printer + barcode scanner model
    • POS Terminal Model
  • Value

    Description

    EPOS2_TYPE_ALL (default)

    Search for all devices.

    EPOS2_TYPE_PRINTER

    Search for printers.

    EPOS2_TYPE_HYBRID_PRINTER

    Searches for hybrid model printers.

    EPOS2_TYPE_DISPLAY

    Search for customer displays.

    EPOS2_TYPE_KEYBOARD

    Search for keyboards.

    EPOS2_TYPE_SCANNER

    Search for barcode scanners.

    EPOS2_TYPE_SERIAL

    Search for serial communication devices.

    EPOS2_TYPE_POS_KEYBOARD

    Search for the POS keyboard.

    EPOS2_TYPE_MSR

    Search for the MSR.

    EPOS2_TYPE_GFE

    Search for the German fiscal element (TSE).

    EPOS2_TYPE_OTHER_PERIPHERAL

    Search for other peripheral devices.

delegate

Specifies an object conforming to the Epos2DiscoveryDelegate protocol.

Return value

Error status

Description

EPOS2_SUCCESS

The function was executed successfully.

EPOS2_ERR_PARAM

An invalid parameter was passed.

EPOS2_ERR_ILLEGAL

Tried to start search when search had been already done.

EPOS2_ERR_MEMORY

Memory necessary for processing could not be allocated.

EPOS2_ERR_FAILURE

An unknown error occurred.

EPOS2_ERR_PROCESSING

Could not run the process.

Protocol declaration

 
@protocol Epos2DiscoveryDelegate <NSObject>
@required
- (void) onDiscovery:(Epos2DeviceInfo *)deviceInfo;
@end

Parameter

deviceInfo

The device information of the detected device is stored in the Epos2DeviceInfo type.

The following device information is stored.

  • deviceType
    The device type is stored.
  • Device type

    Status

    For a printer

    EPOS2_TYPE_PRINTER

    For hybrid model printers

    EPOS2_TYPE_HYBRID_PRINTER

    For a customer display

    EPOS2_TYPE_DISPLAY

    For a keyboard

    EPOS2_TYPE_KEYBOARD

    For a barcode scanner

    EPOS2_TYPE_SCANNER

    For a serial communication device

    EPOS2_TYPE_SERIAL

    For POS keyboard

    EPOS2_TYPE_POS_KEYBOARD

    For MSR

    EPOS2_TYPE_MSR

    For German fiscal element (TSE)

    EPOS2_TYPE_GFE

    For other peripheral devices

    EPOS2_TYPE_OTHER_PERIPHERAL

  • target
    The connection target of a device which can be specified by connectAPI is stored as a string.
    Example)
    "TCP:192.168.192.168"
    "BT:00:22:15:7D:70:9C"
    "USB:000000000000000000"
    "TCP:192.168.192.168[local_printer]"
    "TCP:192.168.192.168[local_display]"
    "TCP:12:34:56:78:56:78"
    "BLE: 00:22:15:7D:70:9C"
  • deviceName
    The name set to the device is stored.
    If it could not be acquired, "" (blank character) is stored.
    Example)
    For a printer: "TM-T88V"
  • ipAddress
    The IP address is stored.
    If it could not be acquired, "" (blank character) is stored.
    Example)
    TCP: "192.168.192.168"
    BT: ""(blank character)
    USB: ""(blank character)
    BLE: ""(blank character)
  • macAddress
    The MAC address is stored.
    If it could not be acquired, "" (blank character) is stored.
    Example)
    TCP: "12:34:56:78:56:78"
    BT: ""(blank character)
    USB: ""(blank character)
    BLE: ""(blank character)
  • bdAddress
    The BD address is stored.
    If it could not be acquired, "" (blank character) is stored.
    Example)
    TCP: ""(blank character)
    BT: "12:34:56:78:56:78"
    USB: ""(blank character)
    BLE: ""(blank character)
  • leBdAddress
    The Bluetooth Low Energy BD address is stored.
    If it could not be acquired, "" (blank character) is stored.
    Example)
    TCP: ""(blank character)
    BT: ""(blank character)
    USB: ""(blank character)
    BLE: "00:22:15:7D:70:9C"

Supplementary explanation

  • The search result of this API is reported to the callback function for each device detected.
    An already opened device is also reported. However, an already opened Bluetooth device is not reported.
  • In search for TCP devices, if multiple devices with the same IP address exist, the device information is treated as a single device. Consistency for such device information is not guaranteed.
  • If the printer has its TCP address and TCPS address, and the both are detected, only the TCPS address is reported to the callback function.
  • Hybrid model printers can be detected as deviceType of EPOS2_TYPE_PRINTER and EPOS2_TYPE_HYBRID_PRINTER.
  • After the search begins and the process ends, make sure to end the search.
  • In iOS14 or later, when a dialog asking permission to access the local network appears after this API is executed, execute stop after permission to access the local network is granted, end the search, and then execute this API again and perform a search.
 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

Epson ePOS SDK includes patented or patent pending functions. The contents must not be disclosed to third parties.


Epson ePOS SDK for iOS

Jump to the top