public interface ModListener
The Moto Mod SDK enables an application to register a ModListner callback function which will be notified of changes over the Moto Mod. An application can register this callback this via the ModManager.registerModListener() API.
The callback will be called :
Modifier and Type | Method and Description |
---|---|
void |
onCapabilityChanged(ModDevice device)
The onCapabilityChanged(ModDevice) function will be called when the
capability of the Moto Mod has changed.
|
void |
onConnectionStatusChanged(ModDevice device,
ModConnection conn)
The onConnectionStatusChanged() function of the registered ModListener
callback will be called when the connection status of a ModDevice
changes.
|
void |
onDeviceHotplug(ModDevice device,
boolean plug)
The onDeviceHotplug() of the registered ModListener callback will be
called when a Moto Mod is attached or detached from the Core.
|
void |
onEnumerationDone(ModDevice device)
The onEnumerationDone(ModDevice) function of the registered callback will
be called when a Moto Mod device has completed its the initialization and
the core has enumerated all the modules in that device.
|
void |
onEnumerationDone(ModDevice device,
ModDevice.Interface iface,
boolean status)
The onEnumerationDone(ModDevice, interface, state) function of the
registered callback will be called when an interface within a Moto Mod
has completed its the initialization.
|
void |
onInterfaceUpDown(ModDevice device,
ModDevice.Interface iface,
boolean up)
The onInterfaceUpDown() function of the registered ModListener callback
will be called when an interface corresponding to a protocol is brought
up or torn down.
|
void |
onLinuxDeviceChanged(ModDevice mod,
ModInterfaceDelegation device,
boolean add)
The onLinuxDeviceChanged() function of the registered ModListener
callback will be called when a linux device node corresponding to a Moto
Mod protocol interface is being created and removed.
|
void onDeviceHotplug(ModDevice device, boolean plug)
device
- the device of the moduleplug
- true - plugged, false - unpluggedvoid onInterfaceUpDown(ModDevice device, ModDevice.Interface iface, boolean up)
device
- the device that the interface is associated withiface
- the interface being brought up/downup
- true - interface is up, false - interface is downvoid onConnectionStatusChanged(ModDevice device, ModConnection conn)
device
- the device that the connection is associated withconn
- the MODConnection instance with the connection statusvoid onLinuxDeviceChanged(ModDevice mod, ModInterfaceDelegation device, boolean add)
mod
- the device that the linux device node is associated withdevice
- the Linux device delegationadd
- true - the device is being added, false - device removed.void onEnumerationDone(ModDevice device)
ModListener.onEnumerationDone(ModDevice, ModDevice.Interface, boolean)
will be
called, and the oneEnumerationDone() will not be called at all.
This should be used when a application needs confirmation that the attached Moto
Mod interfaces are reported as fully functional.device
- the Moto Mod devicevoid onEnumerationDone(ModDevice device, ModDevice.Interface iface, boolean status)
device
- The Moto Mod deviceiface
- The intefacestatus
- True - All the protocols within this interface have
setup their ModConnection
instances and the state
of them are ModConnection.State.ENABLED
.
False - Failedvoid onCapabilityChanged(ModDevice device)
Note: different from ModManager.ACTION_MOD_CAPABILITY_CHANGED
,
the listener will always get callback here, despite whether it's the
associated package of the Moto Mod or not.
(c) 2016 Motorola Mobility LLC. All Rights Reserved
MOTOROLA and the Stylized M Logo are registered trademarks of Motorola Trademark Holdings, LLC
Android, Google, Google Play, Nexus and other marks are trademarks of Google Inc.