-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
128 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...tlin/edu/stanford/bdh/engagehf/bluetooth/spezi/configuration/DeviceDiscoveryDescriptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package edu.stanford.bdh.engagehf.bluetooth.spezi.configuration | ||
|
||
import edu.stanford.bdh.engagehf.bluetooth.spezi.model.BluetoothDevice | ||
import edu.stanford.bdh.engagehf.bluetooth.spezi.core.configuration.DiscoveryCriteria | ||
import edu.stanford.bdh.engagehf.bluetooth.spezi.model.BluetoothDevice | ||
import kotlin.reflect.KClass | ||
|
||
data class DeviceDiscoveryDescriptor( | ||
val discoveryCriteria: DiscoveryCriteria, | ||
val deviceType: KClass<BluetoothDevice>, | ||
) | ||
) |
4 changes: 2 additions & 2 deletions
4
app/src/main/kotlin/edu/stanford/bdh/engagehf/bluetooth/spezi/configuration/Discover.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package edu.stanford.bdh.engagehf.bluetooth.spezi.configuration | ||
|
||
import edu.stanford.bdh.engagehf.bluetooth.spezi.model.BluetoothDevice | ||
import edu.stanford.bdh.engagehf.bluetooth.spezi.core.configuration.DiscoveryCriteria | ||
import edu.stanford.bdh.engagehf.bluetooth.spezi.model.BluetoothDevice | ||
import kotlin.reflect.KClass | ||
|
||
data class Discover<Device: BluetoothDevice>( | ||
data class Discover<Device : BluetoothDevice>( | ||
val discoveryCriteria: DiscoveryCriteria, | ||
val deviceType: KClass<Device>, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
.../kotlin/edu/stanford/bdh/engagehf/bluetooth/spezi/core/configuration/DiscoveryCriteria.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package edu.stanford.bdh.engagehf.bluetooth.spezi.core.configuration | ||
|
||
import edu.stanford.bdh.engagehf.bluetooth.spezi.utils.BTUUID | ||
import edu.stanford.bdh.engagehf.bluetooth.spezi.core.model.ManufacturerIdentifier | ||
import edu.stanford.bdh.engagehf.bluetooth.spezi.utils.BTUUID | ||
|
||
sealed class DiscoveryCriteria { | ||
data class AdvertisedServices( | ||
val uuids: List<BTUUID> | ||
): DiscoveryCriteria() | ||
val uuids: List<BTUUID>, | ||
) : DiscoveryCriteria() | ||
|
||
data class Accessory( | ||
val manufacturer: ManufacturerIdentifier, | ||
val uuids: List<BTUUID> | ||
): DiscoveryCriteria() | ||
val uuids: List<BTUUID>, | ||
) : DiscoveryCriteria() | ||
|
||
val discoveryIds: List<BTUUID> get() = | ||
when (this) { | ||
is AdvertisedServices -> this.uuids | ||
is Accessory -> this.uuids | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...kotlin/edu/stanford/bdh/engagehf/bluetooth/spezi/core/configuration/ServiceDescription.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
package edu.stanford.bdh.engagehf.bluetooth.spezi.core.configuration | ||
|
||
import android.os.ParcelUuid | ||
import edu.stanford.bdh.engagehf.bluetooth.spezi.utils.BTUUID | ||
|
||
data class ServiceDescription( | ||
val identifier: BTUUID, | ||
val characteristics: Set<CharacteristicDescription>? = null | ||
val characteristics: Set<CharacteristicDescription>? = null, | ||
) { | ||
fun description(identifier: BTUUID): CharacteristicDescription? = | ||
characteristics?.firstOrNull { it.identifier == identifier } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.