From 4ea032d5ca24b76e030522cbbb30091774289ca0 Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Wed, 5 Sep 2018 12:53:36 -0700 Subject: [PATCH] Recognize Zastone D900, Zastone DP880 and Radtel RT-27D as separate radio types. --- README.md | 8 +++++--- md380.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ radio.c | 14 ++++++++++---- radio.h | 9 ++++++--- 4 files changed, 78 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2cade97..c48f2af 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,12 @@ DMRconfig is a utility for programming digital radios via USB programming cable. Supported radios: - * TYT MD-380 (not tested) - * TYT MD-2017 (not tested) + * TYT MD-380, Retevis RT3, RT8 + * TYT MD-2017, Retevis RT82 (untested) * TYT MD-UV380 - + * Zastone D900 (untested) + * Zastone DP880 (untested) + * Radtel RT-27D (untested) ## Usage diff --git a/md380.c b/md380.c index f7fba96..324b218 100644 --- a/md380.c +++ b/md380.c @@ -2295,3 +2295,60 @@ radio_device_t radio_md380 = { md380_parse_row, md380_update_timestamp, }; + +// +// Zastone D900 +// +radio_device_t radio_d900 = { + "Zastone D900", + md380_download, + md380_upload, + md380_is_compatible, + md380_read_image, + md380_save_image, + md380_print_version, + md380_print_config, + md380_verify_config, + md380_parse_parameter, + md380_parse_header, + md380_parse_row, + md380_update_timestamp, +}; + +// +// Zastone DP880 +// +radio_device_t radio_dp880 = { + "Zastone DP880", + md380_download, + md380_upload, + md380_is_compatible, + md380_read_image, + md380_save_image, + md380_print_version, + md380_print_config, + md380_verify_config, + md380_parse_parameter, + md380_parse_header, + md380_parse_row, + md380_update_timestamp, +}; + +// +// Radtel RT-27D +// +radio_device_t radio_rt27d = { + "Radtel RT-27D", + md380_download, + md380_upload, + md380_is_compatible, + md380_read_image, + md380_save_image, + md380_print_version, + md380_print_config, + md380_verify_config, + md380_parse_parameter, + md380_parse_header, + md380_parse_row, + md380_update_timestamp, +}; diff --git a/radio.c b/radio.c index 9a7b362..f873208 100644 --- a/radio.c +++ b/radio.c @@ -69,12 +69,18 @@ void radio_connect() const char *ident = dfu_init(0x0483, 0xdf11); fprintf(stderr, "Connect to %s.\n", ident); - if (strcasecmp(ident, "DR780") == 0 || // TYT MD-380, Retevis RT3, RT8 - strcasecmp(ident, "ZD3688") == 0 || // Zastone D900 - strcasecmp(ident, "TP660") == 0 || // Zastone DP880 - strcasecmp(ident, "ZN><:") == 0) { // Radtel RT-27D + if (strcasecmp(ident, "DR780") == 0) { // TYT MD-380, Retevis RT3, RT8 device = &radio_md380; } else + if (strcasecmp(ident, "ZD3688") == 0) { // Zastone D900 + device = &radio_d900; + } else + if (strcasecmp(ident, "TP660") == 0) { // Zastone DP880 + device = &radio_dp880; + } else + if (strcasecmp(ident, "ZN><:") == 0) { // Radtel RT-27D + device = &radio_rt27d; + } else if (strcasecmp(ident, "2017") == 0) { // TYT MD-2017, Retevis RT82 device = &radio_md2017; } else diff --git a/radio.h b/radio.h index 4b3cc16..68bce67 100644 --- a/radio.h +++ b/radio.h @@ -98,9 +98,12 @@ struct _radio_device_t { int channel_count; }; -extern radio_device_t radio_md380; // TYT MD-380 -extern radio_device_t radio_md2017; // TYT MD-2017 -extern radio_device_t radio_uv380; // TYT MD-UV380 +extern radio_device_t radio_md380; // TYT MD-380 +extern radio_device_t radio_md2017; // TYT MD-2017 +extern radio_device_t radio_uv380; // TYT MD-UV380 +extern radio_device_t radio_d900; // Zastone D900 +extern radio_device_t radio_dp880; // Zastone DP880 +extern radio_device_t radio_rt27d; // Radtel RT-27D // // Radio: memory contents.