smartknob.proto 979 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. syntax = "proto3";
  2. import "nanopb.proto";
  3. package PB;
  4. /*
  5. * Message FROM the SmartKnob to USB host
  6. */
  7. message FromSmartKnob {
  8. oneof payload {
  9. Ack ack = 1;
  10. Log log = 2;
  11. SmartKnobState smartknob_state = 3;
  12. }
  13. }
  14. message Ack {
  15. uint32 nonce = 1;
  16. }
  17. message Log {
  18. string msg = 1 [(nanopb).max_length = 255];
  19. }
  20. message SmartKnobState {
  21. int32 current_position = 1;
  22. float sub_position_unit = 2;
  23. SmartKnobConfig config = 3;
  24. }
  25. /*
  26. * Message TO the Smartknob from the USB host
  27. */
  28. message ToSmartknob {
  29. uint32 nonce = 1;
  30. oneof payload {
  31. RequestState request_state = 2;
  32. SmartKnobConfig smartknob_config = 3;
  33. }
  34. }
  35. message SmartKnobConfig {
  36. int32 num_positions = 1;
  37. int32 position = 2;
  38. float position_width_radians = 3;
  39. float detent_strength_unit = 4;
  40. float endstop_strength_unit = 5;
  41. float snap_point = 6;
  42. string text = 7 [(nanopb).max_length = 50];
  43. }
  44. message RequestState {}