getDeviceCapabilities method
Returns the capabilities of the device, meaning which connectivity modules and features are available
Implementation
Future<bool> getDeviceCapabilities() async {
if (!isInitialized) {
LogbotLogger().simple("getDeviceCapabilities()");
try {
DeviceConfiguration? response = await LogbotSetupApiManager.device
.getDeviceConfig(uuidToken: LogbotSetupEnv().deviceId);
capabilities = response!;
isInitialized = true;
return true;
} catch (e) {
LogbotLogger().error("getDeviceCapabilities()", e.toString());
/// Assumes worst case scenario and try to continue with
/// minimal capabilities.
capabilities = DeviceConfiguration(
accessPoint: false,
bluetooth: false,
geolocator: false,
lan: true,
modem: false,
wan: true,
wifi: false,
);
return false;
}
}
return true;
}