Merge branch 'dev' of https://github.com/MilosKozak/AndroidAPS into dev
This commit is contained in:
commit
8db0dbd78d
2 changed files with 6 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
||||||
package info.nightscout.androidaps.events
|
package info.nightscout.androidaps.events
|
||||||
|
|
||||||
class EventBTChange constructor(val state: Change, val deviceName: String?) : Event() {
|
class EventBTChange(val state: Change, val deviceName: String?, val deviceAddress: String? = null) : Event() {
|
||||||
|
|
||||||
enum class Change {
|
enum class Change {
|
||||||
CONNECT,
|
CONNECT,
|
||||||
DISCONNECT
|
DISCONNECT
|
||||||
|
|
|
@ -17,9 +17,9 @@ class BTReceiver : DaggerBroadcastReceiver() {
|
||||||
|
|
||||||
when (intent.action) {
|
when (intent.action) {
|
||||||
BluetoothDevice.ACTION_ACL_CONNECTED ->
|
BluetoothDevice.ACTION_ACL_CONNECTED ->
|
||||||
rxBus.send(EventBTChange(EventBTChange.Change.CONNECT, device.name))
|
rxBus.send(EventBTChange(EventBTChange.Change.CONNECT, deviceName = device.name, deviceAddress = device.address))
|
||||||
BluetoothDevice.ACTION_ACL_DISCONNECTED ->
|
BluetoothDevice.ACTION_ACL_DISCONNECTED ->
|
||||||
rxBus.send(EventBTChange(EventBTChange.Change.DISCONNECT, device.name))
|
rxBus.send(EventBTChange(EventBTChange.Change.DISCONNECT, deviceName = device.name, deviceAddress = device.address))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue