Skip to content

Commit

Permalink
Show model icon for pairable device and include tintin in LE scan fil…
Browse files Browse the repository at this point in the history
…tering
  • Loading branch information
crc-32 committed Sep 18, 2020
1 parent 7274350 commit e58b717
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class BlueCommon(private val context: Context, private val packetCallback: (Byte
private val leScanCallback: ScanCallback = object : ScanCallback() {
override fun onScanResult(callbackType: Int, result: ScanResult) {
super.onScanResult(callbackType, result)
if (result.device.name != null && result.device.type == BluetoothDevice.DEVICE_TYPE_LE && result.device.name.startsWith("Pebble ")) {
if (result.device.name != null && result.device.type == BluetoothDevice.DEVICE_TYPE_LE && (result.device.name.startsWith("Pebble ") || result.device.name.startsWith("Pebble-LE"))) {
resultCallback?.invoke(BluePebbleDevice(result))
}
}
Expand All @@ -92,7 +92,7 @@ class BlueCommon(private val context: Context, private val packetCallback: (Byte
private val legacyLeScanCallback = object : BluetoothAdapter.LeScanCallback {
override fun onLeScan(device: BluetoothDevice?, rssi: Int, scanRecord: ByteArray?) {
if (device != null && device.type == BluetoothDevice.DEVICE_TYPE_LE && scanRecord != null) {
if (device.name != null && device.name.startsWith("Pebble ")) {
if (device.name != null && (device.name.startsWith("Pebble ") || device.name.startsWith("Pebble-LE"))) {
resultCallback?.invoke(BluePebbleDevice(device, scanRecord))
}
}
Expand Down
3 changes: 1 addition & 2 deletions lib/ui/setup/PairPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ class _PairPageState extends State<PairPage> {
child: Row(children: <Widget>[
Container(
child: Center(
child: PebbleWatchIcon(PebbleWatchModel
.time_round_rose_gold_14)),
child: PebbleWatchIcon(PebbleWatchModel.values[e.color])),
width: 56,
height: 56,
decoration: BoxDecoration(
Expand Down

0 comments on commit e58b717

Please sign in to comment.