OpenC3 / cosmos

OpenC3 COSMOS
https://openc3.com
Other
112 stars 32 forks source link

cmd_response_protocol #1162

Open jmbell1989 opened 8 months ago

jmbell1989 commented 8 months ago

I'm looking to create an interface that is a command response type interface with a crc at the end of the outgoing packets. I see there is now a cmd_response_protocol but no example usage. How do you define the packet response? Also I've tried to include the CRC helper protocol with no luck. Any help is appreciated!

jmthomas commented 8 months ago

We haven't really documented this well or converted our Demo over to the new syntax. I'll leave this open until we do. In the meantime it's basically something like this:

TELEMETRY TGT PKT BIG_ENDIAN "Handles the TLM command response"
  ACCESSOR TemplateAccessor # Default is <VALUE>
  TEMPLATE "<VOLTAGE>"
  APPEND_ITEM VOLTAGE 16 UINT

There is a 1 to 1 in the TEMPLATE with the items that are defined. You can change the template delimiters in the ACCESSOR line by doing something like: ACCESSOR TemplateAccessor ( ) to make it look for (VALUE).

jmthomas commented 7 months ago

We also need to implement the python version of the cmd/response protocol

jmbell1989 commented 4 months ago

@jmthomas Could you please provide and example of how the cmd would look as well as how I would include it in the plugin file? I'm guessing the cmd definition specifically calls out the associated telemetry item similar to the templated protocol

This may be off topic but I have a device that is solely cmd/response but doesn't have any sort of delimiter or sync chars. Will this still work or does the cmd/response expect a terminator?