SGF22: new F22S sub protocol

This commit is contained in:
pascallanger
2024-09-02 18:14:25 +02:00
parent edaee63f16
commit 64ea7111ac
7 changed files with 40 additions and 17 deletions

View File

@@ -180,6 +180,7 @@ const char STR_SUBTYPE_MOULDKG[] = "\x06""Analog""Digit\0";
const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320""ZCZ50\0";
const char STR_SUBTYPE_E129[] = "\x04""E129""C186";
const char STR_SUBTYPE_FX[] = "\x04""816\0""620\0""9630""Q560";
const char STR_SUBTYPE_SGF22[] = "\x04""F22\0""F22S";
#define NO_SUBTYPE nullptr
#ifdef SEND_CPPM
@@ -454,7 +455,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_SCORPIO, STR_SCORPIO, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_CYRF, SCORPIO_init, SCORPIO_callback },
#endif
#if defined(SGF22_NRF24L01_INO)
{PROTO_SGF22, STR_SGF22, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SGF22_init, SGF22_callback },
{PROTO_SGF22, STR_SGF22, STR_SUBTYPE_SGF22, 2, OPTION_NONE, 0, 0, SW_NRF, SGF22_init, SGF22_callback },
#endif
#if defined(SHENQI_NRF24L01_INO)
{PROTO_SHENQI, STR_SHENQI, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, SHENQI_init, SHENQI_callback },
@@ -559,7 +560,10 @@ uint16_t PROTOLIST_callback()
Serial_write(multi_protocols[option].protocol);
//Protocol name
for(uint8_t i=0;i<proto_len;i++)
{
Serial_write(multi_protocols[option].ProtoString[i]);
//debug("%c",multi_protocols[option].ProtoString[i]);
}
//Flags
uint8_t flags=0;
#ifdef FAILSAFE_ENABLE
@@ -569,14 +573,19 @@ uint16_t PROTOLIST_callback()
if(multi_protocols[option].chMap)
flags |= 0x02; //Disable_ch_mapping supported
Serial_write( flags | (multi_protocols[option].optionType<<4)); // flags && option type
//debug(" Flag=%02X",flags | (multi_protocols[option].optionType<<4));
//Number of sub protocols
Serial_write(nbr_sub);
//debug(" NSub=%02X ",nbr_sub);
if(nbr_sub !=0 )
{//Sub protocols length and texts
for(uint8_t i=0;i<=nbr_sub*sub_len;i++)
{
Serial_write(multi_protocols[option].SubProtoString[i]);
//debug("%c",multi_protocols[option].SubProtoString[i]);
}
}
//debugln("");
}
}
return 1000;