Ruggero1912 / TrainerApp

Trainer-side app of TrainAround
https://paciosoft.com/projects/trainaround
1 stars 0 forks source link

Filter the connected devices that are recognised as athletes, at the moment every device connected to the GATT server is an athlete #6

Closed Ruggero1912 closed 2 years ago

Ruggero1912 commented 2 years ago

Find a way in the onConnectionStateChange method of the GATT server in the if block (newState == BluetoothProfile.STATE_CONNECTED) to filter the connected devices that are not athletes' devices.

BluetoothDevice CONNECTED: DE:0F:D8:A2:F1:F9 - device name: Mi Smart Band 5 - device alias: Mi Smart Band 5

image

Ruggero1912 commented 2 years ago

added a method isInitialized as it is stated in https://github.com/Ruggero1912/TrainerApp/issues/9 using this method it is possible to filter the connected devices according to some logic.

Ruggero1912 commented 2 years ago

now the athletes manager broadcasts infos only about athlete whose method isInitialized returns true