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

outgoing commands #3

Open
maiermic opened this issue May 28, 2019 · 3 comments
Open

outgoing commands #3

maiermic opened this issue May 28, 2019 · 3 comments

Comments

@maiermic
Copy link

There are no outgoing commands specified yet. How are they supposed to be specified?

All current commands have cmdbodysize of 0 and cmdfmt of ''. The property cmdfmt is never used. Further, setcmd takes cmddata as a string or at least the default value is ''. What is the format of this string? Shouldn't that be a request object that should be specified similar to respfields?

@lweingart
Copy link

Hello,

Apart from the setcmd command given in the examples here
https://pysimplebgc.readthedocs.io/en/latest/
I can't get any other result.
What I mean is, I can only make this command to work when the second argument is an empty string "".
device.setcmd(SOMETHING, "")
That means that I need to parse the result for each and every specific result I would need.

Isn't there any way to get a more specific result than getting each time the whole list of dictionaries ?

If someone has found how to use this more specifically, I would gladly hear how.

Thank you for your help

Best

@maiermic
Copy link
Author

@lweingart FYI, I started implementing my own library in this project. Here is a code snippet on how to use it:

class Gimbal:
    # ...
    def send_message(self, message: Message):
        logger.debug(f'send message: {message}')
        self._connection.write(pack_message(message))
    # ...
    def get_angles(self) -> GetAnglesInCmd:
        self.send_message(create_message(CMD_GET_ANGLES))
        cmd = read_cmd(self._connection)
        assert cmd.id == CMD_GET_ANGLES
        return parse_cmd(cmd)

@lweingart
Copy link

Hey @maiermic, thank you very much for your link and for your work, I'll give it a try :-)

Cheers

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

2 participants