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

Class used transmit ultrasonic data. More...

Classes

interface  TransmitterCallback
 Callback interface that contains callbacks for the Transmitter object. More...
 

Public Member Functions

 Transmitter (String profile, TransmitterCallback callback) throws InvalidProfileException
 
void transmit (Tone tone) throws InvalidTonePayloadException, TransmitterNotRegisteredException
 
void transmit (ArrayList< Tone > tones) throws InvalidTonePayloadException, TransmitterNotRegisteredException
 
void beacon (Tone tone) throws InvalidTonePayloadException, TransmitterNotRegisteredException, BeaconNotPermittedException
 
void clear () throws TransmitterNotRegisteredException
 
String getProfile ()
 
int getMaxPayloadSizeBytes ()
 
boolean isEmpty () throws TransmitterNotRegisteredException
 

Detailed Description

Class used transmit ultrasonic data.

Constructor & Destructor Documentation

◆ Transmitter()

com.lisnr.radius.Transmitter.Transmitter ( String  profile,
TransmitterCallback  callback 
) throws InvalidProfileException
inline

Constructor for the Transmitter object. After construction, the Transmitter object must be registered with a valid Radius object prior to any calls to transmit(), beacon(), clear(), or isEmpty().

Parameters
profileThe Radius profile used for all tones transmitted from this Transmitter (must be non-null)
callbackThe implemented TransmitterCallback interface that will be invoked by this Transmitter (must be non-null)
Exceptions
com.lisnr.radius.exceptions.InvalidProfileExceptionif the provided profile is not valid
NullPointerExceptionif any of the provided arguments are null

Member Function Documentation

◆ beacon()

void com.lisnr.radius.Transmitter.beacon ( Tone  tone) throws InvalidTonePayloadException, TransmitterNotRegisteredException, BeaconNotPermittedException
inline

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

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 Transmitter (based on Transmitter profile)
com.lisnr.radius.exceptions.TransmitterNotRegisteredExceptionif the Transmitter has not been registered with a valid Radius object
com.lisnr.radius.exceptions.BeaconNotPermittedExceptionif other Transmitter objects are registered to the Radius object
NullPointerExceptionif a null Tone object is provided
Note
beacon() can only be called when no other Transmitter 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()
TransmitterCallback.onTransmitComplete will be called upon every successful transmission of a beacon tone
TransmitterCallback.onTransmitterEmpty will not be called unless the beacon is stopped by either calling clear() or transmit()

◆ clear()

void com.lisnr.radius.Transmitter.clear ( ) throws TransmitterNotRegisteredException
inline

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

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

◆ getMaxPayloadSizeBytes()

int com.lisnr.radius.Transmitter.getMaxPayloadSizeBytes ( )
inline

Returns the max payload size (in bytes) for a Tone for the Transmitter. This is determined by the Transmitter's profile.

Returns
max payload size in bytes

◆ getProfile()

String com.lisnr.radius.Transmitter.getProfile ( )
inline

Get the profile of the Transmitter.

Returns
profile name

◆ isEmpty()

boolean com.lisnr.radius.Transmitter.isEmpty ( ) throws TransmitterNotRegisteredException
inline

Determine if the Transmitter has any Tone objects queued.

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

◆ transmit() [1/2]

void com.lisnr.radius.Transmitter.transmit ( ArrayList< Tone tones) throws InvalidTonePayloadException, TransmitterNotRegisteredException
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 Transmitter (based on Transmitter profile)
com.lisnr.radius.exceptions.TransmitterNotRegisteredExceptionif the Transmitter 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 Transmitter 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.Transmitter.transmit ( Tone  tone) throws InvalidTonePayloadException, TransmitterNotRegisteredException
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.TransmitterNotRegisteredExceptionif the Transmitter has not been registered with a valid Radius object
NullPointerExceptionif a null Tone object is provided
Note
If the Transmitter 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()
TransmitterCallback.onTransmitComplete will be called upon every successful transmission of a beacon tone

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