Logo
Developer SDK
Version 1.9.632.913d652c-152450467.
Peripheral Class Referenceabstract
Inheritance diagram for Peripheral:
CashDrawer Scanner

Public Member Functions

abstract String getId ()
 
abstract String getName ()
 
abstract String getModel ()
 
abstract String getHardwareId ()
 
abstract String getPeripheralType ()
 
abstract String getStatus ()
 
abstract String getConnectionType ()
 
abstract boolean startSession ()
 
abstract boolean endSession ()
 
abstract boolean isCapable (String capability)
 
abstract HashMap< String, Object > getAttributes ()
 

Static Public Attributes

static final String STATUS_CONNECTED = "com.verifone.peripherals.STATUS_CONNECTED"
 
static final String STATUS_READY = "com.verifone.peripherals.STATUS_READY"
 
static final String STATUS_BUSY = "com.verifone.peripherals.STATUS_BUSY"
 
static final String STATUS_DISCONNECTED = "com.verifone.peripherals.STATUS_DISCONNECTED"
 
static final String STATUS_DISCONNECTED_BY_UNDOCK
 
static final String STATUS_ERROR = "com.verifone.peripherals.STATUS_ERROR"
 
static final String STATUS_UNKNOWN = "com.verifone.peripherals.STATUS_UNKNOWN"
 
static final String USB_CONNECTION = "com.verifone.peripherals.USB_CONNECTION_TYPE"
 
static final String BLUETOOTH_CONNECTION
 
static final String WIFI_CONNECTION = "com.verifone.peripherals.WIFI_CONNECTION_TYPE"
 
static final String NETWORK_CONNECTION
 
static final String SERIAL_CONNECTION
 
static final String BUILTIN_CONNECTION
 
static final String UNKNOWN_CONNECTION
 

Detailed Description

The base class for all peripherals with SDK-provided APIs. The statuses may be extended by the specific peripheral, meaning that getStatus() may return a String not identified in this parent class. The connection type may be more indicative of the Android connection rather than the peripheral. For example, it is possible that the Android will be using an ethernet cable to connect to the network that a peripheral is connected to. Even if the peripheral is using WiFi to connect, the Android may recognize it with the NETWORK connection type.

Definition at line 16 of file Peripheral.java.

Member Function Documentation

◆ endSession()

abstract boolean endSession ( )
abstract

Releases the peripheral, allowing other applications to start using it.

◆ getAttributes()

abstract HashMap<String, Object> getAttributes ( )
abstract

Returns the current attributes, or null if this peripheral does not support attributes, or an empty HashMap if none are applied and there are no defaults.

◆ getConnectionType()

abstract String getConnectionType ( )
abstract

Returns the manner in which the Android peripheral service connects to the peripheral. The type of connection may change, as some peripherals may dock/undock, while other peripherals will be constant.

◆ getHardwareId()

abstract String getHardwareId ( )
abstract

Generally returns the serial number or some other unique hardware identifier for the peripheral, or null if not available.

◆ getId()

abstract String getId ( )
abstract

Returns a unique ID to identify this peripheral. This ID will be consistent across device disconnect/reconnect, restarts, and across all applications for this device, but may change during factory resets or if the peripheral is reset.

◆ getModel()

abstract String getModel ( )
abstract

Returns the model as provided by the manufacturer, or null if not available.

◆ getName()

abstract String getName ( )
abstract

Returns the name as assigned by the merchant, or getModel if the name is not set.

◆ getPeripheralType()

abstract String getPeripheralType ( )
abstract

Returns the type of peripheral based on the constant

PERIPHERAL_TYPE

defined in the respective class.

◆ getStatus()

abstract String getStatus ( )
abstract

Returns the current status of the peripheral. This may return one of the statuses listed above, or a peripheral-specific status.

◆ isCapable()

abstract boolean isCapable ( String  capability)
abstract

A method to check on peripheral-specific capabilities.

◆ startSession()

abstract boolean startSession ( )
abstract

Starts a session with the peripheral, reserving it for use by this application.

Member Data Documentation

◆ BLUETOOTH_CONNECTION

final String BLUETOOTH_CONNECTION
static
Initial value:
= "com.verifone.peripherals" +
".BLUETOOTH_CONNECTION_TYPE"

The peripheral is connected using Bluetooth.

Definition at line 47 of file Peripheral.java.

