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

Class used to manage instances of Transmitter and Receiver objects.. More...

Inheritance diagram for com.lisnr.radius.Radius:

Classes

interface  ErrorEventCallback
 Callback interface that contains callbacks for additional error events. More...
 

Public Member Functions

 Radius (Context context, String sdkToken, StreamBuilder outputStreamParameters, StreamBuilder inputStreamParameters, ErrorEventCallback errorEventCallback) throws InvalidTokenException, AuthorizationDeniedException, AudioSystemException
 
 Radius (Context context, String sdkToken, ErrorEventCallback errorEventCallback) throws InvalidTokenException, AuthorizationDeniedException, AudioSystemException
 
 Radius (Lifecycle lifecycle, Context context, String sdkToken, StreamBuilder outputStreamParameters, StreamBuilder inputStreamParameters, ErrorEventCallback errorEventCallback) throws InvalidTokenException, AuthorizationDeniedException, AudioSystemException
 
 Radius (Lifecycle lifecycle, Context context, String sdkToken, ErrorEventCallback errorEventCallback) throws InvalidTokenException, AuthorizationDeniedException, AudioSystemException
 
void updateStreamBuilder (StreamBuilder.Direction direction, StreamBuilder streamBuilder)
 
void registerTransmitter (Transmitter transmitter) throws InvalidArgumentException, RadiusDestroyedException
 
void registerReceiver (Receiver receiver) throws InvalidArgumentException, RadiusDestroyedException
 
void registerTransceiver (Transceiver transceiver) throws InvalidArgumentException, RadiusDestroyedException
 
void unregisterTransmitter (Transmitter transmitter) throws InvalidArgumentException, RadiusDestroyedException
 
void unregisterReceiver (Receiver receiver) throws InvalidArgumentException, RadiusDestroyedException
 
void unregisterTransceiver (Transceiver transceiver) throws InvalidArgumentException, RadiusDestroyedException
 
void unregisterAll () throws RadiusDestroyedException
 
void setTransmissionVolume (int volumeLevel) throws InvalidArgumentException, RadiusDestroyedException
 
void shutdown ()
 
void setLoggingLevels (boolean enableTrace, boolean enableFatal, boolean enableError, boolean enableWarning, boolean enableInfo, boolean enableDebug, boolean enableVerbose, int verboseLevel) throws RadiusDestroyedException
 

Static Public Member Functions

static String getVersion ()
 
static void validateToken (String sdkToken) throws InvalidTokenException
 
static String getTokenExpiration (String sdkToken) throws InvalidTokenException
 

Static Public Attributes

static final String PROFILE_STANDARD2 = "standard2"
 
static final String PROFILE_STANDARD2_WIDEBAND = "standard2_wideband"
 
static final String PROFILE_PKAB2 = "pkab2"
 
static final String PROFILE_PKAB2_WIDEBAND = "pkab2_wideband"
 

Detailed Description

Class used to manage instances of Transmitter and Receiver objects..

Constructor & Destructor Documentation

◆ Radius() [1/4]

com.lisnr.radius.Radius.Radius ( Context  context,
String  sdkToken,
StreamBuilder  outputStreamParameters,
StreamBuilder  inputStreamParameters,
ErrorEventCallback  errorEventCallback 
) throws InvalidTokenException, AuthorizationDeniedException, AudioSystemException
inline

Constructor for the Radius object. Use this constructor to use the specified audio stream (com.lisnr.radius.StreamBuilder) settings for input and output (see Audio System Configuration).

