Bayang DHD D4 sub protocol

This commit is contained in:
Pascal Langer 2019-05-09 18:23:19 +02:00
parent a58d7a4d79
commit 511f77f5e7
5 changed files with 24 additions and 5 deletions

View File

@ -80,6 +80,12 @@ static void __attribute__((unused)) BAYANG_send_packet(uint8_t bind)
packet[10] = 0x30; packet[10] = 0x30;
packet[11] = 0x01; packet[11] = 0x01;
break; break;
case DHD_D4:
packet[10] = 0xC8;
packet[11] = 0x99;
packet[12] = 0x17;
packet[13] = 0xED;
break;
default: default:
packet[10] = rx_tx_addr[0]; // txid[0] packet[10] = rx_tx_addr[0]; // txid[0]
packet[11] = rx_tx_addr[1]; // txid[1] packet[11] = rx_tx_addr[1]; // txid[1]
@ -106,7 +112,10 @@ static void __attribute__((unused)) BAYANG_send_packet(uint8_t bind)
packet[1] = convert_channel_8b(CH14); packet[1] = convert_channel_8b(CH14);
} }
else else
packet[1] = 0xFA; // normal mode is 0xf7, expert 0xfa if(sub_protocol!=DHD_D4)
packet[1] = 0xFA; // normal mode is 0xf7, expert 0xfa
else
packet[1] = 0xF4;
//Flags packet[2] //Flags packet[2]
packet[2] = 0x00; packet[2] = 0x00;
@ -164,6 +173,10 @@ static void __attribute__((unused)) BAYANG_send_packet(uint8_t bind)
packet[12] = 0xE0; packet[12] = 0xE0;
packet[13] = 0x2E; packet[13] = 0x2E;
break; break;
case DHD_D4:
packet[12] = 0x37;
packet[13] = 0xED;
break;
default: default:
packet[12] = rx_tx_addr[2]; // txid[2] packet[12] = rx_tx_addr[2]; // txid[2]
if (option & BAYANG_OPTION_FLAG_ANALOGAUX) if (option & BAYANG_OPTION_FLAG_ANALOGAUX)
@ -325,7 +338,10 @@ uint16_t BAYANG_callback()
static void __attribute__((unused)) BAYANG_initialize_txid() static void __attribute__((unused)) BAYANG_initialize_txid()
{ {
//Could be using txid[0..2] but using rx_tx_addr everywhere instead... //Could be using txid[0..2] but using rx_tx_addr everywhere instead...
hopping_frequency[0]=0; if(sub_protocol==DHD_D4)
hopping_frequency[0]=(rx_tx_addr[2]&0x07)|0x01;
else
hopping_frequency[0]=0;
hopping_frequency[1]=(rx_tx_addr[3]&0x1F)+0x10; hopping_frequency[1]=(rx_tx_addr[3]&0x1F)+0x10;
hopping_frequency[2]=hopping_frequency[1]+0x20; hopping_frequency[2]=hopping_frequency[1]+0x20;
hopping_frequency[3]=hopping_frequency[2]+0x20; hopping_frequency[3]=hopping_frequency[2]+0x20;

View File

@ -11,7 +11,7 @@
11,SLT,SLT_V1,SLT_V2,Q100,Q200,MR100 11,SLT,SLT_V1,SLT_V2,Q100,Q200,MR100
12,CX10,GREEN,BLUE,DM007,---,J3015_1,J3015_2,MK33041 12,CX10,GREEN,BLUE,DM007,---,J3015_1,J3015_2,MK33041
13,CG023,CG023,YD829 13,CG023,CG023,YD829
14,Bayang,Bayang,H8S3D,X16_AH,IRDRONE 14,Bayang,Bayang,H8S3D,X16_AH,IRDRONE,DHD_D4
15,FrskyX,CH_16,CH_8,EU_16,EU_8 15,FrskyX,CH_16,CH_8,EU_16,EU_8
16,ESky 16,ESky
17,MT99xx,MT,H7,YZ,LS,FY805 17,MT99xx,MT,H7,YZ,LS,FY805

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_REVISION 1 #define VERSION_REVISION 1
#define VERSION_PATCH_LEVEL 40 #define VERSION_PATCH_LEVEL 41
//****************** //******************
// Protocols // Protocols
@ -166,6 +166,7 @@ enum BAYANG
H8S3D = 1, H8S3D = 1,
X16_AH = 2, X16_AH = 2,
IRDRONE = 3, IRDRONE = 3,
DHD_D4 = 4,
}; };
enum MT99XX enum MT99XX
{ {
@ -665,6 +666,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
H8S3D 1 H8S3D 1
X16_AH 2 X16_AH 2
IRDRONE 3 IRDRONE 3
DHD_D4 4
sub_protocol==MT99XX sub_protocol==MT99XX
MT99 0 MT99 0
H7 1 H7 1

View File

@ -141,7 +141,7 @@ static uint16_t XN297Dump_callback()
{ {
NRF24L01_ReadPayload(packet,XN297DUMP_MAX_PACKET_LEN); NRF24L01_ReadPayload(packet,XN297DUMP_MAX_PACKET_LEN);
debug_time("RX: "); debug_time("RX: ");
debug("us %d ", option); debug("us C=%d ", hopping_frequency_no);
if(XN297Dump_process_packet()) if(XN297Dump_process_packet())
{ // valid crc found { // valid crc found
debug("A="); debug("A=");

View File

@ -465,6 +465,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
H8S3D H8S3D
X16_AH X16_AH
IRDRONE IRDRONE
DHD_D4
PROTO_BUGS PROTO_BUGS
NONE NONE
PROTO_BUGSMINI PROTO_BUGSMINI