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

Add rebootReader method #629

Merged
merged 2 commits into from
Mar 4, 2024
Merged

Add rebootReader method #629

merged 2 commits into from
Mar 4, 2024

Conversation

ianlin-bbpos
Copy link
Collaborator

Summary

Add rebootReader method.

Motivation

Support rebootReader SDK method.

Testing

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

Copy link
Collaborator

@bric-stripe bric-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes lgtm with a small change request to not clear the connected reader after reboot. I tested this branch and confirmed if auto reconnect is enabled it would lose that state. I think you can just remove that clearing and rely on the existing disconnect callback handling to reset the connected reader state.

Comment on lines 487 to 490
if (!response.error) {
setConnectedReader(null);
setDiscoveredReaders([]);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to clear the connected reader. If the user enabled auto-reconnect the SDK will start attempting to reconnect when the rebooted reader disconnects. That reconnect may fail but that's OK. We should rely on the existing disconnect callbacks to clear the connected reader

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I removed the codes and gave a test, it works well then. thanks!

Copy link
Collaborator

@bric-stripe bric-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes lgtm!

@nazli-stripe nazli-stripe merged commit f666da6 into main Mar 4, 2024
2 checks passed
@nazli-stripe nazli-stripe deleted the bbpos/support-reboot-reader branch September 6, 2024 20:52
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

Successfully merging this pull request may close these issues.

3 participants