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 Protobuf Messages #170

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

wsciaroni
Copy link
Collaborator

This adds a script that would be used to serialize the commands to and from the embedded device.

For this to be used we would need to add the probof library as a dependency for the project's builds.

This should allow for a more robust protocol and easy adoption for other projects regardless of language.

@wsciaroni
Copy link
Collaborator Author

Could be:

syntax = "proto3";

package audio_streaming;

enum MsgType {
  DATA = 0;
  CMD = 1;
}

enum CommandType {
  PTT_DOWN = 0;
  PTT_UP = 1;
  TUNE_TO = 2;
  FILTERS = 3;
  STOP = 4;
  GET_FIRMWARE_VER = 5;
}

message MsgHeader {
  MsgType type = 1;
}

message DataMsg {
  MsgHeader header = 1;
  bytes data = 2;
}

message TxCmdMsg {
  MsgHeader header = 1;
  CommandType command = 2;
}

message RxCmdMsg {
  MsgHeader header = 1;
  CommandType command = 2;
}

message TuneCmdMsg {
  MsgHeader header = 1;
  CommandType command = 2;
  uint64 txfreq = 3;
  uint64 rxfreq = 4;
}

message FiltersCmdMsg {
  MsgHeader header = 1;
  CommandType command = 2;
  bool emphasis = 3;
  bool highpass = 4;
  bool lowpass = 5;
}

message StopCmdMsg {
  MsgHeader header = 1;
  CommandType command = 2;
}

message GetFirmwareVerCmdMsg {
  MsgHeader header = 1;
  CommandType command = 2;
}

message FirmwareVersion {
  string version = 1;
}

enum AckType {
  WILCO = 0;
  CANTCO = 1;
}

message Ack {
  AckType type = 1;
  string error_message = 2;
}

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.

1 participant