syntax = "proto3";
package dergrimm.eink_feed;

enum Orientation {
  PORTRAIT_UP = 0;
  PORTRAIT_DOWN = 1;
  LANDSCAPE_LEFT = 2;
  LANDSCAPE_RIGHT = 3;
};

message Display {
  uint32 width = 1;
  uint32 height = 2;
  Orientation orientation = 3;
}

message FrameMessage {
  Display display = 1;
  bytes pixels = 2;
}

message ServerMessage {
  oneof payload { FrameMessage frame = 1; }
}

message KeyUpdate {
  uint32 key_code = 1;
  string key_name = 2;
  uint32 value = 3;
}

message ClientKeyUpdateMessage { KeyUpdate key_update = 1; }

message ClientMessage {
  oneof payload { ClientKeyUpdateMessage key_update = 1; }
}
