System.Bluetooth.Components.TBluetoothLE.BeginReliableWrite
Delphi
function BeginReliableWrite(const ADevice: TBluetoothLEDevice): Boolean;
C++
bool __fastcall BeginReliableWrite(System::Bluetooth::TBluetoothLEDevice* const ADevice);
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.Bluetooth.Components.pas System.Bluetooth.Components.hpp |
System.Bluetooth.Components | TBluetoothLE |
説明
一連のキャラクタリスティックを指定されたリモート デバイスにアトミック トランザクションとして書き込むために、トランザクションを開始します。
一連のキャラクタリスティックをリモート デバイスにアトミック トランザクションとして書き込むには:
- 編集するキャラクタリスティックごとに、そのキャラクタリスティックのディスクリプタに ExtendedProperties という種類のディスクリプタが必ず含まれ、かつ、そのディスクリプタの ReliableWrite プロパティが必ず
True
になる(信頼できる書き込み操作がキャラクタリスティックでサポートされている)ようにします。 - BeginReliableWrite を呼び出して、トランザクションを開始します。
- WriteCharacteristic を必要な回数だけ呼び出します。 リモート デバイスではキャラクタリスティックを書き込みません。送信された値が正しいことを確認し、アトミックに実行できるように変更をキューに追加するだけです。 ただし、リモート デバイスでは OnCharacteristicWrite が発生します。このイベントを処理して、リモート デバイスがこちらから受け取った新しい値が正しいことを確認します。
- WriteCharacteristic の呼び出しがすべて終わったら、以下のいずれかを行います。
- ExecuteReliableWrite を呼び出して、アトミック トランザクションを実行します。
- AbortReliableWrite を呼び出して、トランザクションを中止します(たとえば、予期しないデータを OnCharacteristicWrite のハンドラで受け取った場合など)。
BeginReliableWrite は TBluetoothLEDevice.BeginReliableWrite を呼び出します。
プラットフォーム サポート
プラットフォーム | サポート対象 |
---|---|
Windows |
|
OS X |
|
iOS |
|
Android |
|
関連項目
- System.Bluetooth.TBluetoothGattDescriptor.ReliableWrite
- System.Bluetooth.Components.TBluetoothLE.WriteCharacteristic
- System.Bluetooth.Components.TBluetoothLE.OnCharacteristicWrite
- System.Bluetooth.Components.TBluetoothLE.ExecuteReliableWrite
- System.Bluetooth.Components.TBluetoothLE.AbortReliableWrite