Add support for BTECH DMR-6x2 radio.

This commit is contained in:
Serge Vakulenko 2018-11-09 17:46:05 -08:00
parent b58985d3c8
commit 16d7bbac5d
3 changed files with 42 additions and 3 deletions

View File

@ -659,7 +659,11 @@ static void d868uv_upload(radio_device_t *radio, int cont_flag)
// //
static int d868uv_is_compatible(radio_device_t *radio) static int d868uv_is_compatible(radio_device_t *radio)
{ {
return strncmp("D868UVE", (char*)&radio_mem[0], 7) == 0; if (memcmp("D868UVE", (char*)&radio_mem[0], 7) == 0)
return 1;
if (memcmp("D6X2UV", (char*)&radio_mem[0], 6) == 0)
return 1;
return 0;
} }
static void print_id(FILE *out, int verbose) static void print_id(FILE *out, int verbose)
@ -2623,7 +2627,7 @@ static int d868uv_verify_config(radio_device_t *radio)
} }
// //
// TYT MD-UV380 // Anytone AT-D868UV
// //
radio_device_t radio_d868uv = { radio_device_t radio_d868uv = {
"Anytone AT-D868UV", "Anytone AT-D868UV",
@ -2641,3 +2645,23 @@ radio_device_t radio_d868uv = {
d868uv_update_timestamp, d868uv_update_timestamp,
//TODO: d868uv_write_csv, //TODO: d868uv_write_csv,
}; };
//
// BTECH DMR-6x2
//
radio_device_t radio_dmr6x2 = {
"BTECH DMR-6x2",
d868uv_download,
d868uv_upload,
d868uv_is_compatible,
d868uv_read_image,
d868uv_save_image,
d868uv_print_version,
d868uv_print_config,
d868uv_verify_config,
d868uv_parse_parameter,
d868uv_parse_header,
d868uv_parse_row,
d868uv_update_timestamp,
//TODO: d868uv_write_csv,
};

14
radio.c
View File

@ -47,6 +47,7 @@ static struct {
{ "BF-5R", &radio_rd5r }, // Baofeng RD-5R, TD-5R { "BF-5R", &radio_rd5r }, // Baofeng RD-5R, TD-5R
{ "MD-760P", &radio_gd77 }, // Radioddity GD-77, version 3.1.1 and later { "MD-760P", &radio_gd77 }, // Radioddity GD-77, version 3.1.1 and later
{ "D868UVE", &radio_d868uv }, // Anytone AT-D868UV { "D868UVE", &radio_d868uv }, // Anytone AT-D868UV
{ "D6X2UV", &radio_dmr6x2 }, // BTECH DMR-6x2
{ "ZD3688", &radio_d900 }, // Zastone D900 { "ZD3688", &radio_d900 }, // Zastone D900
{ "TP660", &radio_dp880 }, // Zastone DP880 { "TP660", &radio_dp880 }, // Zastone DP880
{ "ZN><:", &radio_rt27d }, // Radtel RT-27D { "ZN><:", &radio_rt27d }, // Radtel RT-27D
@ -201,7 +202,20 @@ void radio_read_image(const char *filename)
device = &radio_md380; device = &radio_md380;
break; break;
case 1606528: case 1606528:
if (fread(ident, 1, 8, img) != 8) {
fprintf(stderr, "%s: Cannot read header.\n", filename);
exit(-1);
}
fseek(img, 0, SEEK_SET);
if (memcmp(ident, "D868UVE", 7) == 0) {
device = &radio_d868uv; device = &radio_d868uv;
} else if (memcmp(ident, "D6X2UV", 6) == 0) {
device = &radio_dmr6x2;
} else {
fprintf(stderr, "%s: Unrecognized header '%.6s'\n",
filename, ident);
exit(-1);
}
break; break;
case 131072: case 131072:
if (fread(ident, 1, 8, img) != 8) { if (fread(ident, 1, 8, img) != 8) {

View File

@ -125,6 +125,7 @@ extern radio_device_t radio_rt27d; // Radtel RT-27D
extern radio_device_t radio_rd5r; // Baofeng RD-5R extern radio_device_t radio_rd5r; // Baofeng RD-5R
extern radio_device_t radio_gd77; // Radioddity GD-77, version 3.1.1 and later extern radio_device_t radio_gd77; // Radioddity GD-77, version 3.1.1 and later
extern radio_device_t radio_d868uv; // Anytone AT-D868UV extern radio_device_t radio_d868uv; // Anytone AT-D868UV
extern radio_device_t radio_dmr6x2; // BTECH DMR-6x2
// //
// Radio: memory contents. // Radio: memory contents.