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 Get_Flags Function to Modem #359

Merged
merged 2 commits into from
Mar 1, 2021
Merged

Conversation

krkeegan
Copy link
Collaborator

@krkeegan krkeegan commented Mar 1, 2021

Proposed change

Adds support for the get_flags command on the modem. The value is only outputted to the log and the UI, it is not saved.

Additional information

This may be helpful for debugging obscure modem issues, or might be useful in the future.

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.
  • Code documentation was added where necessary
  • Documentation added/updated

@krkeegan krkeegan merged commit 4847e21 into TD22057:dev Mar 1, 2021
@krkeegan krkeegan deleted the Modem_Get_Flags branch March 1, 2021 21:41
Copy link
Contributor

@tstabrawa tstabrawa left a comment

Choose a reason for hiding this comment

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

Recognizing that these changes are already merged, here is what I noticed. You can decide for yourself if it's worth the hassle of another PR for these.

return Msg.UNKNOWN
if isinstance(msg, Msg.OutGetModemFlags):
if msg.is_ack:
LOG.ui("Modem flag byte is: %s, spare bytes are: %s, %s",
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be more useful to print flags/spares in hex (assuming the conversion to string does so in decimal by default).

if self.is_ack is not None:
ack = " ack: %s" % str(self.is_ack)
flags = " modem flags: %s" % str(self.modem_flags)
spares = " spares: %s %s" % (str(self.spare1), str(self.spare2))
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be more useful to print flags/spares in hex (assuming the conversion to string does so in decimal by default).

handler.sending_message(msg)
assert handler._PLM_sent

#Try a message prior to sent
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is actually after sending ...

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.

2 participants