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

Support reader disconnect reason #628

Merged
merged 4 commits into from
Mar 5, 2024
Merged

Conversation

ianlin-bbpos
Copy link
Collaborator

Summary

Support reader disconnect reason

Motivation

Support new reader disconnected callback and disconnect reason enum.

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.

Comment on lines 606 to 611
case DisconnectReason.disconnectRequested: return "disconnect requested"
case DisconnectReason.rebootRequested: return "reboot requested"
case DisconnectReason.securityReboot: return "security reboot"
case DisconnectReason.criticallyLowBattery: return "critically low battery"
case DisconnectReason.poweredOff: return "powered off"
case DisconnectReason.bluetoothDisabled: return "bluetooth disabled"
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't these (and the android ones) be mapping to the same strings found in src/types/Reader.ts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh, I defined it already in Reader.ts and each Mapper, but considering the grammar of Alert msg, I change the words in mapper but missed Reader.ts. Let me meke them consistent.

Comment on lines 113 to 118
| 'disconnect requested'
| 'reboot requested'
| 'security reboot'
| 'critically low battery'
| 'powered off'
| 'bluetooth disabled'
Copy link
Collaborator

Choose a reason for hiding this comment

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

we usually use camelCase for these strings, can we keep these as disconnectRequested etc and change the mappers in the native layer to follow that format? @ianlin-bbpos

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, I'll do it.

nazli-stripe
nazli-stripe previously approved these changes Mar 4, 2024
@nazli-stripe nazli-stripe merged commit 8407ea0 into main Mar 5, 2024
2 checks passed
@nazli-stripe nazli-stripe deleted the bbpos/support-disconnect-reason 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