API version 15
iOSAndroidWindows
|
説明 |
Bluetoothデバイスのスキャンをキャンセルします。 スキャンがキャンセルされるとBluetoothScanFinishedイベントが発生します。
|
|
|
呼出形式 |
Runtime.CancelBluetoothScanning()
|
|
|
戻り値 |
なし
|
|
|
引数 |
なし
|
|
|
例外 |
なし |
|
|
使用例 |
Form form1 {
Width = 424;
Height = 320;
Button btnStartScanning {
X = 16;
Y = 16;
Width = 120;
Height = 40;
Title = "デバイススキャン開始";
Function OnTouch( e ) {
try {
/* Bluetooth LEデバイスのスキャン開始 */
var params = new Array();
params["CONNECTABLE_DEVICE_ONLY"] = true;
Runtime.StartBluetoothScanning(Runtime.BLUETOOTH_LE, params);
} catch(e) {
MessageBox(e.Message);
}
}
}
Button btnStopScanning {
X = 184;
Y = 16;
Width = 120;
Height = 40;
Title = "デバイススキャン停止";
Function OnTouch( e ) {
Runtime.CancelBluetoothScanning();
}
}
}
Function OnBluetoothScanStarted(e) {
print("スキャン開始\n");
}
Function OnBluetoothScanFinished(e) {
print("スキャン終了\n");
}
Function OnBluetoothDeviceFound(e) {
print(e.DeviceID + "\n");
}
|
|
|
関連項目 |
||