Transport

public interface interface Transport

Class for managing request and notification flowing in and out of the tag.

Fields

Name Description
public static final int DEFAULT_TIMEOUT

Default timeout duration for ble commands.

Methods

getPeripheralIdentifier

public String getPeripheralIdentifier()

Returns the identifier for the peripheral.

ReturnValue

Name Description
String

getDefaultDisplayName

public String getDefaultDisplayName()

Returns the of the peripheral from ble cache.

ReturnValue

Name Description
String

getNotificationSignal

public Signal<byte> getNotificationSignal()

Returns a Signal emitting notification from the peripheral.

ReturnValue

Name Description
Signal<byte>

getValueWrittenSignal

public Signal<CharacteristicUpdate> getValueWrittenSignal()

Signal emitting when values are written to the peripheral.

ReturnValue

Name Description
Signal<CharacteristicUpdate>

getDataTransport

public Signal<> getDataTransport()

Returns a signal emitting data received on ujt data channel.

ReturnValue

Name Description
Signal<>

valueWritten

public void valueWritten(CharacteristicUpdate characteristicUpdate)

Callback reporting the result of a write operation.

Parameters

Name Description
CharacteristicUpdate characteristicUpdate

object holding the characteristic that was written to the device.

ReturnValue

Name Description
void

characteristicUpdated

public void characteristicUpdated(CharacteristicUpdate characteristicUpdate)

Notify or response the updated characteristic.

Parameters

Name Description
CharacteristicUpdate characteristicUpdate

object holding the characteristic that was written to the device.

ReturnValue

Name Description
void

getPendingRequestSize

public int getPendingRequestSize()

Returns pending requests count.

ReturnValue

Name Description
int

requestConnectionPriority

public void requestConnectionPriority(int priority)

This function will send a connection parameter update request to the remote device.

Parameters

Name Description
int priority

Request a specific connection priority. Must be one of {@link BluetoothGatt#CONNECTION_PRIORITY_BALANCED}, BluetoothGatt#CONNECTION_PRIORITY_HIGH or BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER.

ReturnValue

Name Description
void

onRSSIValueUpdated

public void onRSSIValueUpdated(int rssiValue)

Notify the requested rssi value for the ujt.

Parameters

Name Description
int rssiValue

the signal strength from the ujt.

ReturnValue

Name Description
void

fetchRSSIValue

public Signal<Integer> fetchRSSIValue()

Fetch the current tag's signal strength (i.e. rssi value).

ReturnValue

Name Description
Signal<Integer>

stopRSSIValue

public void stopRSSIValue()

Stop fetching current tag's signal strength (i.e. rssi value).

ReturnValue

Name Description
void

getRawData

public Signal<byte> getRawData()

ReturnValue

Name Description
Signal<byte>

enqueue

public <ProtoRequest extends ProtoCommandRequest<?>>Signal<byte> enqueue(ProtoRequest request, WriteType writeType, int retries)

Enqueues a request to be send to the peripheral.

Parameters

Name Description
ProtoRequest request

the request to send to the peripheral

WriteType writeType

the WriteType.

int retries

ReturnValue

Name Description
Signal<byte>

a Signal emitting a single response

enqueue

public <ProtoRequest extends ProtoCommandRequest<?>>Signal<byte> enqueue(ProtoRequest request, WriteType writeType, int retries, long timeout)

Enqueues a request to be send to the peripheral.

Parameters

Name Description
ProtoRequest request

the request to send to the peripheral

WriteType writeType

the WriteType.

int retries
long timeout

duration in milliseconds

ReturnValue

Name Description
Signal<byte>

a Signal emitting a single response

getAckSignal

public Signal<Byte> getAckSignal()

Returns a signal to receive ack packets sent by ujt.

ReturnValue

Name Description
Signal<Byte>

sendData

public Signal<Boolean> sendData(byte[] data)

Sends data to UJT.

Parameters

Name Description
byte[] data

ReturnValue

Name Description
Signal<Boolean>