mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-13 15:07:01 +03:00
Start of 5.X work
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
syntax = "proto3";
|
||||
import "nanopb.proto";
|
||||
package sys;
|
||||
message AirPlay {
|
||||
import "customoptions.proto";
|
||||
package sys.airplay;
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 1001;
|
||||
bool enabled = 1;
|
||||
bool enabled = 1 [(cust_field).v_bool = true];
|
||||
uint32 port = 2 [(nanopb).int_size = IS_8];
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
syntax = "proto3";
|
||||
package sys;
|
||||
package sys.artwork;
|
||||
import "nanopb.proto";
|
||||
|
||||
message Artwork {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 1002;
|
||||
bool enabled = 1 ; // Enable cover art display
|
||||
bool resize = 2 ; // Optional parameter to indicate if the artwork should be resized
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
package sys.battery;
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
enum BatteryChannelEnum {
|
||||
enum channels {
|
||||
UNSPECIFIED_CH = 0;
|
||||
CH0 = 1;
|
||||
CH1 = 2;
|
||||
@@ -15,17 +15,18 @@ enum BatteryChannelEnum {
|
||||
CH7 = 8;
|
||||
}
|
||||
|
||||
enum BatteryAttenEnum {
|
||||
enum atten {
|
||||
UNSPECIFIED_ATT = 0;
|
||||
ATT_0 = 1;
|
||||
ATT_1 = 2;
|
||||
ATT_2 = 3;
|
||||
ATT_3 = 4;
|
||||
}
|
||||
message Battery {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 1003;
|
||||
BatteryChannelEnum channel = 1;
|
||||
channels channel = 1;
|
||||
float scale = 2;
|
||||
int32 cells = 3 [(nanopb).int_size = IS_8];
|
||||
BatteryAttenEnum atten = 4;
|
||||
atten atten = 4;
|
||||
}
|
||||
@@ -1,61 +1,79 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
import "GPIO.proto";
|
||||
package sys.btns;
|
||||
import "nanopb.proto";
|
||||
import "GPIO.proto";
|
||||
import "customoptions.proto";
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
enum ButtonAction {
|
||||
ACTRLS_NONE = 0;
|
||||
ACTRLS_POWER = 1;
|
||||
ACTRLS_VOLUP = 2;
|
||||
ACTRLS_VOLDOWN = 3;
|
||||
ACTRLS_TOGGLE = 4;
|
||||
ACTRLS_PLAY = 5;
|
||||
ACTRLS_PAUSE = 6;
|
||||
ACTRLS_STOP = 7;
|
||||
ACTRLS_REW = 8;
|
||||
ACTRLS_FWD = 9;
|
||||
ACTRLS_PREV = 10;
|
||||
ACTRLS_NEXT = 11;
|
||||
BCTRLS_UP = 12;
|
||||
BCTRLS_DOWN = 13;
|
||||
BCTRLS_LEFT = 14;
|
||||
BCTRLS_RIGHT = 15;
|
||||
BCTRLS_PS1 = 16;
|
||||
BCTRLS_PS2 = 17;
|
||||
BCTRLS_PS3 = 18;
|
||||
BCTRLS_PS4 = 19;
|
||||
BCTRLS_PS5 = 20;
|
||||
BCTRLS_PS6 = 21;
|
||||
BCTRLS_PS7 = 22;
|
||||
BCTRLS_PS8 = 23;
|
||||
BCTRLS_PS9 = 24;
|
||||
BCTRLS_PS10 = 25;
|
||||
enum actions {
|
||||
A_NONE = 0;
|
||||
A_POWER = 1;
|
||||
A_VOLUP = 2;
|
||||
A_VOLDOWN = 3;
|
||||
A_TOGGLE = 4;
|
||||
A_PLAY = 5;
|
||||
A_PAUSE = 6;
|
||||
A_STOP = 7;
|
||||
A_REW = 8;
|
||||
A_FWD = 9;
|
||||
A_PREV = 10;
|
||||
A_NEXT = 11;
|
||||
B_UP = 12;
|
||||
B_DOWN = 13;
|
||||
B_LEFT = 14;
|
||||
B_RIGHT = 15;
|
||||
B_PS1 = 16;
|
||||
B_PS2 = 17;
|
||||
B_PS3 = 18;
|
||||
B_PS4 = 19;
|
||||
B_PS5 = 20;
|
||||
B_PS6 = 21;
|
||||
B_PS7 = 22;
|
||||
B_PS8 = 23;
|
||||
B_PS9 = 24;
|
||||
B_PS10 = 25;
|
||||
KNOB_LEFT = 26;
|
||||
KNOB_RIGHT = 27;
|
||||
KNOB_PUSH = 28;
|
||||
ACTRLS_SLEEP = 29;
|
||||
A_SLEEP = 29;
|
||||
REMAP=30;
|
||||
MAX=31;
|
||||
|
||||
}
|
||||
// Message for ButtonActions
|
||||
message ButtonActions {
|
||||
message action {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
actions type = 1;
|
||||
string profile_name = 2 [(nanopb).type = FT_POINTER];
|
||||
}
|
||||
message press {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10004;
|
||||
ButtonAction pressed = 1 ;
|
||||
ButtonAction released = 2 ;
|
||||
action pressed = 1;
|
||||
action released = 2;
|
||||
}
|
||||
message Button {
|
||||
|
||||
message btn {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10005;
|
||||
GPIO gpio = 1;
|
||||
gpio.config gpio = 1 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
bool pull = 2;
|
||||
int32 debounce = 3;
|
||||
GPIO shifter = 4;
|
||||
int32 shifter = 4 [(cust_field).v_int32=-1];
|
||||
int32 longduration = 5;
|
||||
ButtonActions normal = 6;
|
||||
ButtonActions longpress = 7;
|
||||
ButtonActions shifted = 8;
|
||||
ButtonActions longshifted = 9;
|
||||
press normal = 6;
|
||||
press longpress = 7;
|
||||
press shifted = 8;
|
||||
press longshifted = 9;
|
||||
}
|
||||
message KnobOnly {
|
||||
message profile {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
string profile_name = 1 [(nanopb).max_length= 128];
|
||||
repeated btn buttons = 2 [(nanopb).type = FT_POINTER];
|
||||
}
|
||||
message knob_only {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10006;
|
||||
// This mode attempts to offer a single knob full navigation which is a bit contorded due to LMS UI's
|
||||
// principles. Left, Right and Press obey to LMS's navigation rules and especially Press always goes to
|
||||
@@ -74,12 +92,15 @@ message KnobOnly {
|
||||
int32 delay_ms = 2; // optionally set the delay
|
||||
|
||||
}
|
||||
message Rotary {
|
||||
message rotary {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10007;
|
||||
GPIO A = 1;
|
||||
GPIO B = 2;
|
||||
GPIO SW = 3;
|
||||
KnobOnly knobonly = 4;
|
||||
int32 A = 1 [(cust_field).v_int32=-1];
|
||||
int32 B = 2 [(cust_field).v_int32=-1];
|
||||
int32 SW = 3 [(cust_field).v_int32=-1];
|
||||
knob_only knobonly = 4;
|
||||
bool volume = 5;
|
||||
bool longpress = 6;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Append nanopb path to CMAKE_MODULE_PATH for finding the nanopb package
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
include(../protobuf_utils.cmake)
|
||||
include(../../tools/protoc_utils/protobuf_utils.cmake)
|
||||
configure_env()
|
||||
|
||||
file(GLOB_RECURSE PROTO_FILES *.proto)
|
||||
@@ -10,20 +10,19 @@ nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS RELPATH ${CMAKE_CURRENT_SOURCE_DIR} ${
|
||||
|
||||
# Create a custom target to generate the proto files
|
||||
set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS} PROPERTIES GENERATED TRUE)
|
||||
add_custom_target(generate_system_proto DEPENDS ${PROTO_SRCS} ${PROTO_HDRS})
|
||||
add_custom_target(generate_system_proto ALL DEPENDS ${PROTO_SRCS} ${PROTO_HDRS})
|
||||
|
||||
|
||||
add_library(platform_protobuf STATIC ${PROTO_SRCS} ${PROTO_HDRS})
|
||||
# PUBLIC to propagate includes from bell to cspot dependents
|
||||
target_compile_definitions(platform_protobuf PUBLIC PB_ENABLE_MALLOC)
|
||||
target_compile_definitions(platform_protobuf PUBLIC PB_FIELD_32BIT)
|
||||
add_dependencies(platform_protobuf generate_system_proto)
|
||||
|
||||
# target_compile_definitions(platform_protobuf PUBLIC PB_ENABLE_MALLOC PB_FIELD_32BIT)
|
||||
# target_compile_definitions(__idf_tools PUBLIC PB_ENABLE_MALLOC PB_FIELD_32BIT)
|
||||
|
||||
|
||||
target_include_directories(platform_protobuf PUBLIC "include" ${CMAKE_CURRENT_BINARY_DIR} ${NANOPB_INCLUDE_DIRS} ${EXTRA_INCLUDES})
|
||||
|
||||
|
||||
|
||||
# Link the generated proto library to your main targets
|
||||
target_link_libraries(__idf_platform_config PRIVATE platform_protobuf)
|
||||
target_link_libraries(__idf_wifi-manager PRIVATE platform_protobuf)
|
||||
target_include_directories(__idf_platform_config PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/proto)
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
package sys.dev.common;
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
enum DeviceTypeEnum {
|
||||
UNSPECIFIED_TYPE = 0;
|
||||
DEVTYPE_SPI = 1;
|
||||
DEVTYPE_I2C = 2;
|
||||
DEVTYPE__RMII = 3;
|
||||
enum types {
|
||||
UNKNOWN = 0;
|
||||
SPI = 1;
|
||||
I2C = 2;
|
||||
RMII = 3;
|
||||
}
|
||||
|
||||
enum PortEnum {
|
||||
UNSPECIFIED_SYSTPORT = 0;
|
||||
enum ports {
|
||||
UNSPECIFIED = 0;
|
||||
SYSTEM = 1;
|
||||
DAC_PORT = 2;
|
||||
DAC = 2;
|
||||
}
|
||||
|
||||
enum HostEnum {
|
||||
UNSPECIFIED_HOST = 0;
|
||||
enum hosts {
|
||||
NONE = 0;
|
||||
Host0 = 1;
|
||||
Host1 = 2;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
package sys.dac;
|
||||
import "GPIO.proto";
|
||||
import "DacControlSet.proto";
|
||||
import "I2CBus.proto";
|
||||
@@ -8,8 +8,8 @@ import "customoptions.proto";
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
enum DACModelEnum {
|
||||
UNSPECIFIED_MODEL = 0;
|
||||
enum models {
|
||||
UNSPECIFIED = 0;
|
||||
TAS57xx = 1;
|
||||
TAS5713 = 2;
|
||||
AC101 = 3;
|
||||
@@ -17,23 +17,40 @@ enum DACModelEnum {
|
||||
ES8388 = 5;
|
||||
I2S = 6;
|
||||
CS4265 = 7;
|
||||
OTHER = 8;
|
||||
}
|
||||
enum MCKEnum {
|
||||
UNSPECIFIED_MCK = 0;
|
||||
MCK0 = 1;
|
||||
MCK1 = 2;
|
||||
MCK2 = 3;
|
||||
enum mck {
|
||||
NONE = 0;
|
||||
GPIO0 = 1;
|
||||
TXD = 2;
|
||||
INVALID1 = 3;
|
||||
RXD = 4;
|
||||
}
|
||||
message default_set {
|
||||
models model = 1;
|
||||
uint32 bytes_per_frame = 2;
|
||||
bool valid = 3;
|
||||
dac.control.set set = 4;
|
||||
|
||||
|
||||
message DAC {
|
||||
}
|
||||
message default_sets {
|
||||
repeated default_set sets = 1 [(nanopb).type = FT_POINTER];
|
||||
}
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10008;
|
||||
GPIO bck = 1 [(cust_field).read_only = true] ;
|
||||
GPIO ws = 2;
|
||||
GPIO dout = 3;
|
||||
MCKEnum mck = 4;
|
||||
GPIO mute = 5;
|
||||
DACModelEnum model = 6;
|
||||
I2CBus i2c = 7;
|
||||
DacControlSet daccontrolset = 8;
|
||||
int32 bck = 1 [(cust_field).v_int32=-1];
|
||||
int32 ws = 2 [(cust_field).v_int32=-1];
|
||||
int32 dout = 3 [(cust_field).v_int32=-1];
|
||||
mck mck = 4;
|
||||
gpio.config mute = 5 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
models model = 6;
|
||||
sys.i2c.bus i2c = 7;
|
||||
dac.control.set daccontrolset = 8;
|
||||
bool jack_mutes_amp = 9;
|
||||
uint32 addr = 10;
|
||||
int32 din = 11 [(cust_field).v_int32=-1];
|
||||
|
||||
|
||||
}
|
||||
@@ -1,20 +1,17 @@
|
||||
syntax = "proto3";
|
||||
package sys;
|
||||
package sys.dac.control;
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
message DacControlSet {
|
||||
message set {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10009;
|
||||
repeated ControlCommand commands = 1 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 10];
|
||||
repeated cmd commands = 1 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 10];
|
||||
bool mclk_needed = 2;
|
||||
|
||||
}
|
||||
|
||||
message ControlCommand {
|
||||
option (nanopb_msgopt).msgid = 10010;
|
||||
ControlCommandType type = 1;
|
||||
repeated ControlItem items = 2 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 50];
|
||||
}
|
||||
|
||||
enum ControlCommandType {
|
||||
enum type {
|
||||
INIT = 0;
|
||||
POWER_ON = 1;
|
||||
POWER_OFF = 2;
|
||||
@@ -23,41 +20,63 @@ enum ControlCommandType {
|
||||
HEADSET_ON = 5;
|
||||
HEADSET_OFF = 6;
|
||||
}
|
||||
message cmd {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10010;
|
||||
type type = 1;
|
||||
repeated itm items = 2 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 50];
|
||||
|
||||
}
|
||||
|
||||
message ControlItem {
|
||||
message itm {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10011;
|
||||
oneof item_type {
|
||||
RegisterAction reg_action = 1;
|
||||
GpioAction gpio_action = 2;
|
||||
DelayAction delay_action = 3;
|
||||
reg reg_action = 1;
|
||||
gpio gpio_action = 2;
|
||||
delay delay_action = 3;
|
||||
regs regs_action = 4;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
message RegisterAction {
|
||||
message reg {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10012;
|
||||
int32 reg = 1[(nanopb).int_size = IS_8];
|
||||
int32 val = 2 [(nanopb).int_size = IS_8];
|
||||
Mode mode = 3;
|
||||
uint32 reg = 1[(nanopb).int_size = IS_8];
|
||||
uint32 val = 2 [(nanopb).int_size = IS_8];
|
||||
mode mode = 3;
|
||||
|
||||
}
|
||||
message regs {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10060;
|
||||
uint32 reg = 1[(nanopb).int_size = IS_8];
|
||||
repeated uint32 vals = 2 [(nanopb).type = FT_POINTER,(nanopb).int_size = IS_8];
|
||||
|
||||
}
|
||||
|
||||
enum GpioActionLevel {
|
||||
ACTION_LEVEL_UNDEFINED = 0;
|
||||
ACTION_LEVEL_1 = 1;
|
||||
ACTION_LEVEL_0 = 2;
|
||||
enum lvl {
|
||||
LV_UNDEFINED = 0;
|
||||
LV_0 = 1;
|
||||
LV_1 = 2;
|
||||
}
|
||||
message GpioAction {
|
||||
message gpio {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10013;
|
||||
int32 gpio = 1 [(nanopb).int_size = IS_8];
|
||||
GpioActionLevel level = 2;
|
||||
int32 gpio = 1 [(nanopb).int_size = IS_16];
|
||||
lvl level = 2;
|
||||
|
||||
}
|
||||
|
||||
message DelayAction {
|
||||
message delay {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10014;
|
||||
int32 delay = 1; // Delay in milliseconds
|
||||
int64 delay = 1; // Delay in milliseconds
|
||||
}
|
||||
|
||||
enum Mode {
|
||||
REG_MODE_NOTHING = 0;
|
||||
REG_MODE_OR = 1;
|
||||
REG_MODE_AND = 2;
|
||||
enum mode {
|
||||
NOTHING = 0;
|
||||
OR = 1;
|
||||
AND = 2;
|
||||
}
|
||||
|
||||
45
protobuf/proto/DataRequest.proto
Normal file
45
protobuf/proto/DataRequest.proto
Normal file
@@ -0,0 +1,45 @@
|
||||
syntax = "proto3";
|
||||
import "nanopb.proto";
|
||||
import "configuration.proto";
|
||||
import "Status.proto";
|
||||
package sys.request;
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
enum type {
|
||||
UNKNOWN = 0;
|
||||
CONFIG = 1;
|
||||
STATUS = 2;
|
||||
MESSAGE = 3;
|
||||
RESTART = 4;
|
||||
NETWORK = 5;
|
||||
OTA = 6;
|
||||
SCAN = 7;
|
||||
}
|
||||
enum action {
|
||||
ACT_UNKNOWN = 0;
|
||||
SET = 1;
|
||||
GET = 2;
|
||||
}
|
||||
enum result {
|
||||
RES_UNKNOWN = 0;
|
||||
SUCCESS = 1;
|
||||
ERROR = 2;
|
||||
}
|
||||
|
||||
message payload {
|
||||
type type = 1;
|
||||
action action = 2;
|
||||
oneof data {
|
||||
config config = 3;
|
||||
string URL = 4 [(nanopb).type = FT_POINTER];
|
||||
}
|
||||
|
||||
}
|
||||
message response {
|
||||
result result = 1;
|
||||
string message = 2 [(nanopb).type = FT_POINTER];
|
||||
oneof data {
|
||||
status.data status = 3;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +1,29 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
import "GPIO.proto";
|
||||
import "Common.proto";
|
||||
package sys.dev;
|
||||
import "SPI.proto";
|
||||
import "I2CBus.proto";
|
||||
import "Expanders.proto";
|
||||
import "DAC.proto";
|
||||
import "Display.proto";
|
||||
import "Buttons.proto";
|
||||
import "Battery.proto";
|
||||
import "Ethernet.proto";
|
||||
import "nanopb.proto";
|
||||
message SPDIF {
|
||||
import "customoptions.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
message spdif {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10015;
|
||||
GPIO dc = 1;
|
||||
GPIO data = 2;
|
||||
GPIO clk = 3;
|
||||
int32 ws = 1 [(cust_field).v_int32=-1];
|
||||
int32 data = 2 [(cust_field).v_int32=-1];
|
||||
int32 clk = 3 [(cust_field).v_int32=-1];
|
||||
|
||||
}
|
||||
|
||||
|
||||
message SPIBus {
|
||||
option (nanopb_msgopt).msgid = 10016;
|
||||
GPIO mosi = 1;
|
||||
GPIO miso = 2;
|
||||
GPIO clk = 3;
|
||||
GPIO dc = 4;
|
||||
HostEnum host = 5; // Defaults to Host1 in your application logic
|
||||
}
|
||||
enum LEDStripType {
|
||||
|
||||
enum strip_types {
|
||||
LS_UNKNOWN = 0;
|
||||
LS_WS2812 = 1;
|
||||
//unsupported
|
||||
@@ -36,34 +33,40 @@ message SPDIF {
|
||||
}
|
||||
|
||||
|
||||
message LEDStrip {
|
||||
message led_strip {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10018;
|
||||
GPIO gpio = 1;
|
||||
int32 gpio = 1 [(cust_field).v_int32=-1];
|
||||
int32 length = 2 [(nanopb).int_size = IS_16];
|
||||
LEDStripType strip_type = 3;
|
||||
strip_types strip_type = 3;
|
||||
|
||||
}
|
||||
enum InfraredType {
|
||||
enum ir_types {
|
||||
IR_UNKNOWN = 0;
|
||||
IR_RC5 = 1;
|
||||
IR_NEC = 2;
|
||||
}
|
||||
message Infrared {
|
||||
InfraredType type = 1;
|
||||
GPIO gpio = 2;
|
||||
message ir {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
ir_types type = 1;
|
||||
int32 gpio = 2 [(cust_field).v_int32=-1];
|
||||
|
||||
}
|
||||
|
||||
message Dev {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10019;
|
||||
SPIBus spi = 1;
|
||||
I2CBus i2c = 2;
|
||||
DAC dac = 3;
|
||||
SPDIF spdif = 4;
|
||||
Display display = 5;
|
||||
repeated GPIOExp gpio_exp = 6 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 4];
|
||||
LEDStrip led_strip = 7;
|
||||
Rotary rotary = 8;
|
||||
repeated Button buttons = 9 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 15];
|
||||
Eth eth = 10;
|
||||
Battery battery = 11;
|
||||
Infrared ir = 12;
|
||||
spi.bus spi = 1;
|
||||
i2c.bus i2c = 2;
|
||||
dac.config dac = 3;
|
||||
spdif spdif = 4;
|
||||
sys.display.config display = 5;
|
||||
repeated sys.exp.config gpio_exp = 6 [(nanopb).type = FT_CALLBACK, (nanopb).callback_datatype = "sys_exp_config*"];
|
||||
led_strip led_strip = 7;
|
||||
btns.rotary rotary = 8;
|
||||
string root_button_profile = 9 [(nanopb).type = FT_POINTER];
|
||||
repeated btns.profile buttons_profiles = 10 [(nanopb).type = FT_POINTER];
|
||||
dev.eth.config eth = 11;
|
||||
battery.config battery = 12;
|
||||
ir ir = 13;
|
||||
}
|
||||
@@ -1,19 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
import "GPIO.proto";
|
||||
package sys.display;
|
||||
import "Common.proto";
|
||||
import "SPI.proto";
|
||||
import "nanopb.proto";
|
||||
import "I2CBus.proto";
|
||||
import "customoptions.proto";
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
message DispOffsets {
|
||||
message offsets {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10020;
|
||||
int32 height =1 [(nanopb).int_size = IS_16];
|
||||
int32 width =2 [(nanopb).int_size = IS_16];
|
||||
}
|
||||
|
||||
enum DisplayDriverEnum {
|
||||
UNSPECIFIED_DRIVER = 0;
|
||||
enum drivers {
|
||||
UNSPECIFIED = 0;
|
||||
SSD1306 = 1;
|
||||
SSD1322 = 2;
|
||||
SSD1326 = 3;
|
||||
@@ -28,41 +32,33 @@ enum DisplayDriverEnum {
|
||||
}
|
||||
|
||||
|
||||
message I2CDisplay {
|
||||
option (nanopb_msgopt).msgid = 10021;
|
||||
int32 address = 1 [(nanopb).int_size = IS_8];
|
||||
}
|
||||
|
||||
message SPIDisplay {
|
||||
option (nanopb_msgopt).msgid = 10022;
|
||||
GPIO cs = 1;
|
||||
int32 speed = 4 ;
|
||||
}
|
||||
|
||||
|
||||
message DispCommon {
|
||||
message common {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10023;
|
||||
int32 width = 1 [(nanopb).int_size = IS_16];
|
||||
int32 height = 2 [(nanopb).int_size = IS_16];
|
||||
bool HFlip = 3;
|
||||
bool VFlip = 4;
|
||||
DisplayDriverEnum driver = 5;
|
||||
drivers driver = 5;
|
||||
int32 bitDepth = 6 [(nanopb).int_size = IS_8]; // Defaults to Depth1 in your application logic
|
||||
GPIO back = 7;
|
||||
GPIO reset = 8;
|
||||
GPIO ready = 9;
|
||||
DispOffsets offsets = 10;
|
||||
int32 back = 7 [(nanopb).int_size=IS_16, (cust_field).v_int32=-1];
|
||||
int32 reset = 8 [(nanopb).int_size=IS_16, (cust_field).v_int32=-1];
|
||||
int32 ready = 9 [(nanopb).int_size=IS_16, (cust_field).v_int32=-1];
|
||||
offsets offsets = 10;
|
||||
bool rotate = 11;
|
||||
bool invert = 12;
|
||||
bool colow_swap = 13;
|
||||
|
||||
}
|
||||
|
||||
message Display {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10024;
|
||||
DeviceTypeEnum type = 1;
|
||||
DispCommon common = 2;
|
||||
dev.common.types type = 1;
|
||||
common common = 2;
|
||||
oneof dispType {
|
||||
I2CDisplay i2c = 3;
|
||||
SPIDisplay spi = 4;
|
||||
sys.i2c.device i2c = 3;
|
||||
sys.spi.device spi = 4;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
package sys.equalizer;
|
||||
|
||||
import "nanopb.proto";
|
||||
|
||||
message Equalizer {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
repeated float gains = 1 [(nanopb).max_count = 10];
|
||||
float loudness = 2;
|
||||
|
||||
}
|
||||
@@ -1,52 +1,61 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
package sys.dev.eth;
|
||||
import "Common.proto";
|
||||
import "GPIO.proto";
|
||||
import "nanopb.proto";
|
||||
import "customoptions.proto";
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
enum EthModelEnum {
|
||||
UNSPECIFIED_ETHMODEL = 0;
|
||||
enum models {
|
||||
NONE = 0;
|
||||
LAN8720 = 1;
|
||||
DM9051 = 2;
|
||||
W5500 = 3;
|
||||
}
|
||||
enum EthType { // This enum is used to define the union type for Eth
|
||||
UNSPECIFIED_ETH = 0; // for unspecified type
|
||||
enum types { // This enum is used to define the union type for Eth
|
||||
UNSPECIFIED = 0; // for unspecified type
|
||||
SPI = 1;
|
||||
RMII = 2;
|
||||
}
|
||||
message EthCommon {
|
||||
message common {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10025;
|
||||
EthModelEnum model = 1;
|
||||
GPIO rst = 2;
|
||||
models model = 1 [(cust_field).v_enum = "NONE"];
|
||||
int32 rst = 2 [(cust_field).v_int32=-1];
|
||||
uint32 ethtmout_s = 3 [(nanopb).int_size = IS_16, (cust_field).v_uint32 = 30];
|
||||
|
||||
}
|
||||
|
||||
// SPI Specific Ethernet definitions
|
||||
message EthSPI {
|
||||
message spi {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10026;
|
||||
GPIO cs = 1; // CS pin
|
||||
int32 speed = 2 [(nanopb).int_size = IS_16]; // SPI Bus speed
|
||||
GPIO intr = 3;
|
||||
int32 host = 4 [(nanopb).int_size = IS_8,(cust_field).v_int32 = 2 ]; // Defaults to 2 in your application logic
|
||||
int32 cs = 1 [(cust_field).v_int32=-1]; // CS pin
|
||||
uint32 speed = 2 ;
|
||||
int32 intr = 3 [(cust_field).v_int32=-1];
|
||||
dev.common.hosts host = 4 [(nanopb).int_size = IS_8,(cust_field).v_enum = "Host1" ]; // Defaults to 2 in your application logic
|
||||
|
||||
}
|
||||
|
||||
// RMII Specific Ethernet definitions
|
||||
message EthRMII {
|
||||
message rmii {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10027;
|
||||
GPIO mdc = 1;
|
||||
GPIO mdio = 2;
|
||||
int32 mdc = 1 [(cust_field).v_int32=-1];
|
||||
int32 mdio = 2 [(cust_field).v_int32=-1];
|
||||
|
||||
}
|
||||
|
||||
// Ethernet module configuration
|
||||
message Eth {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10028;
|
||||
DeviceTypeEnum type = 1;
|
||||
EthCommon common = 2;
|
||||
dev.common.types type = 1 [(cust_field).v_enum = "UNKNOWN"];
|
||||
common common = 2;
|
||||
oneof ethType {
|
||||
EthSPI spi = 3;
|
||||
EthRMII rmii = 4;
|
||||
spi spi = 3;
|
||||
rmii rmii = 4;
|
||||
}
|
||||
|
||||
}
|
||||
37
protobuf/proto/Expanders.proto
Normal file
37
protobuf/proto/Expanders.proto
Normal file
@@ -0,0 +1,37 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys.exp;
|
||||
import "Common.proto";
|
||||
import "SPI.proto";
|
||||
import "GPIO.proto";
|
||||
import "I2CBus.proto";
|
||||
import "customoptions.proto";
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
|
||||
|
||||
enum models {
|
||||
UNSPECIFIED_EXP = 0;
|
||||
PCA9535 = 1;
|
||||
PCA85XX = 2;
|
||||
MCP23017 = 3;
|
||||
MCP23S17 = 4;
|
||||
}
|
||||
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10033;
|
||||
models model = 1;
|
||||
int32 addr = 2 [(nanopb).int_size = IS_8];
|
||||
oneof ExpType {
|
||||
i2c.device i2c = 3;
|
||||
spi.device spi = 4;
|
||||
}
|
||||
int32 base = 5 [(nanopb).int_size=IS_16, (cust_field).v_int32=40]; // Defaults to 40
|
||||
int32 count = 6 [(nanopb).int_size=IS_16, (cust_field).v_int32=16]; // Defaults to 16
|
||||
int32 intr = 7 [(nanopb).int_size=IS_16, (cust_field).v_int32=-1];
|
||||
gpio.config ena = 8 [(nanopb).int_size=IS_16, (cust_field).v_int32=-1];
|
||||
|
||||
|
||||
}
|
||||
@@ -1,73 +1,17 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
import "Common.proto";
|
||||
import "customoptions.proto";
|
||||
package sys.gpio;
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
enum LevelsEnum {
|
||||
L_LOW = 0;
|
||||
L_HIGH = 1;
|
||||
enum lvl {
|
||||
LOW = 0;
|
||||
HIGH = 1;
|
||||
}
|
||||
// GPIO to use for the specified function
|
||||
message GPIO {
|
||||
// GPIO to use for the specified function
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10130;
|
||||
int32 pin = 1 [(nanopb).int_size = IS_8, (cust_field).v_int32 = -1]; // a valid esp32 gpio pin that supports the intended mode
|
||||
LevelsEnum level = 2 [(cust_field).v_enum = "L_HIGH"]; // 0 or 1
|
||||
int32 pin = 1 [(nanopb).int_size = IS_8]; // a valid esp32 gpio pin that supports the intended mode
|
||||
lvl level = 2 ; // 0 or 1
|
||||
}
|
||||
enum LedTypesEnum {
|
||||
UNKNOWN = 0;
|
||||
LED_TYPE_GPIO = 1;
|
||||
LED_TYPE_WS2812 = 2;
|
||||
}
|
||||
message LED {
|
||||
option (nanopb_msgopt).msgid = 10029;
|
||||
GPIO gpio = 1 [(nanopb).int_size = IS_8]; // a valid esp32 gpio pin that supports the intended mode
|
||||
int32 brightness = 2 [(nanopb).int_size = IS_8]; // 0 to 100%
|
||||
LedTypesEnum led_type = 3;
|
||||
}
|
||||
message Gpios {
|
||||
option (nanopb_msgopt).msgid = 10030;
|
||||
LED greenLED = 1;
|
||||
LED redLED = 2;
|
||||
GPIO audioJack = 3;
|
||||
GPIO amp = 4;
|
||||
GPIO power = 5 ;
|
||||
GPIO jack = 6;
|
||||
GPIO spkfault = 7;
|
||||
GPIO Vcc = 8;
|
||||
GPIO GND = 9;
|
||||
}
|
||||
enum GPIOExpModelEnum {
|
||||
UNSPECIFIED_EXP = 0;
|
||||
PCA9535 = 1;
|
||||
PCA85XX = 2;
|
||||
MCP23017 = 3;
|
||||
MCP23S17 = 4;
|
||||
}
|
||||
|
||||
message GPIOExpI2C {
|
||||
option (nanopb_msgopt).msgid = 10032;
|
||||
PortEnum port = 5 [(cust_field).v_string = "SYSTEM"]; // Defaults to system
|
||||
}
|
||||
message GPIOExpSPI {
|
||||
option (nanopb_msgopt).msgid = 10031;
|
||||
int32 speed = 1 [(nanopb).int_size = IS_16];
|
||||
HostEnum host = 2;
|
||||
GPIO cs = 3;
|
||||
}
|
||||
message GPIOExp {
|
||||
option (nanopb_msgopt).msgid = 10033;
|
||||
GPIOExpModelEnum model = 1;
|
||||
int32 addr = 2 [(nanopb).int_size = IS_8];
|
||||
oneof ExpType {
|
||||
GPIOExpI2C i2c = 3;
|
||||
GPIOExpSPI spi = 4;
|
||||
}
|
||||
int32 base = 5 [(cust_field).v_int32 = 40]; // Defaults to 40
|
||||
int32 count = 6 [(cust_field).v_int32 = 16]; // Defaults to 16
|
||||
GPIO intr = 7;
|
||||
|
||||
|
||||
}
|
||||
23
protobuf/proto/Gpios.proto
Normal file
23
protobuf/proto/Gpios.proto
Normal file
@@ -0,0 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys.gpios;
|
||||
import "GPIO.proto";
|
||||
import "Led.proto";
|
||||
import "customoptions.proto";
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10030;
|
||||
led.config greenLED = 1;
|
||||
led.config redLED = 2;
|
||||
gpio.config audioJack = 3 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
gpio.config amp = 4 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
gpio.config power = 5 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
gpio.config jack = 6 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
gpio.config spkfault = 7 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
gpio.config Vcc = 8 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
gpio.config GND = 9 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
}
|
||||
@@ -1,19 +1,26 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
import "GPIO.proto";
|
||||
package sys.i2c;
|
||||
import "nanopb.proto";
|
||||
import "customoptions.proto";
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
enum I2CPortEnum {
|
||||
UNSPECIFIED_PORT = 0;
|
||||
I2CPort0 = 1;
|
||||
I2CPort1 = 2;
|
||||
enum port {
|
||||
UNSPECIFIED = 0;
|
||||
PORT0 = 1;
|
||||
PORT1 = 2;
|
||||
}
|
||||
message I2CBus {
|
||||
message bus {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10034;
|
||||
I2CPortEnum port = 1 ;
|
||||
int32 speed = 2 [(nanopb).int_size = IS_16];
|
||||
GPIO sda = 3;
|
||||
GPIO scl = 4;
|
||||
port port = 1 ;
|
||||
int64 speed = 2 [(cust_field).v_int64 = 400000];
|
||||
int32 sda = 3 [(nanopb).int_size=IS_16, (cust_field).v_int32=-1];
|
||||
int32 scl = 4 [(nanopb).int_size=IS_16, (cust_field).v_int32=-1];
|
||||
}
|
||||
message device {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10021;
|
||||
int32 address = 1 [(nanopb).int_size = IS_8];
|
||||
}
|
||||
19
protobuf/proto/Led.proto
Normal file
19
protobuf/proto/Led.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys.led;
|
||||
import "customoptions.proto";
|
||||
import "GPIO.proto";
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
enum types {
|
||||
UNKNOWN = 0;
|
||||
GPIO = 1;
|
||||
WS2812 = 2;
|
||||
}
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10029;
|
||||
gpio.config gpio = 1 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
int32 brightness = 2 [(nanopb).int_size = IS_8]; // 0 to 100%
|
||||
types led_type = 3;
|
||||
}
|
||||
9
protobuf/proto/MessageDefinition.proto
Normal file
9
protobuf/proto/MessageDefinition.proto
Normal file
@@ -0,0 +1,9 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
import "nanopb.proto";
|
||||
|
||||
message message_def{
|
||||
uint32 datasize = 1;
|
||||
bytes data = 2 [(nanopb).type = FT_POINTER];
|
||||
}
|
||||
23
protobuf/proto/Metadata.proto
Normal file
23
protobuf/proto/Metadata.proto
Normal file
@@ -0,0 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys.metadata;
|
||||
|
||||
import "Artwork.proto";
|
||||
import "nanopb.proto";
|
||||
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10036;
|
||||
// Optional parameters controlling bluetooth and airplay
|
||||
// Display format with optional keywords %artist%, %album%, %title%
|
||||
string format = 1 [(nanopb).max_length= 50];
|
||||
|
||||
// Scrolling speed in ms
|
||||
uint32 speed = 2 ;
|
||||
|
||||
// Pause time between scrolls in ms
|
||||
uint32 pause = 3;
|
||||
|
||||
// Cover art display configuration
|
||||
artwork.config artwork = 4;
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
package sys.names;
|
||||
|
||||
import "customoptions.proto";
|
||||
import "nanopb.proto";
|
||||
// Main system configuration definition. This gets loaded in a pointer
|
||||
// named platform-> which is available across the build
|
||||
message Names {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (cust_msg).init_from_mac = true;
|
||||
option (cust_msg).const_prefix = "squeezelite-";
|
||||
option (nanopb_msgopt).max_length= 128;
|
||||
|
||||
@@ -2,73 +2,139 @@ syntax = "proto3";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
|
||||
package sys;
|
||||
package sys.net;
|
||||
import "customoptions.proto";
|
||||
import "nanopb.proto";
|
||||
enum WifiAuthTypeEnum{
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
enum auth_types{
|
||||
AUTH_UNKNOWN = 0;
|
||||
AUTH_OPEN = 1;
|
||||
AUTH_WEP = 2;
|
||||
AUTH_WPA_PSK = 3;
|
||||
AUTH_WPA2_PSK = 4;
|
||||
AUTH_WPA_WPA2_PSK = 5;
|
||||
AUTH_WPA2_ENTERPRISE = 6;
|
||||
AUTH_WPA3_PSK = 7;
|
||||
AUTH_WPA2_WPA3_PSK = 8;
|
||||
AUTH_WAPI_PSK = 9;
|
||||
OPEN = 1;
|
||||
WEP = 2;
|
||||
WPA_PSK = 3;
|
||||
WPA2_PSK = 4;
|
||||
WPA_WPA2_PSK = 5;
|
||||
WPA2_ENTERPRISE = 6;
|
||||
WPA3_PSK = 7;
|
||||
WPA2_WPA3_PSK = 8;
|
||||
WAPI_PSK = 9;
|
||||
}
|
||||
enum WifiRadioTypesEnum {
|
||||
PHY_UNKNOWN = 0;
|
||||
enum radio_types {
|
||||
UNKNOWN = 0;
|
||||
PHY_11B = 1;
|
||||
PHY_11G = 2;
|
||||
PHY_11N = 3;
|
||||
PHY_LR = 4;
|
||||
PHY_WPS = 5;
|
||||
PHY_FTM_RESPONDER = 6;
|
||||
PHY_FTM_INITIATOR = 7;
|
||||
LR = 4;
|
||||
WPS = 5;
|
||||
FTM_RESPONDER = 6;
|
||||
FTM_INITIATOR = 7;
|
||||
}
|
||||
|
||||
message IP {
|
||||
message wifi_entry {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
string ssid = 1 [(nanopb).max_length = 32];
|
||||
string bssid = 2 [(nanopb).max_length = 32];
|
||||
uint32 channel = 3 [(nanopb).int_size = IS_8]; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/
|
||||
auth_types auth_type = 4;
|
||||
repeated radio_types radio_type = 5 [(nanopb).type = FT_POINTER];
|
||||
google.protobuf.Timestamp last_try = 6;
|
||||
google.protobuf.Timestamp last_seen = 7;
|
||||
bool connected = 8;
|
||||
string password = 9 [(nanopb).max_length = 64];
|
||||
uint32 rssi = 10 [(nanopb).max_length = 8];
|
||||
}
|
||||
message ip {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10051;
|
||||
string ip = 14 [(nanopb).max_length = 15];
|
||||
string netmask = 15 [(nanopb).max_length = 15];
|
||||
string gw = 16 [(nanopb).max_length = 15];
|
||||
}
|
||||
|
||||
message WifiSTAEntry {
|
||||
string ssid = 1 [(nanopb).max_length = 32];
|
||||
string bssid = 2 [(nanopb).max_length = 32];
|
||||
uint32 channel = 3 [(nanopb).int_size = IS_8]; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/
|
||||
WifiAuthTypeEnum auth_type = 4;
|
||||
WifiRadioTypesEnum radio_type = 5;
|
||||
google.protobuf.Timestamp last_try = 6;
|
||||
google.protobuf.Timestamp last_seen = 7;
|
||||
bool connected = 8;
|
||||
string password = 9 [(nanopb).max_length = 64];
|
||||
uint32 rssi = 10 [(nanopb).max_length = 8];
|
||||
}
|
||||
message WifiAP {
|
||||
IP ip = 1;
|
||||
string password = 2 [(nanopb).max_length = 64];
|
||||
uint32 channel = 3 [(nanopb).int_size = IS_8]; /**< channel of Access point AP. */
|
||||
WifiAuthTypeEnum auth_mode = 4 [(cust_field).v_enum = "AUTH_WPA2_PSK"];
|
||||
bool hidden = 5;
|
||||
|
||||
|
||||
message ap {
|
||||
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10059;
|
||||
/** @brief Defines the access point's IP, NETMASK and GATEWAY. The gateway
|
||||
* should be set to the same value as the access point IP address.
|
||||
* Defaults to IP="192.168.4.1", NETMASK="255.255.255.0", GATEWAY= "192.168.4.1"
|
||||
**/
|
||||
ip ip = 1 [(cust_field).v_msg = '{"ip":"192.168.4.1","netmask":"255.255.255.0","gw":"192.168.4.1"}'];
|
||||
string password = 2 [(nanopb).max_length = 64,(cust_field).v_string = "squeezelite"];
|
||||
/** @brief Defines access point's channel.
|
||||
* Channel selection is only effective when not connected to another AP.
|
||||
* Good practice for minimal channel interference to use
|
||||
* For 20 MHz: 1, 6 or 11 in USA and 1, 5, 9 or 13 in most parts of the world
|
||||
* For 40 MHz: 3 in USA and 3 or 11 in most parts of the world
|
||||
*/
|
||||
uint32 channel = 3 [(nanopb).int_size = IS_8,(cust_field).v_uint32 = 1];
|
||||
auth_types auth_mode = 4 [(cust_field).v_enum = "WPA2_PSK"];
|
||||
bool hidden = 5 [(cust_field).v_bool=false ];
|
||||
// Max allowed connections. 4 is recommended
|
||||
uint32 max_connection = 6 [(nanopb).int_size = IS_8];
|
||||
uint32 max_connection = 6 [(nanopb).int_size = IS_8,(cust_field).v_uint32 = 4];
|
||||
// Recommended value: 100
|
||||
uint32 beacon_interval = 7 [(nanopb).int_size = IS_16];
|
||||
uint32 beacon_interval = 7 [(nanopb).int_size = IS_16, (cust_field).v_uint32 = 100];
|
||||
|
||||
}
|
||||
message Server {
|
||||
message server {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10050;
|
||||
int32 cport = 1;
|
||||
int32 port = 2;
|
||||
string ip = 3 [(nanopb).max_length = 15];
|
||||
}
|
||||
message NetworkConfig {
|
||||
message config {
|
||||
enum ps_types {
|
||||
NONE = 0; /**< No power save */
|
||||
MIN_MODEM = 1; /**< Minimum modem power saving. In this mode, station wakes up to receive beacon every DTIM period */
|
||||
MAX_MODEM = 2; /**< Maximum modem power saving. In this mode, interval to receive beacons is determined by the listen_interval parameter in wifi_sta_config_t */
|
||||
}
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
bool disable_dhcp = 1;
|
||||
IP manual_ip = 2;
|
||||
ip manual_ip = 2;
|
||||
// Wifi Credentials
|
||||
repeated WifiSTAEntry credentials = 3 [ (nanopb).max_count = 5 ];
|
||||
WifiAP ap = 4;
|
||||
WifiSTAEntry last_connected = 5 ;
|
||||
}
|
||||
repeated wifi_entry credentials = 3 [(nanopb).type = FT_CALLBACK, (nanopb).callback_datatype = "sys_net_wifi_entry*"];
|
||||
ap ap = 4;
|
||||
uint32 sta_polling_max_s = 5 [(nanopb).int_size = IS_16, (cust_field).v_uint32 = 600];
|
||||
// access point teardown timer delay (s)
|
||||
uint32 ap_duration_s = 6 [(nanopb).int_size = IS_16, (cust_field).v_uint32 = 20];
|
||||
// background STA polling (s) used, amongst others, when an attempt to connect
|
||||
// to a known AP was made
|
||||
uint32 sta_polling_min_s = 7 [(nanopb).int_size = IS_16, (cust_field).v_uint32 = 15];
|
||||
uint32 dhcp_tmout_s = 8 [(nanopb).int_size = IS_16, (cust_field).v_uint32 = 30];
|
||||
bool eth_boot = 9 [(cust_field).v_bool = false];
|
||||
// number of times to try to connect to wifi when the connection is
|
||||
// dropped
|
||||
uint32 max_wifi_retry = 10 [(cust_field).v_uint32 = 3];
|
||||
// As input param, it stores max AP number ap_records can hold. As output param, it receives the
|
||||
// actual AP number this API returns. As a consequence, ap_num MUST be reset to MAX_AP_NUM at
|
||||
// every scan
|
||||
uint32 max_ap_num = 11 [(cust_field).v_uint32 = 15];
|
||||
/**
|
||||
* @brief Defines the maximum size of a SSID name. 32 is IEEE standard.
|
||||
* @warning limit is also hard coded in wifi_config_t. Never extend this value.
|
||||
*/
|
||||
uint32 max_ssid_size = 12 [(cust_field).v_uint32 = 32];
|
||||
/**
|
||||
* @brief Defines the maximum size of a WPA2 passkey. 64 is IEEE standard.
|
||||
* @warning limit is also hard coded in wifi_config_t. Never extend this value.
|
||||
*/
|
||||
uint32 max_password_size = 13 [(cust_field).v_uint32 = 64];
|
||||
|
||||
/** @brief Defines if wifi power save shall be enabled.
|
||||
* Value: WIFI_PS_NONE for full power (wifi modem always on)
|
||||
* Value: WIFI_PS_MODEM for power save (wifi modem sleep periodically)
|
||||
* Note: Power save is only effective when in STA only mode
|
||||
*/
|
||||
ps_types power_save_mode = 14 [(cust_field).v_enum = "MIN_MODEM"];
|
||||
// max number of times that a the system will try to connect to a
|
||||
// known access point if it wasn't already connected before
|
||||
uint32 max_initial_wifi_attempt = 15 [(cust_field).v_uint32 = 3];
|
||||
|
||||
// Connect to the first found access point matching the given SSID
|
||||
// Although this will reduce the boot-to-playback time, use with care
|
||||
// in an environment where several access points are configured with the same
|
||||
// SSID, as this does not guarantee that the AP with the best signal will
|
||||
// be connected to and result in instabilities.
|
||||
bool wifi_connect_fast_scan = 16;
|
||||
}
|
||||
|
||||
44
protobuf/proto/SPI.proto
Normal file
44
protobuf/proto/SPI.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys.spi;
|
||||
import "Common.proto";
|
||||
import "nanopb.proto";
|
||||
|
||||
import "customoptions.proto";
|
||||
// +-----+----------------+--------------+------------------------+--------------------+
|
||||
// |SPI | Clock polarity | Clock phase | Data is shifted out on | Data is sampled on |
|
||||
// |mode | (CPOL) | (CPHA) | | |
|
||||
// +-----+----------------+--------------+------------------------+--------------------+
|
||||
// | 0 | 0 | 0 | falling SCLK, and when | rising SCLK |
|
||||
// | | | | CS activates | |
|
||||
// +-----+----------------+--------------+------------------------+--------------------+
|
||||
// | 1 | 0 | 1 | rising SCLK | falling SCLK |
|
||||
// +-----+----------------+--------------+------------------------+--------------------+
|
||||
// | 2 | 1 | 0 | rising SCLK, and when | falling SCLK |
|
||||
// | | | | CS activates | |
|
||||
// +-----+----------------+--------------+------------------------+--------------------+
|
||||
// | 3 | 1 | 1 | falling SCLK | rising SCLK |
|
||||
// +-----+----------------+--------------+------------------------+--------------------+
|
||||
enum mode {
|
||||
M_0 = 0;
|
||||
M_1 = 1;
|
||||
M_2 = 2;
|
||||
M_3 = 3;
|
||||
}
|
||||
message bus {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10016;
|
||||
int32 mosi = 1 [(cust_field).v_int32=-1];
|
||||
int32 miso = 2 [(cust_field).v_int32=-1];
|
||||
int32 clk = 3 [(cust_field).v_int32=-1];
|
||||
int32 dc = 4 [(cust_field).v_int32=-1];
|
||||
dev.common.hosts host = 5; // Defaults to Host1 in your application logic
|
||||
|
||||
}
|
||||
message device {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10022;
|
||||
int32 cs = 1 [(nanopb).int_size=IS_16, (cust_field).v_int32=-1];
|
||||
int32 speed = 4;
|
||||
mode mode = 5;
|
||||
}
|
||||
@@ -1,76 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys;
|
||||
package sys.services;
|
||||
|
||||
import "GPIO.proto";
|
||||
import "Artwork.proto";
|
||||
import "Spotify.proto";
|
||||
import "AirPlay.proto";
|
||||
import "Squeezelite.proto";
|
||||
import "Equalizer.proto";
|
||||
import "Metadata.proto";
|
||||
import "Sleep.proto";
|
||||
import "Spotify.proto";
|
||||
import "Squeezelite.proto";
|
||||
import "Telnet.proto";
|
||||
|
||||
import "nanopb.proto";
|
||||
import "customoptions.proto";
|
||||
|
||||
// Configuration for sleep service
|
||||
message SleepService {
|
||||
option (nanopb_msgopt).msgid = 10035;
|
||||
// Inactivity in minutes before going to sleep
|
||||
uint32 delay = 1;
|
||||
|
||||
// Inactivity delay in minutes after which sleep resumes
|
||||
int32 spurious = 2 [(nanopb).int_size = IS_16];
|
||||
|
||||
// GPIO for sleep
|
||||
GPIO sleep = 3;
|
||||
|
||||
// List of GPIOs that will cause the system to wake up
|
||||
repeated GPIO wake = 4 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 10];
|
||||
|
||||
// List of RTC GPIOs to keep active
|
||||
repeated GPIO rtc = 5 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 10];
|
||||
|
||||
// Threshold in volts under which the system will enter into sleep
|
||||
float batt = 6;
|
||||
}
|
||||
message Telnet {
|
||||
bool enable = 1;
|
||||
uint32 block = 2 [(nanopb).int_size = IS_16];
|
||||
uint32 buffer = 3 [(nanopb).int_size = IS_16];
|
||||
|
||||
}
|
||||
message Metadata {
|
||||
option (nanopb_msgopt).msgid = 10036;
|
||||
// Optional parameters controlling bluetooth and airplay
|
||||
// Display format with optional keywords %artist%, %album%, %title%
|
||||
string format = 1 [(nanopb).max_length= 50];
|
||||
|
||||
// Scrolling speed in ms
|
||||
uint32 speed = 2 ;
|
||||
|
||||
// Pause time between scrolls in ms
|
||||
uint32 pause = 3;
|
||||
|
||||
// Cover art display configuration
|
||||
Artwork artwork = 4;
|
||||
}
|
||||
|
||||
message BluetoothSink {
|
||||
bool enabled = 1;
|
||||
message bt_sink {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
bool enabled = 1 [(cust_field).v_bool = true];
|
||||
uint32 volume = 2;
|
||||
string pin = 3 [(nanopb).max_length = 16,(cust_field).v_string = "0000" ];
|
||||
|
||||
string pin= 3 [(nanopb).max_length = 16,(cust_field).v_string = "0000" ];
|
||||
}
|
||||
|
||||
message Services {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10037;
|
||||
Metadata metadata = 1;
|
||||
SleepService sleep = 2;
|
||||
Spotify cspot = 4;
|
||||
AirPlay airplay = 5;
|
||||
Squeezelite squeezelite = 6;
|
||||
metadata.config metadata = 1;
|
||||
sleep.config sleep = 2;
|
||||
spotify.config cspot = 4;
|
||||
airplay.config airplay = 5;
|
||||
repeated squeezelite.profile squeezelite_profiles = 6 [(nanopb).max_count = 5,
|
||||
(cust_field).v_msg = '[{"name":"i2s","profile":{"output_type":"I2S","log":{"output":"DEBUG","stream":"DEBUG","decode":"DEBUG","slimproto":"DEBUG","ir":"DEBUG"},"buffers":{"stream":500,"output":2000},"max_rate":96000,"enabled":true,"amp_gpio_timeout":30,"wav_aiff_header_parsing":true}},{"name":"spdif","profile":{"output_type":"SPDIF","log":{"output":"DEBUG","stream":"DEBUG","decode":"DEBUG","slimproto":"DEBUG","ir":"DEBUG"},"buffers":{"stream":500,"output":2000},"max_rate":48000,"enabled":true,"amp_gpio_timeout":30,"wav_aiff_header_parsing":true}},{"name":"bluetooth","profile":{"output_type":"BT","log":{"output":"DEBUG","stream":"DEBUG","decode":"DEBUG","slimproto":"DEBUG","ir":"DEBUG"},"buffers":{"stream":500,"output":2000},"max_rate":44100,"enabled":true,"amp_gpio_timeout":30,"wav_aiff_header_parsing":true}}]'] ;
|
||||
string release_url = 7 [(nanopb).max_length = 256, (cust_field).v_string = "https://api.github.com/repos/sle118/squeezelite-esp32/releases"];
|
||||
BluetoothSink bt_sink = 8;
|
||||
bt_sink bt_sink = 8;
|
||||
bool statistics = 9 [(cust_field).v_bool = false];
|
||||
Telnet telnet = 10;
|
||||
Equalizer equalizer = 11;
|
||||
}
|
||||
telnet.config telnet = 10;
|
||||
equalizer.config equalizer = 11;
|
||||
string current_profile = 12 [(nanopb).type = FT_POINTER, (cust_field).v_string = "i2s"];
|
||||
// default time zone is Montreal.
|
||||
// see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
// or for a handy list: https://gist.github.com/alwynallan/24d96091655391107939
|
||||
string timezone = 13 [(nanopb).type = FT_POINTER, (cust_field).v_string = "EST5EDT,M3.2.0,M11.1.0"];
|
||||
}
|
||||
31
protobuf/proto/Sleep.proto
Normal file
31
protobuf/proto/Sleep.proto
Normal file
@@ -0,0 +1,31 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys.sleep;
|
||||
import "GPIO.proto";
|
||||
import "nanopb.proto";
|
||||
import "customoptions.proto";
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
// Configuration for sleep service
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10035;
|
||||
// Inactivity in minutes before going to sleep
|
||||
uint32 delay = 1;
|
||||
|
||||
// Inactivity delay in minutes after which sleep resumes
|
||||
int32 spurious = 2 [(nanopb).int_size = IS_16];
|
||||
|
||||
// pinfor sleep
|
||||
gpio.config sleep = 3 [(cust_field).v_msg='{"pin":-1,"level":"LOW"}'];
|
||||
|
||||
// List of GPIOs that will cause the system to wake up
|
||||
repeated gpio.config wake = 4 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 10];
|
||||
|
||||
// List of RTC GPIOs to keep active
|
||||
repeated gpio.config rtc = 5 [(nanopb).type = FT_POINTER]; //[(nanopb).max_count= 10];
|
||||
|
||||
// Threshold in volts under which the system will enter into sleep
|
||||
float batt = 6;
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
syntax = "proto3";
|
||||
import "customoptions.proto";
|
||||
import "nanopb.proto";
|
||||
package sys;
|
||||
message Spotify {
|
||||
package sys.spotify;
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10038;
|
||||
bool enabled = 1;
|
||||
bool enabled = 1 [(cust_field).v_bool = true];
|
||||
uint32 bitrate = 2 [(nanopb).int_size = IS_16];
|
||||
bool zeroconf = 3 [(cust_field).v_bool = true] ;
|
||||
uint32 volume = 4 ;
|
||||
|
||||
@@ -3,54 +3,56 @@ import "customoptions.proto";
|
||||
import "nanopb.proto";
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
package sys;
|
||||
enum OutputTypeEnum {
|
||||
OUTPUT_UNKNOWN = 0;
|
||||
OUTPUT_I2S = 1;
|
||||
OUTPUT_SPDIF = 2;
|
||||
OUTPUT_Bluetooth = 3;
|
||||
package sys.squeezelite;
|
||||
enum outputs {
|
||||
UNKNOWN = 0;
|
||||
I2S = 1;
|
||||
SPDIF = 2;
|
||||
BT = 3;
|
||||
}
|
||||
message OutputBT {
|
||||
message bt {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10039;
|
||||
string sink_name = 1 [(nanopb).max_length= 128];
|
||||
string pin = 2 [(nanopb).max_length= 16];
|
||||
}
|
||||
// Enum for the type of resampling algorithm
|
||||
enum ResampleAlgorithm {
|
||||
RA_DISABLED = 0;
|
||||
RA_BASIC_LINEAR = 1; // Basic linear interpolation
|
||||
RA_THIRTEEN_TAPS = 2; // 13 taps
|
||||
RA_TWENTY_ONE_TAPS = 3; // 21 taps
|
||||
enum algorythms {
|
||||
DISABLED = 0;
|
||||
BASIC_LINEAR = 1; // Basic linear interpolation
|
||||
THIRTEEN_TAPS = 2; // 13 taps
|
||||
TWENTY_ONE_TAPS = 3; // 21 taps
|
||||
}
|
||||
|
||||
// ResampleOptions represents the resampling options for Squeezelite
|
||||
message ResampleOptions {
|
||||
message options {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10040;
|
||||
ResampleAlgorithm algorithm = 1; // The resampling algorithm to use
|
||||
algorythms algorithm = 1; // The resampling algorithm to use
|
||||
bool interpolate_filter_coefficients = 2; // Whether to interpolate filter coefficients
|
||||
}
|
||||
|
||||
enum SampleRate {
|
||||
SAMPLE_RATE_UNSPECIFIED = 0; // Default value, can be used to represent an unspecified rate
|
||||
SAMPLE_RATE_8000 = 8000;
|
||||
SAMPLE_RATE_11025 = 11025;
|
||||
SAMPLE_RATE_12000 = 12000;
|
||||
SAMPLE_RATE_16000 = 16000;
|
||||
SAMPLE_RATE_22050 = 22050;
|
||||
SAMPLE_RATE_24000 = 24000;
|
||||
SAMPLE_RATE_32000 = 32000;
|
||||
SAMPLE_RATE_44100 = 44100;
|
||||
SAMPLE_RATE_48000 = 48000;
|
||||
SAMPLE_RATE_88200 = 88200;
|
||||
SAMPLE_RATE_96000 = 96000;
|
||||
SAMPLE_RATE_176400 = 176400;
|
||||
SAMPLE_RATE_192000 = 192000;
|
||||
SAMPLE_RATE_352800 = 352800;
|
||||
SAMPLE_RATE_384000 = 384000;
|
||||
SAMPLE_RATE_705600 = 705600;
|
||||
SAMPLE_RATE_768000 = 768000;
|
||||
enum rates {
|
||||
R_NONE = 0; // Default value, can be used to represent an unspecified rate
|
||||
R_8000 = 8000;
|
||||
R_11025 = 11025;
|
||||
R_12000 = 12000;
|
||||
R_16000 = 16000;
|
||||
R_22050 = 22050;
|
||||
R_24000 = 24000;
|
||||
R_32000 = 32000;
|
||||
R_44100 = 44100;
|
||||
R_48000 = 48000;
|
||||
R_88200 = 88200;
|
||||
R_96000 = 96000;
|
||||
R_176400 = 176400;
|
||||
R_192000 = 192000;
|
||||
R_352800 = 352800;
|
||||
R_384000 = 384000;
|
||||
R_705600 = 705600;
|
||||
R_768000 = 768000;
|
||||
}
|
||||
enum DebugLevelEnum {
|
||||
enum debug_levels {
|
||||
DEFAULT = 0;
|
||||
ERROR = 1;
|
||||
WARN = 2;
|
||||
@@ -58,7 +60,7 @@ enum DebugLevelEnum {
|
||||
DEBUG = 4;
|
||||
SDEBUG = 5;
|
||||
}
|
||||
enum CodexEnum {
|
||||
enum codecs {
|
||||
c_undefined = 0;
|
||||
c_alac = 1;
|
||||
c_ogg = 2;
|
||||
@@ -69,32 +71,37 @@ enum CodexEnum {
|
||||
c_mad = 7;
|
||||
c_mpg = 8;
|
||||
}
|
||||
message RatesOption {
|
||||
message rates_opt {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10041;
|
||||
SampleRate min = 1;
|
||||
SampleRate max = 2;
|
||||
repeated SampleRate list = 3 [(nanopb).type = FT_POINTER]; // [(nanopb).max_count= 10];
|
||||
rates min = 1;
|
||||
rates max = 2;
|
||||
repeated rates list = 3 [(nanopb).type = FT_POINTER]; // [(nanopb).max_count= 10];
|
||||
}
|
||||
message BufferOption {
|
||||
message buffer_opt {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10042;
|
||||
uint32 stream = 1 [(cust_field).v_uint32 = 500];
|
||||
uint32 output = 2 [(cust_field).v_uint32 = 2000];
|
||||
}
|
||||
message DebugOptions {
|
||||
DebugLevelEnum output = 1 [(cust_field).v_string = "WARN"];
|
||||
DebugLevelEnum stream = 2 [(cust_field).v_string = "WARN"];
|
||||
DebugLevelEnum decode = 3 [(cust_field).v_string = "WARN"];
|
||||
DebugLevelEnum slimproto = 4 [(cust_field).v_string = "WARN"];
|
||||
DebugLevelEnum ir = 5 [(cust_field).v_string = "WARN"];
|
||||
message logging_opt {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
debug_levels output = 1 [(cust_field).v_string = "DEBUG"];
|
||||
debug_levels stream = 2 [(cust_field).v_string = "DEBUG"];
|
||||
debug_levels decode = 3 [(cust_field).v_string = "DEBUG"];
|
||||
debug_levels slimproto = 4 [(cust_field).v_string = "DEBUG"];
|
||||
debug_levels ir = 5 [(cust_field).v_string = "DEBUG"];
|
||||
debug_levels all = 6 [(cust_field).v_string = "DEBUG"];
|
||||
}
|
||||
|
||||
message Squeezelite {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10044;
|
||||
// Output device configuration
|
||||
OutputTypeEnum output_type = 1 [(cust_field).v_string = "OUTPUT_I2S"];
|
||||
outputs output_type = 1 ;
|
||||
|
||||
// Sample rates supported
|
||||
RatesOption rates = 2;
|
||||
rates_opt rates = 2;
|
||||
|
||||
// Timeout (seconds) for switching off amp GPIO
|
||||
// default is to keep the device 'on' all the time
|
||||
@@ -109,19 +116,24 @@ message Squeezelite {
|
||||
|
||||
// Allow disabling squeezelite to use the
|
||||
// device in "detached mode"
|
||||
bool enabled = 7;
|
||||
bool enabled = 7 [(cust_field).v_bool = true];
|
||||
|
||||
OutputBT output_bt = 8;
|
||||
bt output_bt = 8;
|
||||
|
||||
// enable debugging here
|
||||
DebugOptions log = 9 ;
|
||||
logging_opt log = 9 ;
|
||||
|
||||
// Max sample rate reported to server
|
||||
uint32 max_rate = 10;
|
||||
|
||||
BufferOption buffers = 11;
|
||||
buffer_opt buffers = 11;
|
||||
string resample = 12 [(nanopb).type = FT_POINTER];
|
||||
repeated CodexEnum included_codex = 13 [(nanopb).type = FT_POINTER];
|
||||
repeated CodexEnum excluded_codex = 14 [(nanopb).type = FT_POINTER];
|
||||
repeated codecs included_codex = 13 [(nanopb).type = FT_POINTER];
|
||||
repeated codecs excluded_codex = 14 [(nanopb).type = FT_POINTER];
|
||||
|
||||
}
|
||||
message profile {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
string name = 1 [(nanopb).type = FT_POINTER];
|
||||
config profile = 2 ;
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
syntax = "proto3";
|
||||
package sys;
|
||||
package sys.state;
|
||||
import "Network.proto";
|
||||
import "Equalizer.proto";
|
||||
import "nanopb.proto";
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
message State {
|
||||
WifiSTAEntry connected_sta = 1;
|
||||
Server lms = 2;
|
||||
message data {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10058;
|
||||
sys.net.wifi_entry connected_sta = 1;
|
||||
sys.net.server lms = 2;
|
||||
string ota_url = 3 [(nanopb).type = FT_POINTER];
|
||||
string cspot_credentials = 4 [(nanopb).type = FT_POINTER];
|
||||
int32 bt_sink_volume = 5 ;
|
||||
Equalizer equalizer = 6;
|
||||
equalizer.config equalizer = 6;
|
||||
string target = 7 [(nanopb).type = FT_POINTER];
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
syntax = "proto3";
|
||||
package sys;
|
||||
package sys.status;
|
||||
import "Network.proto";
|
||||
import "nanopb.proto";
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
// Enum for APP_AV_STATE
|
||||
enum CONNECTED_IF {
|
||||
enum interfaces {
|
||||
IF_UNKNOWN = 0;
|
||||
IF_WIFI = 1;
|
||||
IF_ETHERNET = 2;
|
||||
}
|
||||
enum AV_STATE {
|
||||
enum av_states {
|
||||
A_IDLE = 0;
|
||||
A_DISCOVERING = 1;
|
||||
A_DISCOVERED = 2;
|
||||
@@ -19,14 +19,14 @@ enum AV_STATE {
|
||||
A_CONNECTED = 5;
|
||||
A_DISCONNECTING = 6;
|
||||
}
|
||||
enum MEDIA_STATE {
|
||||
enum media_states {
|
||||
M_IDLE = 0;
|
||||
M_STARTING = 1;
|
||||
M_STARTED = 2;
|
||||
M_STOPPING = 3;
|
||||
M_WAIT_DISCONNECT = 4;
|
||||
}
|
||||
enum UPDATE_REASONS {
|
||||
enum reasons {
|
||||
R_UNKNOWN = 0;
|
||||
R_CONNECTION_OK = 1;
|
||||
R_FAILED_ATTEMPT = 2;
|
||||
@@ -36,7 +36,7 @@ enum AV_STATE {
|
||||
R_ETHERNET_CONNECTED = 6;
|
||||
}
|
||||
// Enum for ESP_AVRC_CT
|
||||
enum ESP_AVRC_CT {
|
||||
enum avrc_ct {
|
||||
ESP_AVRC_CT_CONNECTION_STATE_EVT = 0;
|
||||
ESP_AVRC_CT_PASSTHROUGH_RSP_EVT = 1;
|
||||
ESP_AVRC_CT_METADATA_RSP_EVT = 2;
|
||||
@@ -46,7 +46,7 @@ enum AV_STATE {
|
||||
ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT = 6;
|
||||
ESP_AVRC_CT_SET_ABSOLUTE_VOLUME_RSP_EVT = 7;
|
||||
}
|
||||
enum NetworkStates {
|
||||
enum net_states {
|
||||
NET_UNKNOWN = 0;
|
||||
NET_INSTANTIATED = 1;
|
||||
NET_INITIALIZING = 2;
|
||||
@@ -54,7 +54,7 @@ enum AV_STATE {
|
||||
NET_WIFI_ACTIVE = 4;
|
||||
NET_WIFI_CONFIGURING_ACTIVE = 5;
|
||||
}
|
||||
enum EthStates {
|
||||
enum eth_states {
|
||||
ETH_UNKNOWN = 0;
|
||||
ETH_STARTING = 1;
|
||||
ETH_ACTIVE_LINKUP = 2;
|
||||
@@ -62,7 +62,7 @@ enum AV_STATE {
|
||||
ETH_ACTIVE_CONNECTED = 4;
|
||||
ETH_CONNECTING_NEW = 5;
|
||||
}
|
||||
enum WifiState {
|
||||
enum wifi_States {
|
||||
WIFI_UNKNOWN = 0;
|
||||
WIFI_INITIALIZING = 1;
|
||||
WIFI_CONNECTING = 2;
|
||||
@@ -74,52 +74,60 @@ enum AV_STATE {
|
||||
}
|
||||
|
||||
|
||||
message WIFI {
|
||||
message wifi {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10052;
|
||||
WifiSTAEntry connected_sta = 1;
|
||||
sys.net.wifi_entry connected_sta = 1;
|
||||
int32 disconnect_count = 2;
|
||||
float avg_conn_time = 3;
|
||||
repeated WifiSTAEntry scan_result = 4 [ (nanopb).type = FT_POINTER ];
|
||||
WifiState wifi_state = 5;
|
||||
repeated sys.net.wifi_entry scan_result = 4 [(nanopb).type = FT_CALLBACK, (nanopb).callback_datatype = "sys_net_wifi_entry*"];
|
||||
wifi_States wifi_state = 5;
|
||||
}
|
||||
message NET {
|
||||
message net {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10053;
|
||||
WIFI wifi = 1;
|
||||
IP ip = 2;
|
||||
NetworkStates network_state = 5;
|
||||
EthStates eth_state = 6;
|
||||
wifi wifi = 1;
|
||||
sys.net.ip ip = 2;
|
||||
net_states network_state = 5;
|
||||
eth_states eth_state = 6;
|
||||
bool eth_up = 7;
|
||||
UPDATE_REASONS updt_reason = 8;
|
||||
CONNECTED_IF interface = 9;
|
||||
reasons updt_reason = 8;
|
||||
interfaces interface = 9;
|
||||
|
||||
}
|
||||
message BT {
|
||||
message bt {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10054;
|
||||
AV_STATE bt_status = 1;
|
||||
ESP_AVRC_CT bt_sub_status = 2;
|
||||
MEDIA_STATE bt_media_state = 3;
|
||||
av_states bt_status = 1;
|
||||
avrc_ct bt_sub_status = 2;
|
||||
media_states bt_media_state = 3;
|
||||
}
|
||||
message PLATFORM {
|
||||
message platform {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10055;
|
||||
string project = 1 [(nanopb).max_length = 128];
|
||||
string version = 2 [(nanopb).max_length = 25];
|
||||
bool recovery = 3;
|
||||
string name = 4 [(nanopb).max_length = 55];
|
||||
string target = 4 [(nanopb).type = FT_POINTER];
|
||||
int32 depth = 5;
|
||||
}
|
||||
message HW {
|
||||
message hw {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10056;
|
||||
bool jack_inserted = 1;
|
||||
float batt_voltage = 2;
|
||||
bool has_jack_inserted = 3;
|
||||
bool supports_jack_inserted = 3;
|
||||
bool spk_fault = 4;
|
||||
bool has_spk_fault = 5;
|
||||
bool supports_spk_fault = 5;
|
||||
}
|
||||
message Status {
|
||||
message data {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
option (nanopb_msgopt).msgid = 10057;
|
||||
PLATFORM platform = 1;
|
||||
HW hw = 2;
|
||||
BT bt = 3;
|
||||
Server LMS = 4;
|
||||
NET net = 5;
|
||||
platform platform = 1;
|
||||
hw hw = 2;
|
||||
bt bt = 3;
|
||||
sys.net.server LMS = 4;
|
||||
net net = 5;
|
||||
|
||||
|
||||
}
|
||||
|
||||
20
protobuf/proto/Telnet.proto
Normal file
20
protobuf/proto/Telnet.proto
Normal file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sys.telnet;
|
||||
import "nanopb.proto";
|
||||
import "customoptions.proto";
|
||||
|
||||
option (nanopb_fileopt).enum_to_string = true;
|
||||
|
||||
enum output {
|
||||
SERIAL_ONLY = 0;
|
||||
TELNET = 1;
|
||||
TELNET_SERIAL = 2;
|
||||
}
|
||||
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
output enable = 1 [(cust_field).v_enum = "TELNET_SERIAL"];
|
||||
uint32 block = 2 [(nanopb).int_size = IS_16, (cust_field).v_uint32=500];
|
||||
uint32 buffer = 3 [(nanopb).int_size = IS_16, (cust_field).v_uint32=40000];
|
||||
}
|
||||
@@ -3,7 +3,7 @@ syntax = "proto3";
|
||||
package sys;
|
||||
|
||||
import "Services.proto";
|
||||
import "GPIO.proto";
|
||||
import "Gpios.proto";
|
||||
import "Devices.proto";
|
||||
import "Names.proto";
|
||||
import "Network.proto";
|
||||
@@ -12,7 +12,8 @@ import "nanopb.proto";
|
||||
|
||||
|
||||
// Main configuration structure
|
||||
message Config {
|
||||
message config {
|
||||
option (nanopb_msgopt).packed_struct = true;
|
||||
|
||||
// Provides the global name for the pointer to
|
||||
// protoc plugins
|
||||
@@ -20,23 +21,22 @@ message Config {
|
||||
option (nanopb_msgopt).msgid = 1000;
|
||||
|
||||
// GPIO structure definition with leds, etc
|
||||
Gpios gpios = 1;
|
||||
sys.gpios.config gpios = 1;
|
||||
|
||||
// Device tree with SPI, I2C, SPDIF, Display, etc
|
||||
Dev dev = 2;
|
||||
dev.config dev = 2;
|
||||
|
||||
// Platform services definition with options
|
||||
Services services = 3 ;
|
||||
services.config services = 3 ;
|
||||
|
||||
// Main device name used for networking, etc. Services which
|
||||
// need a name typically has the option to overwrite its own name
|
||||
Names names = 4;
|
||||
sys.names.config names = 4;
|
||||
|
||||
// Hardware platform (e.g. SqueezeAMP, MUSE, etc.)
|
||||
string platform = 5 [(nanopb).type = FT_POINTER];
|
||||
|
||||
NetworkConfig net = 6;
|
||||
string target = 7 [(nanopb).max_length = 55];
|
||||
// Hardware target (e.g. SqueezeAMP, MUSE, etc.)
|
||||
string target = 5 [(nanopb).type = FT_POINTER];
|
||||
sys.net.config net = 6;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ message CustomOptions {
|
||||
bool v_bool = 50057;
|
||||
string v_enum = 50058 [(nanopb).type = FT_POINTER];
|
||||
bytes v_bytes = 50059 [(nanopb).type = FT_POINTER];
|
||||
bytes v_msg = 50060 [(nanopb).type = FT_POINTER];
|
||||
}
|
||||
|
||||
string global_name = 50005 [(nanopb).type = FT_POINTER];
|
||||
@@ -26,18 +27,18 @@ message CustomOptions {
|
||||
|
||||
|
||||
extend google.protobuf.FileOptions {
|
||||
optional CustomOptions cust_file = 2010;
|
||||
CustomOptions cust_file = 2010;
|
||||
}
|
||||
|
||||
|
||||
extend google.protobuf.MessageOptions {
|
||||
optional CustomOptions cust_msg = 2010;
|
||||
CustomOptions cust_msg = 2010;
|
||||
}
|
||||
|
||||
extend google.protobuf.EnumOptions {
|
||||
optional CustomOptions cust_enum = 2010;
|
||||
CustomOptions cust_enum = 2010;
|
||||
}
|
||||
|
||||
extend google.protobuf.FieldOptions {
|
||||
optional CustomOptions cust_field = 2010;
|
||||
CustomOptions cust_field = 2010;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user