API version 15
iOSAndroidWindows
説明 |
指定したキャラクタリスティック(≒プロパティ)の変化のイベント受け取りを開始します。 キャラクタリスティックの種別がNotify、Indicateの場合に対応しています。
指定したキャラクタリスティックが変化すると、CharacteristicChangedイベントが発生します。
|
|
呼出形式 |
peripheral.StartNotify( serviceUuid , characteristicUuid )
|
|
戻り値 |
なし
|
|
引数 |
String serviceUuid |
サービスを識別するUUID
|
|
String characteristicUuid |
キャラクタリスティックを識別するUUID
|
例外 |
FUNC-4 |
引数の値が不正です。 |
|
RTM-124 |
デバイスに接続されていません |
|
RTM-83 |
Bluetoothが有効になっていません。 |
|
RTM-73 |
書き込み操作を完了できませんでした |
|
RTM-78 |
Bluetoothデバイスとの通信がタイムアウトしました。 |
|
RTM-79 |
不明なサービスIDです。 |
|
RTM-80 |
不明なキャラクタリスティックIDです。 |
使用例 |
BluetoothPeripheral peripheral { Function onCharacteristicChanged(e) { /*イベント処理*/ } } Button btnBleConnect { X = 16; Y = 576; Width = 104; Height = 40; Title = "BLE 接続"; Function OnTouch( e ) { //.peripheral.Connect(deviceId); } } Button btnBleStartNotifyBatteryService { X = 128; Y = 624; Width = 104; Height = 40; Title = "BLE Start"; Function OnTouch( e ) { var serviceUUID = "00000000-1111-2222-3333-4444-555555555555"; var characteristicUUID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"; var data = //.peripheral.StartNotify(serviceUUID, characteristicUUID); } } Button btnBleStopNotifyBatteryService { X = 240; Y = 624; Width = 104; Height = 40; Title = "BLE Stop"; Function OnTouch( e ) { var serviceUUID = "00000000-1111-2222-3333-4444-555555555555"; var characteristicUUID = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"; //.peripheral.StopNotify(serviceUUID, characteristicUUID); } }
|
|
関連項目 |
StopNotifyメソッド、CharacteristicChangedイベント |