smartknob.proto 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 position = 1;
  37. int32 min_position = 2;
  38. int32 max_position = 3;
  39. float position_width_radians = 4;
  40. float detent_strength_unit = 5;
  41. float endstop_strength_unit = 6;
  42. float snap_point = 7;
  43. string text = 8 [(nanopb).max_length = 50];
  44. repeated int32 detent_positions = 9 [(nanopb).max_count = 5];
  45. float snap_point_bias = 10;
  46. }
  47. message RequestState {}