Flutter_blue: Connect to a BluetoothDevice without Scan or Checking the list of ConnectedDevices

Created on 20 Apr 2021  路  2Comments  路  Source: pauldemarco/flutter_blue

I am not able to create a Bluetooth Device object to create a direct connection with this device, without needing the startScan method and reading its result. Any suggestion?

All 2 comments

i am also interested in this

From what I researched here on issues, @pauldemarco believes that it is not recommended to make this type of direct connection, but here it worked, even though this code was extremely ugly:

import 'package:flutter_blue/gen/flutterblue.pb.dart' as proto;

proto.BluetoothDevice p = proto.BluetoothDevice.create();
p.name = name;
p.type = proto.BluetoothDevice_Type.LE;
p.remoteId = bleno;

return BluetoothDevice.fromProto(p);
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fleximex picture Fleximex  路  3Comments

ssaylanc picture ssaylanc  路  4Comments

adamk22 picture adamk22  路  5Comments

pauldemarco picture pauldemarco  路  3Comments

FWeissenb picture FWeissenb  路  5Comments