Proto list: add number of protocols in the list

This commit is contained in:
Pascal Langer 2021-09-08 14:30:01 +02:00
parent 5bab5f03db
commit ffe4ac68fd
2 changed files with 6 additions and 4 deletions

View File

@ -478,7 +478,7 @@ uint16_t PROTOLIST_callback()
{//Only send once {//Only send once
/* Type 0x11 Protocol list export via telemetry. Used by the protocol PROTO_PROTOLIST=0, the list entry is given by the option field. /* Type 0x11 Protocol list export via telemetry. Used by the protocol PROTO_PROTOLIST=0, the list entry is given by the option field.
length: variable length: variable
data[0] = protocol number, 0xFF is an invalid list entry (Option value too large) data[0] = protocol number, 0xFF is an invalid list entry (Option value too large), Option == 0xFF -> number of protocols in the list
data[1..n] = protocol name null terminated data[1..n] = protocol name null terminated
data[n+1] = flags data[n+1] = flags
flags>>4 Option text number to be displayed (check multi status for description) flags>>4 Option text number to be displayed (check multi status for description)
@ -494,8 +494,10 @@ uint16_t PROTOLIST_callback()
{//option is above the end of the list {//option is above the end of the list
//Header //Header
multi_send_header(MULTI_TELEMETRY_PROTO, 1); multi_send_header(MULTI_TELEMETRY_PROTO, 1);
//Error if(option == 0xFF)
Serial_write(0xFF); Serial_write((sizeof(multi_protocols)/sizeof(mm_protocol_definition)) - 1); //Nbr proto
else
Serial_write(0xFF); //Error
} }
else else
{//valid option value {//valid option value

View File

@ -1294,7 +1294,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
Type 0x11 Protocol list export via telemetry. Used by the protocol PROTO_PROTOLIST=0, the list entry is given by the option field. Type 0x11 Protocol list export via telemetry. Used by the protocol PROTO_PROTOLIST=0, the list entry is given by the option field.
length: variable length: variable
data[0] = protocol number, 0xFF is an invalid list entry (Option value too large) data[0] = protocol number, 0xFF is an invalid list entry (Option value too large), Option == 0xFF -> number of protocols in the list
data[1..n] = protocol name null terminated data[1..n] = protocol name null terminated
data[n+1] = flags data[n+1] = flags
flags>>4 Option text number to be displayed (check multi status for description) flags>>4 Option text number to be displayed (check multi status for description)