-
Notifications
You must be signed in to change notification settings - Fork 85
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
State transition directly to disconnected #522
Comments
Good point, the diagram doesn't properly represent that The diagram should be updated and/or the default value of the ...not quite sure if having |
After I receive an advertisement for a compatible device, I have an application state called "visible", which means that I've seen the advertisement, but have not yet connected to the device. After I connect to the device, it becomes "connected". However, I think my app logic with the current setup is ok -- I attempt to differentiate "Disconnected but Visible" vs "Really Disconnected" based on the disconnected status. So maybe this is just a documentation issue. Especially if #521 is resolved, then there would be no ambiguity between "Really Disconnected" and "Disconnected but Visible". |
I'm also having this issue. It changes directly Connected to Disconnected(Timeout). Is it okay to use |
@jeddchoi can you describe your use-case in more detail? Are you trying to perform an action on disconnect? If so, is there a reason you can't do something to the effect of?: peripheral.state
.filterIsInstance<Disconnected>()
.onEach {
// todo: perform desired action on disconnect
}.launchIn(scope) |
I'm making seat reservation android app using beacon. There are user states such as So this use case is that I need to do some operation when ble connection is disconnected after connection.
I think your above suggesstion would not distinguish between first |
After more investigation, I found that its state goes like I think I need some flag or I need to separate as below.
|
Experimenting on Android. When I receive an advertisement, I am launching a
collect
onperipheral.state
, and I see immediately a state ofDisconnected(status=null)
.The peripheral has not previously been in a
Connected
state, and in fact, not even theDisconnecting
state is seen prior toDisconnected
, which as far as I can tell from the state diagram in the README, should not be possible.The text was updated successfully, but these errors were encountered: