SmartphoneDeviceManager
The device manager for this phone, the primary device.
Always connectable. Supports the data types of all registered SmartphoneSamplingPackages, and reports the phone's battery level.
- Inheritance
-
- Object
- DeviceManager<
Smartphone, SmartphoneRegistration> - HardwareDeviceManager<
Smartphone, SmartphoneRegistration> - SmartphoneDeviceManager
Constructors
SmartphoneDeviceManager
- Smartphone? configuration
Properties
batteryEvents
The battery level (0-100) of this hardware device, each time it changes.
Empty by default.
batteryLevel
The runtime battery level of this hardware device in percent (0-100). Returns null if unknown.
canConnect
Determines whether a connection can be made at this point in time to the device.
displayName
A human-readable name for this device, or null if unknown.
supportedDataTypes
The set of data types defining which data can be collected on this device.
Methods
createRegistration
Creates a registration of this device for the deployment.
This method is used when a device is connected and a registration for this device is needed in the deployment and hence in the deployment service. The registration is typically created from the device information of the real device, e.g., the ID, name, and BLE address of the smartphone or a connected Bluetooth device.
onConfigure
Callback on configure.
When called, the configuration and the registration is available.
Is to be overridden in sub-classes. Note, however, that it must not be doing a lot of work on startup.
onConnect
Callback on connect. Returns the DeviceStatus of the device.
Can be overridden for device-specific connection handling.
onDisconnect
Callback on disconnect.
This method is called after all sampling on this device has been stopped, and the device manager is trying to disconnect from the real device.
Is to be overridden in sub-classes and implement device-specific disconnection.
onRequestPermissions
Callback on requestPermissions.
Can be overridden for device-specific permission handling.