com.iristick.smartglass.core
Class IristickConnection2¶
- java.lang.Object
-
- com.iristick.smartglass.core.IristickConnection2
- All Implemented Interfaces:
- IristickConnection
public abstract class IristickConnection2 extends Object implements IristickConnection
Advanced interface for receiving events from the Iristick Services.
This is an abstract class rather than an interface to provide default implementations for all methods.
- Since:
- 1.1
Field Summary¶
Fields inherited from interface com.iristick.smartglass.core.IristickConnection¶
ERROR_DEPRECATED_SDK, ERROR_FUTURE_SDK, ERROR_NOT_ALLOWED, ERROR_NOT_INSTALLED, ERROR_NOT_INSTALLED_ATTACHED, ERROR_NOT_INSTALLED_UNATTACHED, ERROR_UNKNOWN
Constructor Summary¶
Constructor and Description |
---|
IristickConnection2() |
Method Summary¶
Modifier and Type | Method and Description |
---|---|
void |
onGlobalStateChanged(int newState)
Called when the global state of the Iristick Services has changed.
|
void |
onHeadsetConnected(Headset headset)
Called when a connection to an Iristick headset has been established.
|
void |
onHeadsetDisconnected(Headset headset)
Called when the connection to an Iristick headset has been lost.
|
void |
onIristickServiceError(int error)
Called when the connection to an Iristick headset could not be established due to an error
with the Iristick service.
|
void |
onIristickServiceInitialized(IristickBinding binding)
Called when the connection to Iristick service is established.
|
void |
onPocketUnitConnected(PocketUnit pocketUnit)
Called when a connection to an Iristick pocket unit has been established.
|
void |
onPocketUnitDisconnected(PocketUnit pocketUnit)
Called when the connection to an Iristick pocket unit has been lost.
|
Methods inherited from class java.lang.Object¶
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail¶
IristickConnection2¶
public IristickConnection2()
Method Detail¶
onHeadsetConnected¶
public void onHeadsetConnected(@NonNull Headset headset)
Called when a connection to an Iristick headset has been established.
The default implementation does nothing.
- Specified by:
onHeadsetConnected
in interfaceIristickConnection
- Parameters:
headset
- The newly connected headset.
onHeadsetDisconnected¶
public void onHeadsetDisconnected(@NonNull Headset headset)
Called when the connection to an Iristick headset has been lost.
The default implementation does nothing.
- Specified by:
onHeadsetDisconnected
in interfaceIristickConnection
- Parameters:
headset
- The headset whose connection has been lost. This object should not be used anymore.
onIristickServiceInitialized¶
public void onIristickServiceInitialized(@NonNull IristickBinding binding)
Called when the connection to Iristick service is established.
This method is called after
onHeadsetConnected(Headset)
, if a headset was attached
before establishing connection to the service, and after
onPocketUnitConnected(PocketUnit)
, if a pocket unit was attached before establishing
connection the service.
The default implementation does nothing.
- Specified by:
onIristickServiceInitialized
in interfaceIristickConnection
- Parameters:
binding
- A binding object providing access to the Iristick Services.
onIristickServiceError¶
public void onIristickServiceError(int error)
Called when the connection to an Iristick headset could not be established due to an error
with the Iristick service.
The default implementation prints an error message to the logcat.
- Specified by:
onIristickServiceError
in interfaceIristickConnection
- Parameters:
error
- An error code explaining what went wrong.- See Also:
IristickConnection.ERROR_UNKNOWN
,IristickConnection.ERROR_NOT_INSTALLED_UNATTACHED
,IristickConnection.ERROR_NOT_ALLOWED
,IristickConnection.ERROR_FUTURE_SDK
,IristickConnection.ERROR_DEPRECATED_SDK
,IristickConnection.ERROR_NOT_INSTALLED_ATTACHED
onGlobalStateChanged¶
public void onGlobalStateChanged(int newState)
Called when the global state of the Iristick Services has changed.
- Parameters:
newState
- The new global state.- Since:
- 1.1
- See Also:
IristickBinding.getGlobalState()
onPocketUnitConnected¶
public void onPocketUnitConnected(@NonNull PocketUnit pocketUnit)
Called when a connection to an Iristick pocket unit has been established.
Most users will not need to override this method as pocket units are mostly transparent.
Override onHeadsetConnected(Headset)
to do useful work with Iristick smart glasses.
The default implementation does nothing.
- Parameters:
pocketUnit
- The newly connected pocket unit.- Since:
- 1.1
onPocketUnitDisconnected¶
public void onPocketUnitDisconnected(@NonNull PocketUnit pocketUnit)
Called when the connection to an Iristick pocket unit has been lost.
Most users will not need to override this method as pocket units are mostly transparent.
The default implementation does nothing.
- Parameters:
pocketUnit
- The pocket unit whose connection has been lost. This object should not be used anymore.- Since:
- 1.1