Parameters
contextContext for the Radius object (must be non-null)
sdkTokenLISNR SDK token from the developer portal (https://portal.lisnr.com) (must be non-null)
outputStreamParametersOutput com.lisnr.radius.StreamBuilder for configuring audio output behavior (must be non-null)
inputStreamParametersInput com.lisnr.radius.StreamBuilder for configuring audio input behavior (must be non-null)
errorEventCallbackThe implemented ErrorEventCallback interface that will be invoked by this Radius object if an internal error occurs (must be non-null)
Exceptions
com.lisnr.radius.exceptions.InvalidTokenExceptionif the provided token is invalid
com.lisnr.radius.exceptions.AuthorizationDeniedExceptionif the provided token is not authorized for Radius
com.lisnr.radius.exceptions.AudioSystemExceptionif there is an audio system error
NullPointerExceptionif any of the provided arguments are null
Note
Use this constructor if it is desired to NOT have the Radius object's usability/lifecycle tied directly to an Android Lifecycle object
It is recommended that the Radius class be initialized at application startup so that it is ready for use when needed.

◆ Radius() [2/4]

com.lisnr.radius.Radius.Radius ( Context  context,
String  sdkToken,
ErrorEventCallback  errorEventCallback 
) throws InvalidTokenException, AuthorizationDeniedException, AudioSystemException
inline

Constructor for the Radius object. Use this constructor to use the default audio stream (com.lisnr.radius.StreamBuilder) settings for input and output (see Audio System Configuration).

Parameters
contextContext for the Radius object (must be non-null)
sdkTokenLISNR SDK token from the developer portal (https://portal.lisnr.com) (must be non-null)
errorEventCallbackThe implemented ErrorEventCallback interface that will be invoked by this Radius object if an internal error occurs (must be non-null)
Exceptions
com.lisnr.radius.exceptions.InvalidTokenExceptionif the provided token is invalid
com.lisnr.radius.exceptions.AuthorizationDeniedExceptionif the provided token is not authorized for Radius
com.lisnr.radius.exceptions.AudioSystemExceptionif there is an audio system error
NullPointerExceptionif any of the provided arguments are null
Note
Use this constructor if it is desired to NOT have the Radius object's usability/lifecycle tied directly to an Android Lifecycle object
It is recommended that the Radius class be initialized at application startup so that it is ready for use when needed.

◆ Radius() [3/4]

com.lisnr.radius.Radius.Radius ( Lifecycle  lifecycle,
Context  context,
String  sdkToken,
StreamBuilder  outputStreamParameters,
StreamBuilder  inputStreamParameters,
ErrorEventCallback  errorEventCallback 
) throws InvalidTokenException, AuthorizationDeniedException, AudioSystemException
inline

Constructor for the Radius object. Use this constructor to use the specified audio stream (com.lisnr.radius.StreamBuilder) settings for input and output (see Audio System Configuration).

Parameters
lifecycleThe Android Lifecycle Radius will monitor in order to shutdown when an ON_STOP event occurs, like a screen turning off (must be non-null)
contextContext for the Radius object (must be non-null)
sdkTokenLISNR SDK token from the developer portal (https://portal.lisnr.com) (must be non-null)
outputStreamParametersOutput com.lisnr.radius.StreamBuilder for configuring audio output behavior (must be non-null)
inputStreamParametersInput com.lisnr.radius.StreamBuilder for configuring audio input behavior (must be non-null)
errorEventCallbackThe implemented ErrorEventCallback interface that will be invoked by this Radius object if an internal error occurs (must be non-null)
Exceptions
com.lisnr.radius.exceptions.InvalidTokenExceptionif the provided token is invalid
com.lisnr.radius.exceptions.AuthorizationDeniedExceptionif the provided token is not authorized for Radius
com.lisnr.radius.exceptions.AudioSystemExceptionif there is an audio system error
NullPointerExceptionif any of the provided arguments are null
Note
Use this constructor if it is desired to have the Radius object's usability/lifecycle tied directly to an Android Lifecycle object
Whenever an ON_STOP event occurs in the provided lifecycle, the Radius object will be rendered unusable and a new object will need to be created.
It is recommended that the Radius class be initialized at application startup so that it is ready for use when needed.

◆ Radius() [4/4]

com.lisnr.radius.Radius.Radius ( Lifecycle  lifecycle,
Context  context,
String  sdkToken,
ErrorEventCallback  errorEventCallback 
) throws InvalidTokenException, AuthorizationDeniedException, AudioSystemException
inline

Constructor for the Radius object. Use this constructor to use the default audio stream (com.lisnr.radius.StreamBuilder) settings for input and output (see Audio System Configuration).

Parameters
lifecycleThe Android Lifecycle Radius will monitor in order to shutdown on certain events, like a screen turning off (must be non-null)
contextContext for the Radius object (must be non-null)
sdkTokenLISNR SDK token from the developer portal (https://portal.lisnr.com) (must be non-null)
errorEventCallbackThe implemented ErrorEventCallback interface that will be invoked by this Radius object if an internal error occurs (must be non-null)
Exceptions
com.lisnr.radius.exceptions.InvalidTokenExceptionif the provided token is invalid
com.lisnr.radius.exceptions.AuthorizationDeniedExceptionif the provided token is not authorized for Radius
com.lisnr.radius.exceptions.AudioSystemExceptionif there is an audio system error
NullPointerExceptionif any of the provided arguments are null
Note
Use this constructor if it is desired to have the Radius object's usability/lifecycle tied directly to an Android Lifecycle object
It is recommended that the Radius class be initialized at application startup so that it is ready for use when needed.

Member Function Documentation

◆ getTokenExpiration()

static String com.lisnr.radius.Radius.getTokenExpiration ( String  sdkToken) throws InvalidTokenException
inlinestatic

Returns a well-formatted expiration date for the token in format MM/dd/YYYY @params sdkToken The token to parse for expiration date

Returns
well-formatted expiration date
Exceptions
com.lisnr.point.exceptions.InvalidTokenExceptionif the token is not formatted properly

◆ getVersion()

static String com.lisnr.radius.Radius.getVersion ( )
inlinestatic

Get the version of the SDK

Returns
version number

◆ registerReceiver()

void com.lisnr.radius.Radius.registerReceiver ( Receiver  receiver) throws InvalidArgumentException, RadiusDestroyedException
inline

Register a Receiver object. This must be done prior to the Receiver object being used.

Parameters
receiverA non-null Receiver object
Exceptions
com.lisnr.radius.exceptions.InvalidArgumentExceptionif an invalid Receiver object is provided OR if there is already a Receiver registered with the same profile as that of the provided Receiver
com.lisnr.radius.exceptions.RadiusDestroyedExceptionif the Radius object is not usable due to an ON_STOP event
NullPointerExceptionif a null Receiver object is provided

◆ registerTransceiver()

void com.lisnr.radius.Radius.registerTransceiver ( Transceiver  transceiver) throws InvalidArgumentException, RadiusDestroyedException
inline

Register a Transceiver object. This must be done prior to the Transceiver object being used.

Parameters
transceiverA non-null Transceiver object
Note
Currently only one transceiver may be registered at a time
When a transceiver is registered, if any receivers or transmitters are registered they will be forcibly unregistered. This is to prevent collisions between transmissions.
Exceptions
com.lisnr.radius.exceptions.InvalidArgumentExceptionif an invalid Transceiver object is provided OR if there is already a Transceiver registered with the same profile as that of the provided Receiver
com.lisnr.radius.exceptions.RadiusDestroyedExceptionif the Radius object is not usable due to an ON_STOP event
NullPointerExceptionif a null Transceiver object is provided

◆ registerTransmitter()

void com.lisnr.radius.Radius.registerTransmitter ( Transmitter  transmitter) throws InvalidArgumentException, RadiusDestroyedException
inline

Register a Transmitter object. This must be done prior to the Transmitter object being used.

Parameters
transmitterA non-null Transmitter object
Exceptions
com.lisnr.radius.exceptions.InvalidArgumentExceptionif an invalid Transmitter object is provided OR if there is already a Transmitter registered with the same profile as that of the provided Transmitter
com.lisnr.radius.exceptions.RadiusDestroyedExceptionif the Radius object is not usable due to an ON_STOP event
NullPointerExceptionif a null Transmitter object is provided

◆ setLoggingLevels()

void com.lisnr.radius.Radius.setLoggingLevels ( boolean  enableTrace,
boolean  enableFatal,
boolean  enableError,
boolean  enableWarning,
boolean  enableInfo,
boolean  enableDebug,
boolean  enableVerbose,
int  verboseLevel 
) throws RadiusDestroyedException
inline

Sets the active logging levels to the provided values

Parameters
enableTracetrue to enable TRACE level
enableFataltrue to enable FATAL level
enableErrortrue to enable ERROR level
enableWarningtrue to enable WARNING level
enableInfotrue to enable INFO level
enableDebugtrue to enable DEBUG level
enableVerbosetrue to enable VERBOSE levels
verboseLevellevel of verbosity, 1-9 are valid (anything lower than 1 will set to 1, higher than 9 will set to 9)

◆ setTransmissionVolume()

void com.lisnr.radius.Radius.setTransmissionVolume ( int  volumeLevel) throws InvalidArgumentException, RadiusDestroyedException
inline

Set volume of all transmissions using this Radius object.

Parameters
volumeLevelThe percentage of volume to transmit
Exceptions
InvalidArgumentExceptionif a volumeLevel below 0 or above 100 is provided
com.lisnr.radius.exceptions.RadiusDestroyedExceptionif the Radius object is not usable due to an ON_STOP event
Note
Volume will be changed at the time of the first broadcast and will be reset when unregisterReceiver or unregisterAll is called.

◆ shutdown()

void com.lisnr.radius.Radius.shutdown ( )
inline

Shuts down the Radius object, rendering it unusable and allows for a new Radius object to be created

◆ unregisterAll()

void com.lisnr.radius.Radius.unregisterAll ( ) throws RadiusDestroyedException
inline

Unregisters all currently registered Transmitter and Receiver objects. This will also cancel & remove any Tone objects that are set to transmit but have not yet been transmitted.

Exceptions
com.lisnr.radius.exceptions.RadiusDestroyedExceptionif the Radius object is not usable due to an ON_STOP event
Note
This will interrupt and cancel an actively transmitting Tone.

◆ unregisterReceiver()

void com.lisnr.radius.Radius.unregisterReceiver ( Receiver  receiver) throws InvalidArgumentException, RadiusDestroyedException
inline

Unregister a Receiver object. This will cause the Receiver object to no longer function.

Parameters
receiverA non-null Receiver object
Exceptions
NullPointerExceptionif a null Receiver object is provided

◆ unregisterTransceiver()

void com.lisnr.radius.Radius.unregisterTransceiver ( Transceiver  transceiver) throws InvalidArgumentException, RadiusDestroyedException
inline

Unregister a Transceiver object. This will cause the Transceiver object to no longer function. All Tone objects set to be transmitted by this Transceiver will be cancelled and removed.

Parameters
transceiverA non-null Transceiver object
Exceptions
com.lisnr.radius.exceptions.RadiusDestroyedExceptionif the Radius object is not usable due to an ON_STOP event
NullPointerExceptionif a null Transceiver object is provided
Note
This will interrupt and cancel the active transmission of a Tone by this Transceiver.

◆ unregisterTransmitter()

void com.lisnr.radius.Radius.unregisterTransmitter ( Transmitter  transmitter) throws InvalidArgumentException, RadiusDestroyedException
inline

Unregister a Transmitter object. This will cause the Transmitter object to no longer function. All Tone objects set to be transmitted by this Transmitter will be cancelled and removed.

Parameters
transmitterA non-null Transmitter object
Exceptions
com.lisnr.radius.exceptions.RadiusDestroyedExceptionif the Radius object is not usable due to an ON_STOP event
NullPointerExceptionif a null Transmitter object is provided
Note
This will interrupt and cancel the active transmission of a Tone by this Transmitter.

◆ updateStreamBuilder()

void com.lisnr.radius.Radius.updateStreamBuilder ( StreamBuilder.Direction  direction,
StreamBuilder  streamBuilder 
)
inline

Update the StreamBuilder settings for input or output

Parameters
directionStreamBuilder.Direction.INPUT or StreamBuilder.Direction.OUTPUT
streamBuilderThe new StreamBuilder settings to update to (must be non-null)

◆ validateToken()

static void com.lisnr.radius.Radius.validateToken ( String  sdkToken) throws InvalidTokenException
inlinestatic

Validates the provided SDK token

Parameters
sdkTokenThe token to be validated
Exceptions
com.lisnr.point.exceptions.InvalidTokenExceptionon failure

Member Data Documentation

◆ PROFILE_PKAB2

final String com.lisnr.radius.Radius.PROFILE_PKAB2 = "pkab2"
static

Profile string for the Precision KAB2 profile

◆ PROFILE_PKAB2_WIDEBAND

final String com.lisnr.radius.Radius.PROFILE_PKAB2_WIDEBAND = "pkab2_wideband"
static

Profile string for the wideband Precision KAB2 profile

◆ PROFILE_STANDARD2

final String com.lisnr.radius.Radius.PROFILE_STANDARD2 = "standard2"
static

Profile string for the Standard2 profile

◆ PROFILE_STANDARD2_WIDEBAND

final String com.lisnr.radius.Radius.PROFILE_STANDARD2_WIDEBAND = "standard2_wideband"
static

Profile string for the wideband Standard2 profile


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