◆ BUILTIN_CONNECTION

final String BUILTIN_CONNECTION
static
Initial value:
= "com.verifone.peripherals" +
".BUILTIN_CONNECTION_TYPE"

The peripheral is built in to the Android system, an example of which is the camera.

Definition at line 61 of file Peripheral.java.

◆ NETWORK_CONNECTION

final String NETWORK_CONNECTION
static
Initial value:
= "com.verifone.peripherals" +
".NETWORK_CONNECTION_TYPE"

The peripheral is connected using a network over some kind of physical wire.

Definition at line 52 of file Peripheral.java.

◆ SERIAL_CONNECTION

final String SERIAL_CONNECTION
static
Initial value:
= "com.verifone.peripherals" +
".SERIAL_CONNECTION_TYPE"

The peripheral is connected using a serial protocol. This may mean that the serial communication is adapted to USB, or that there is a serial port available.

Definition at line 58 of file Peripheral.java.

◆ STATUS_BUSY

final String STATUS_BUSY = "com.verifone.peripherals.STATUS_BUSY"
static

Another application has an active session with this peripheral.

Definition at line 23 of file Peripheral.java.

◆ STATUS_CONNECTED

final String STATUS_CONNECTED = "com.verifone.peripherals.STATUS_CONNECTED"
static

The peripheral is connected, but may need some extra steps to become ready.

Definition at line 19 of file Peripheral.java.

◆ STATUS_DISCONNECTED

final String STATUS_DISCONNECTED = "com.verifone.peripherals.STATUS_DISCONNECTED"
static

The peripheral is remembered by the manager but is not connected.

Definition at line 25 of file Peripheral.java.

◆ STATUS_DISCONNECTED_BY_UNDOCK

final String STATUS_DISCONNECTED_BY_UNDOCK
static
Initial value:
= "com.verifone.peripherals" +
".STATUS_DISCONNECTED_BY_UNDOCK"

The peripheral is remembered by the manager but is no longer available because the device is now not docked to the base. This should not trigger any UI notifications, but can be used by applications to disable functionality as appropriate.

Definition at line 31 of file Peripheral.java.

◆ STATUS_ERROR

final String STATUS_ERROR = "com.verifone.peripherals.STATUS_ERROR"
static

There is a general error communicating with the peripheral. This should generally prompt interaction with the user to check the peripheral.

Definition at line 37 of file Peripheral.java.

◆ STATUS_READY

final String STATUS_READY = "com.verifone.peripherals.STATUS_READY"
static

The peripheral is connected and ready for use.

Definition at line 21 of file Peripheral.java.

◆ STATUS_UNKNOWN

final String STATUS_UNKNOWN = "com.verifone.peripherals.STATUS_UNKNOWN"
static

Allows future states to be added while preserving backwards compatibility.

Definition at line 39 of file Peripheral.java.

◆ UNKNOWN_CONNECTION

final String UNKNOWN_CONNECTION
static
Initial value:
= "com.verifone.peripherals" +
".UNKNOWN_CONNECTION_TYPE"

Allows future connection types to be added while preserving backwards compatibility.

Definition at line 64 of file Peripheral.java.

◆ USB_CONNECTION

final String USB_CONNECTION = "com.verifone.peripherals.USB_CONNECTION_TYPE"
static

The peripheral is connected by a physical USB cable and is recognized as a normal USB connection.

Definition at line 45 of file Peripheral.java.

◆ WIFI_CONNECTION

final String WIFI_CONNECTION = "com.verifone.peripherals.WIFI_CONNECTION_TYPE"
static

The peripheral is connected via a Wi-Fi network.

Definition at line 50 of file Peripheral.java.


The documentation for this class was generated from the following file:

This document is the confidential property of Verifone, Inc. Any reproduction or distribution of this document, in whole or in part, or the disclosure of any of the information contained herein, without the prior written consent of Verifone, Inc. is prohibited. This document and any supplemental material supplied as part of any review must be returned to Verifone, Inc. upon request. Notice: This document may go through material revisions over time. While the Company will make every effort to keep readers updated as changes occur, care must be taken by the reader to make sure they are reading the latest version. Version numbers appear in the title page and revision history page of this document. All rights reserved. Verifone, the Verifone logo are either trademarks or registered trademarks of Verifone in the United States and/or other countries. All other trademarks or brand names are properties of their respective holders.