public class PWMManager
extends java.lang.Object
This manager allows applications to create PWM
objects.
Unless noted, all PWM API methods require the
com.digi.android.permission.PWM
permission. If your application does
not have this permission it will not have access to any PWM manager feature.
PWM
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
ERROR_CHANNEL_NUMBER |
|
static java.lang.String |
ERROR_CHIP_NULL |
|
static java.lang.String |
ERROR_REMOTE_EXCEPTION |
Constructor | Description |
---|---|
PWMManager(android.content.Context context) |
Class constructor.
|
Modifier and Type | Method | Description |
---|---|---|
PWM |
createPWM(int channel) |
Deprecated.
This method is no longer acceptable to create a PWM object.
Use |
PWM |
createPWM(PWMChip chip,
int channel) |
Creates and returns a
PWM object with the given pair of chip and channel. |
int[] |
listChannels() |
Deprecated.
This method is no longer acceptable to list PWM channels.
Use |
java.util.List<PWMChip> |
listPWMChips() |
Lists all available PWM chips in the device.
|
public static final java.lang.String ERROR_CHIP_NULL
public static final java.lang.String ERROR_CHANNEL_NUMBER
public static final java.lang.String ERROR_REMOTE_EXCEPTION
public PWMManager(android.content.Context context)
Instantiates a new PWMManager
for the given application.
context
- Context of the application.@Deprecated public PWM createPWM(int channel) throws PWMException
Use createPWM(int, int)
instead.
PWM
object with the given channel.channel
- PWM channel index.java.lang.IllegalArgumentException
- If channel < 0
.PWMException
- If the provided PWM channel is not available.listChannels()
,
PWM
public PWM createPWM(PWMChip chip, int channel) throws PWMException
PWM
object with the given pair of chip and channel.chip
- PWM chip that holds the PWM channel.channel
- PWM channel index.java.lang.NullPointerException
- if chip == null
java.lang.IllegalArgumentException
- if channel < 0
.PWMException
- If the provided pair of chip and channel is not available or
if there is any error creating the PWM channel.listPWMChips()
,
PWMChip.listChannels()
,
PWMChip
,
PWM
@Deprecated public int[] listChannels()
Use listPWMChips()
and {@link PWMChip.listChannels()} instead.
public java.util.List<PWMChip> listPWMChips()
PWMChip
,
PWMChip.listChannels()