Skip to content
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

Automatically send notifications when new target sucessfully connected #153

Closed
joedevsys opened this issue Sep 14, 2023 · 4 comments
Closed

Comments

@joedevsys
Copy link
Contributor

When changing target device using ble_cmd:switch or ble_cmd:switch="Devname" (etc) there is no notification when the target finally makes a successful connection. It is necessary for the user or his user-level application to poll at some later time to display the new status. Typically this might need to be 8-10 seconds later.

Unfortunately scripting in AAC software is limited and this is tricky. In Communicator 5, for example, it's possible to add delay commands and then call relaykeys-cli.exe ble_cmd:devname, however the delay blocks the current button and seems to cause UI issues (possibly threading issues?). At the moment the most reliable method is the user to wait 10 seconds and manually use a second button to poll the status. This works but isn't great.

Is it possible to trigger a thread in the cli that waits 8-10 seconds and then auto-runs ble_cmd:devname --notify?
Alternatively a permanent thread could auto-run ble_cmd:devname --notify every time a successful connection is made?

@f1andrew
Copy link
Contributor

@joedevsys
Sorry for delay.

Yes, we can add automatic polling right into cli "switch" command.
You said that there are problems with delays in AAC software.
Does while loop with some delay in python code will work this case or it's needed to start thread that will be running in background and not block shell?

@joedevsys
Copy link
Contributor Author

Don't block the initial call to cli switch. Start a background thread and return.

@f1andrew
Copy link
Contributor

I've added automatic polling of device name in same pull request : #152
If switch command was run with --notify flag then poll_devname process will start on background.
It will be running until device name changes from "NONE" and send notification with new devname or it will just stop running after timeout(40 seconds now).

Let me know how it works.

@willwade
Copy link
Contributor

willwade commented Oct 5, 2023

I think the bugs are largely gone in this build. I'm leaving it as pre-release for a week or so. If anyone gets a chance to check it out - https://github.com/AceCentre/RelayKeys/releases/tag/2.01 Updated the docs. Going to close this - but someone feel free to reopen if you spot anything. Thanks again everyone :)

@willwade willwade closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants