mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-12 02:45:49 +01:00
AsteroidOS: Add simple device discovery
This is done by just comparing the names with already existing devices. This is only a temporary solution until the discovery of the service UUID works properly
This commit is contained in:
parent
d3d4baedea
commit
616ec53086
@ -3,6 +3,18 @@ package nodomain.freeyourgadget.gadgetbridge.devices.asteroidos;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class AsteroidOSConstants {
|
public class AsteroidOSConstants {
|
||||||
|
|
||||||
|
// A list of all the supported devices and their codenames
|
||||||
|
public static final String[] SUPPORTED_DEVICE_CODENAMES = {
|
||||||
|
"bass", "sturgeon", "catfish", "catfish_ext",
|
||||||
|
"catshark", "lenok", "smelt", "carp",
|
||||||
|
"sparrow", "wren", "anthias", "beluga",
|
||||||
|
"dory", "firefish", "harmony", "inharmony",
|
||||||
|
"narwhal", "ray", "sawfish", "sawshark",
|
||||||
|
"skipjack", "tunny", "mooneye", "swift",
|
||||||
|
"minnow", "sprat", "tetra"
|
||||||
|
};
|
||||||
|
|
||||||
// AsteroidOS Service Watch Filter UUID
|
// AsteroidOS Service Watch Filter UUID
|
||||||
public static final UUID SERVICE_UUID = UUID.fromString("00000000-0000-0000-0000-00A57E401D05");
|
public static final UUID SERVICE_UUID = UUID.fromString("00000000-0000-0000-0000-00A57E401D05");
|
||||||
|
|
||||||
|
@ -73,6 +73,11 @@ public class AsteroidOSDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
if (candidate.supportsService(AsteroidOSConstants.SERVICE_UUID)) {
|
if (candidate.supportsService(AsteroidOSConstants.SERVICE_UUID)) {
|
||||||
return DeviceType.ASTEROIDOS;
|
return DeviceType.ASTEROIDOS;
|
||||||
}
|
}
|
||||||
|
for (String name : AsteroidOSConstants.SUPPORTED_DEVICE_CODENAMES) {
|
||||||
|
if (candidate.getName().equals(name)) {
|
||||||
|
return DeviceType.ASTEROIDOS;
|
||||||
|
}
|
||||||
|
}
|
||||||
return DeviceType.UNKNOWN;
|
return DeviceType.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user