-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/esp provision provider #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…rking, lots of cleanup to do
…tes, taking changing RSSI into account and continuing scan until explicitly stopped.
…= when scan has been asked explicitly)
# Conflicts: # ORLib/build.gradle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things to be discussed.
Overall it looks very well structured!
ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceConnection.kt
Show resolved
Hide resolved
ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceConnection.kt
Outdated
Show resolved
Hide resolved
|
||
@androidx.annotation.RequiresPermission(allOf = [android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.BLUETOOTH_ADMIN, android.Manifest.permission.BLUETOOTH]) | ||
suspend fun searchESPDevices(devicePrefix: String): List<DeviceRegistry.DiscoveredDevice> { | ||
return withContext(Dispatchers.Main) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do it on IO
and when returning the result then on Main
? Or doesn't that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how that would work, the callbacks are not suspended and I can't switch context there.
In the end, I'm not seeing any issue with dispatching this on the Main context, so keeping it like that.
ORLib/src/main/java/io/openremote/orlib/service/espprovision/DeviceRegistry.kt
Outdated
Show resolved
Hide resolved
suspend fun getDeviceInfo(): DeviceInfo { | ||
val request = Request.newBuilder() | ||
.setDeviceInfo(Request.DeviceInfo.getDefaultInstance()) | ||
.setId(messageId++.toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to create a function for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why ?
I tried creating one, scoping it with the getDeviceInfo() function as it's only used there and thought it made the code less readable as we're defining a function and just calling it once the line below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be committed? I would say it wil be generated locally when working on the project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried a bit but couldn't get the gradle build to work.
I will give it another go.
Thanks, I'll take a look at those, maybe we can have a quick call next week |
… permissions have been requested to user (if required) (GitHub issue #40)
No description provided.