T
- 設定値クラスpublic abstract class DigitalSensorBase<T extends DigitalSensorConfig> extends PiSensorBase<T>
修飾子とタイプ | フィールドと説明 |
---|---|
static java.lang.String |
PIN_PULL_DOWN
ピン抵抗:プルダウン
|
static java.lang.String |
PIN_PULL_OFF
ピン抵抗:なし
|
static java.lang.String |
PIN_PULL_UP
ピン抵抗:プルアップ
|
コンストラクタと説明 |
---|
DigitalSensorBase(java.lang.String id,
T config)
コンストラクタです。
|
修飾子とタイプ | メソッドと説明 |
---|---|
Pin |
getSenseInputPin()
センサ入力ピンを取得します。
|
protected abstract void |
onSensePinStateChanged(boolean state)
センサ入力ピンの状態が変化したときに起動されるハンドラメソッドです。
|
protected void |
onStart()
起動時の追加処理を実装するメソッドです。
|
protected void |
onStop()
停止時の追加処理を実装するメソッドです。
|
onInit, setValue
getCcmService, init, start
addListener, getConfig, getDevice, getId, getListeners, getValue, notifyException, notifyStarted, notifyStopped, notifyUpdated, removeListener, setDevice, stop
public static final java.lang.String PIN_PULL_UP
public static final java.lang.String PIN_PULL_DOWN
public static final java.lang.String PIN_PULL_OFF
public DigitalSensorBase(java.lang.String id, T config)
id
- コンポーネントIDconfig
- 設定値public Pin getSenseInputPin()
protected void onStart() throws java.lang.Exception
AbstractComponent
onStart
クラス内 AbstractComponent<T extends DigitalSensorConfig>
java.lang.Exception
- 処理に失敗するとスローされます。protected void onStop() throws java.lang.Exception
AbstractComponent
onStop
クラス内 AbstractComponent<T extends DigitalSensorConfig>
java.lang.Exception
- 処理に失敗するとスローされます。protected abstract void onSensePinStateChanged(boolean state) throws java.lang.Exception
state
- HIGHに変化した場合はtrue, LOWの場合はfalsejava.lang.Exception
- 処理に失敗するとスローされます。