D868UV: print messages.

This commit is contained in:
Serge Vakulenko 2018-10-27 18:57:09 -07:00
parent 9ff379b43a
commit 4e1e2c6fbd
3 changed files with 39 additions and 85 deletions

View File

@ -1,38 +0,0 @@
--- d868uv-contacts.hd 2018-10-26 16:58:56.070106184 -0700
+++ d868uv-contacts-delete5.hd 2018-10-26 17:10:11.651995288 -0700
@@ -18204,10 +18204,9 @@
000764e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000764f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00076500 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 |................| --- List of contacts?
-00076510 04 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff |................|
-00076520 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
+00076510 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
-00080140 e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
+00080140 f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| --- Bitmap of invalid contacts
00080150 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00080620 ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
@@ -18233,43 +18232,12 @@
00080790 44 44 44 01 00 00 00 00 00 00 00 00 00 00 00 00 |DDD.............|
000807a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
-000807d0 00 43 6f 6e 74 61 63 74 20 35 00 00 00 00 00 00 |.Contact 5......| --- Contact5 structure
-000807e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-000807f0 00 00 00 15 55 55 55 02 00 00 00 00 00 00 00 00 |....UUU.........|
-00080800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-*
-00080840 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
+000807d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
@@ -18306,8 +18274,7 @@
00174c30 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00188380 f1 ac 68 24 00 00 00 00 66 66 66 26 02 00 00 00 |..h$....fff&....|
-00188390 88 88 88 28 03 00 00 00 aa aa aa 2a 04 00 00 00 |...(.......*....|
-001883a0 2a e4 ee 2c 01 00 00 00 ff ff ff ff ff ff ff ff |*..,............|
-001883b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
+00188390 88 88 88 28 03 00 00 00 2a e4 ee 2c 01 00 00 00 |...(....*..,....| --- Unknown data
+001883a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00188680

View File

@ -50,6 +50,7 @@
#define OFFSET_BANK1 0x000040 // Channels #define OFFSET_BANK1 0x000040 // Channels
#define OFFSET_ZONELISTS 0x03e8c0 // Channel lists of zones #define OFFSET_ZONELISTS 0x03e8c0 // Channel lists of zones
#define OFFSET_SCANLISTS 0x05dcc0 // Scanlists #define OFFSET_SCANLISTS 0x05dcc0 // Scanlists
#define OFFSET_MESSAGES 0x069f40 // Messages
#define OFFSET_CHAN_MAP 0x070a40 // Bitmap of valid channels #define OFFSET_CHAN_MAP 0x070a40 // Bitmap of valid channels
#define OFFSET_ZONE_MAP 0x070940 // Bitmap of valid zones #define OFFSET_ZONE_MAP 0x070940 // Bitmap of valid zones
#define OFFSET_SCANL_MAP 0x070980 // Bitmap of valid scanlists #define OFFSET_SCANL_MAP 0x070980 // Bitmap of valid scanlists
@ -70,6 +71,7 @@
#define GET_CONTACT(i) ((contact_t*) &radio_mem[OFFSET_CONTACTS + (i)*100]) #define GET_CONTACT(i) ((contact_t*) &radio_mem[OFFSET_CONTACTS + (i)*100])
#define GET_GROUPLIST(i) ((grouplist_t*) &radio_mem[OFFSET_GLISTS + (i)*320]) #define GET_GROUPLIST(i) ((grouplist_t*) &radio_mem[OFFSET_GLISTS + (i)*320])
#define GET_SCANLIST(i) ((scanlist_t*) &radio_mem[OFFSET_SCANLISTS + (i)*192]) #define GET_SCANLIST(i) ((scanlist_t*) &radio_mem[OFFSET_SCANLISTS + (i)*192])
#define GET_MESSAGE(i) ((uint8_t*) &radio_mem[OFFSET_MESSAGES + (i)*256])
#define VALID_TEXT(txt) (*(txt) != 0 && *(txt) != 0xff) #define VALID_TEXT(txt) (*(txt) != 0 && *(txt) != 0xff)
#define VALID_GROUPLIST(gl) ((gl)->member[0] != 0xffffffff && VALID_TEXT((gl)->name)) #define VALID_GROUPLIST(gl) ((gl)->member[0] != 0xffffffff && VALID_TEXT((gl)->name))
@ -1004,6 +1006,19 @@ static int have_grouplists()
return 0; return 0;
} }
static int have_messages()
{
int i;
for (i=0; i<NMESSAGES; i++) {
uint8_t *msg = GET_MESSAGE(i);
if (VALID_TEXT(msg))
return 1;
}
return 0;
}
// //
// Print full information about the device configuration. // Print full information about the device configuration.
// //
@ -1076,7 +1091,7 @@ static void d868uv_print_config(radio_device_t *radio, FILE *out, int verbose)
fprintf(out, "# 6) List of channels: numbers and ranges (N-M) separated by comma\n"); fprintf(out, "# 6) List of channels: numbers and ranges (N-M) separated by comma\n");
fprintf(out, "#\n"); fprintf(out, "#\n");
} }
fprintf(out, "Scanlist Name PCh1 PCh2 TxCh Channels\n"); fprintf(out, "Scanlist Name PCh1 PCh2 TxCh Channels\n");
for (i=0; i<NSCANL; i++) { for (i=0; i<NSCANL; i++) {
scanlist_t *sl = get_scanlist(i); scanlist_t *sl = get_scanlist(i);
@ -1085,7 +1100,7 @@ static void d868uv_print_config(radio_device_t *radio, FILE *out, int verbose)
continue; continue;
} }
fprintf(out, "%5d ", i + 1); fprintf(out, "%5d ", i + 1);
print_ascii(out, sl->name, 16, 1); print_ascii(out, sl->name, 16, 1);
if ((sl->prio_ch_select == PRIO_CHAN_SEL1 || if ((sl->prio_ch_select == PRIO_CHAN_SEL1 ||
@ -1189,7 +1204,28 @@ static void d868uv_print_config(radio_device_t *radio, FILE *out, int verbose)
// //
// Text messages. // Text messages.
// //
//TODO if (have_messages()) {
fprintf(out, "\n");
if (verbose) {
fprintf(out, "# Table of text messages.\n");
fprintf(out, "# 1) Message number: 1-%d\n", NMESSAGES);
fprintf(out, "# 2) Text: up to 200 characters\n");
fprintf(out, "#\n");
}
fprintf(out, "Message Text\n");
for (i=0; i<NMESSAGES; i++) {
uint8_t *msg = GET_MESSAGE(i);
if (!VALID_TEXT(msg)) {
// Message is disabled
continue;
}
fprintf(out, "%5d ", i+1);
print_ascii(out, msg, 200, 0);
fprintf(out, "\n");
}
}
// General settings. // General settings.
print_id(out, verbose); print_id(out, verbose);

View File

@ -1,44 +0,0 @@
--- d868uv-full.hd 2018-10-26 13:07:36.694185870 -0700
+++ d868uv-full-zone3.hd 2018-10-26 13:10:26.798620813 -0700
@@ -16046,9 +16046,6 @@
0003ead0 08 00 09 00 ff ff ff ff ff ff ff ff ff ff ff ff |................|
0003eae0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
-0003ecc0 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| --- Zone list
-0003ecd0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
-*
0003eec0 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
0003eed0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
@@ -19683,6 +19680,7 @@
00070910 00 00 00 00 00 00 00 00 00 05 05 0a 0a 64 01 00 |.............d..|
00070920 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
+00070940 fb ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| --- Zone valid bit
00070950 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 03 |................|
00070960 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00070970 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 03 |................|
@@ -19732,10 +19730,10 @@
000716c0 00 5a 62 02 00 6c dc 02 00 00 00 00 00 ff ff 00 |.Zb..l..........|
000716d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
-00071700 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| --- Unknown: 'A' channel for zone 3?
+00071700 00 00 08 00 08 00 00 00 00 00 00 00 00 00 00 00 |................|
00071710 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
-00071900 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| --- Unknown: 'B' channel for zone 3?
+00071900 01 00 04 00 04 00 00 00 00 00 00 00 00 00 00 00 |................|
00071910 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00071b00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
@@ -19757,8 +19755,8 @@
00071dd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00071de0 5a 6f 6e 65 20 32 00 00 00 00 00 00 00 00 00 00 |Zone 2..........|
00071df0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00071e00 5a 6f 6e 65 20 33 00 00 00 00 00 00 00 00 00 00 |Zone 3..........| --- Zone name
-00071e10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00071e00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
+*
00071e20 5a 6f 6e 65 20 34 00 00 00 00 00 00 00 00 00 00 |Zone 4..........|
00071e30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00071e40 5a 6f 6e 65 20 35 00 00 00 00 00 00 00 00 00 00 |Zone 5..........|