LISNR Radius Android SDK 2.0.0
Classes | Public Member Functions | List of all members
com.lisnr.radius.Transceiver Class Reference

Classes

interface  TransceiverCallback
 Callback interface that contains callbacks for the TransceiverCallback object. More...
 
enum  TransceiverType
 

Public Member Functions

 Transceiver (TransceiverType type, TransceiverCallback callback) throws InvalidProfileException
 
TransceiverType getType ()
 
void transmit (Tone tone) throws InvalidTonePayloadException, TransceiverNotRegisteredException
 
void transmit (ArrayList< Tone > tones) throws InvalidTonePayloadException, TransceiverNotRegisteredException
 
void beacon (Tone tone) throws InvalidTonePayloadException, TransceiverNotRegisteredException, BeaconNotPermittedException
 
void clear () throws TransceiverNotRegisteredException
 
boolean isEmpty () throws TransceiverNotRegisteredException
 
int getMaxPayloadSizeBytes ()
 

Constructor & Destructor Documentation

◆ Transceiver()

com.lisnr.radius.Transceiver.Transceiver ( TransceiverType  type,
TransceiverCallback  callback 
) throws InvalidProfileException
inline

Constructor for the Transceiver object. After construction, the Transceiver must be registered with a valid Radius object in order for tones to be received or transmitted.

Parameters
typeThe type of Transceiver to create (determines transmit/receive types) (must be non-null)
callbackThe implemented TransceiverCallback interface that will be invoked by this Transceiver (must be non-null)
Exceptions
com.lisnr.radius.exceptions.InvalidProfileExceptionif the provided profile is invalid
NullPointerExceptionif any the provided arguments are null

Member Function Documentation

◆ beacon()

void com.lisnr.radius.Transceiver.beacon ( Tone  tone) throws InvalidTonePayloadException, TransceiverNotRegisteredException, BeaconNotPermittedException
inline

Continuously broadcast a tone. To end the beacon, perform any of the following:

  • Call clear() – will allow active beacon Tone to finish. Transceiver.onTransmitterEmpty and Transceiver.onTransmitComplete will be called after final beacon
  • Call transmit() – will allow active beacon Tone to finish. Transceiver.onTransmitComplete will happen after final beacon, Transceiver.onTransmitterEmpty will be called after the tone(s) provided to transmit()
  • Call Radius.unregisterTransceiver() or Radius.unregisterAll() – will preempt active beacon Tone. Transceiver.onTransmitterEmpty and Transceiver.onTransmitComplete will not be called
Parameters
toneThe tone to use as a beacon
Exceptions
com.lisnr.radius.exceptions.InvalidTonePayloadExceptionif the provided Tone payload is empty or too large for the Transceiver (based on Transceiver type)
com.lisnr.radius.exceptions.TransceiverNotRegisteredExceptionif the Transceiver has not been registered with a valid Radius object
com.lisnr.radius.exceptions.BeaconNotPermittedExceptionif other Transceiver objects are registered to the Radius object
NullPointerExceptionif a null Tone object is provided
Note
beacon() can only be called when no other Transceiver objects are registered to the Radius object.
calling beacon() while beaconing is active will allow the currently transmitting beacon tone to complete, followed by the beacon tone being changed over to the tone passed in on the most recent call to beacon()
Transceiver.onTransmitComplete will be called upon every successful transmission of a beacon tone
Transceiver.onTransmitterEmpty will not be called unless the beacon is stopped by either calling clear() or transmit()

◆ clear()

void com.lisnr.radius.Transceiver.clear ( ) throws TransceiverNotRegisteredException
inline

Remove all remaining Tone objects for this Transceiver that have not yet been transmitted.

Exceptions
com.lisnr.radius.exceptions.TransceiverNotRegisteredExceptionif the Transceiver has not been registered with a valid Radius object
Note
This does not interrupt an active transmission of a Tone.

◆ isEmpty()

boolean com.lisnr.radius.Transceiver.isEmpty ( ) throws TransceiverNotRegisteredException
inline

Determine if the Transceiver has any Tone objects queued.

Exceptions
com.lisnr.radius.exceptions.TransceiverNotRegisteredExceptionif the Transceiver has not been registered with a valid Radius object
Returns
true if Transceiver has no tones queued, false if it does

◆ transmit() [1/2]

void com.lisnr.radius.Transceiver.transmit ( ArrayList< Tone tones) throws InvalidTonePayloadException, TransceiverNotRegisteredException
inline

Transmit a list of Tones. Tones will be transmitted in the order they are presented in the provided list. If the associated Radius object has any Tone objects queued or is actively transmitting, the Tone is queued for transmission.

Parameters
tonesList of Tones to be transmitted (must be non-null)
Exceptions
com.lisnr.radius.exceptions.InvalidTonePayloadExceptionif any of the provided Tone payloads are empty or too large for the Transceiver (based on Transmitter profile)
com.lisnr.radius.exceptions.TransceiverNotRegisteredExceptionif the Transceiver has not been registered with a valid Radius object
NullPointerExceptionif a null ArrayList is provided, or if any Tone object within the ArrayList is null
Note
If com.lisnr.radius.exceptions.InvalidTonePayloadException is thrown, none of the provided Tones will be transmitted.
If the Transceiver is currently beaconing, calling transmit() will stop the beacon while allowing the active beacon tone to finish transmitting.

◆ transmit() [2/2]

void com.lisnr.radius.Transceiver.transmit ( Tone  tone) throws InvalidTonePayloadException, TransceiverNotRegisteredException
inline

Transmit a single Tone. If the associated Radius object has any Tone objects queued or is actively transmitting, the Tone is queued for transmission.

Parameters
toneTone to be transmitted (must be non-null)
Exceptions
com.lisnr.radius.exceptions.InvalidTonePayloadExceptionif Tone payload is empty or too large for the Transmitter (based on Transmitter profile)
com.lisnr.radius.exceptions.TransceiverNotRegisteredExceptionif the Transceiver has not been registered with a valid Radius object
NullPointerExceptionif a null Tone object is provided
Note
If the Transceiver is currently beaconing, calling transmit() will stop the beacon while allowing the active beacon tone to finish transmitting.
calling beacon() while beaconing is active will allow the currently transmitting beacon tone to complete, followed by the beacon tone being changed over to the tone passed in on the most recent call to beacon()
Transceiver.onTransmitComplete will be called upon every successful transmission of a beacon tone

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