Waris Programing Block

From W9CR
Revision as of 17:08, 12 January 2022 by Bryan (talk | contribs) (→‎Chonks)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Programing block

The programing block is the next block after the tuning and FDB blocks, typically starting at 0x300. The programing block is made up of "chonks" which are variable length packed data types. These chonks are laid out following the Table of Contents block and enabled based on the TOC header. Chonks are identified based on their order in the TOC header, which is not in order in the address space of the codeplug.

A chonk typically has it's own format, and the code plug version determines what formats the chonks follow. Chonks can further be subdivided into wads which would be the rows of ordered data in a list. Chonks are checksum(8) including the header and checksum byte to make 0x5A. Block 15 doesn't follow this.

Block > Chonk > Wad


Waris programing Codeplug Map
Byte Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
0x000000 Tuning len Tuning Data
SKIP SKIP
0x000270 Tuning Data Cont. Checksum
0x000280 Feature len Feature Data Cont.
SKIP SKIP
0x000300 Magic # Length TOC Header TOC Programing Data
SKIP SKIP

Programing Magic

This is a magic number of 0x0400 that identifies the start of the programing block

Programing Length

This is the length of the programing block. To calculate the absolute position in the codeplug, add 0x300 to it

example it's 0x0972 and the programming block starts at 0x0300  
0x972+300 = 0x0C72, so the programing block runs from 0x300:C72 and will have a checksum8 of 0x5A

Programing TOC Header Start

This is a pointer to the TOC Header start address, it is an absolute value from the start of the codeplug.

Programing TOC Start

This is a pointer to the Programing Table of Contents, it is an absolute value from the start of the codeplug.


Programing TOC Header

This is a block of programing data which tells what blocks are enabled in the TOC.

A typical block will be as follows:
000A03FFDF03FF7F3FAF

Broken out:  
000A 03FFDF03FF7F3F AF

000A is the length of the block,  10d bytes including header and checksum
AF is the checksum byte which makes the checksum8 of the block 0x5A

0x03FFDF03FF7F3F is the bit map of what chonks are enabled in the codeplug TOC

03 is the first 0-7 chonks 
0000 0011 - 03 
7654 3210 - chonks enabled

FF is the next 8-F
1111 1111 - FF
FEDC BA98 

DF is the 10-17 chonks        
1101 1111 - DF
7654 3210 - chonks enabled

03 is the 18-1F chonks
0000 0011 - 03 
FEDC BA98 - chonks enabled

FF is the next 20-27
1111 1111 - FF
7654 3210 - chonks enabled

7F is the 28-2F chonks
0111 1111 - 7F 
FEDC BA98 - chonks enabled

3F is the 30-37 chonks
0011 1111 - 3F 
7654 3210 - chonks enabled

The way this works is if a bit is 1, that block is active in the programing code plug 
and the TOC will have the address of it's start.  If it's set to 0 the block is not used, but may be present in the code plug and may have the pointer set to 0x0000 if it's not present.

Programing TOC

This will be a block that varies in length, and the first 2 bytes will be the number of 2 byte addresses in the list.

0036 0282 02D8 0000 0000 0000 0000 0000 - 6   110 0000 
0000 0308 0315 034B 0354 03D3 03E5 04D8 - 14 0111 1111
04BC 0657 064B 0817 07E0 067F 0000 068F - 22 1111 1101
03AF 0369 03C8 0000 0000 0000 0000 0000 - 30 1110 0000 
0000 06B7 06BF 06F6 06DA 0711 0729 0740 - 38 0111 1111
095B 0839 084A 0946 0858 0867 08A6 0939 - 46 1111 1111
0000 07C3 0802 075C 0770 0792 07A9 04   - 53 0111 111
In the above block, 0x0036 is the number of items in the list, 54.  
The final byte is a checksum byte baking the blocks checksum8 0x5A.

The total block length will be the number of items * 2 + 3  In this case the block is 111 bytes long.  

The list is list of absolute pointers from the beginning of the file to each block.  Note that both feature blocks are identified here.   
The first block is 0x282, or FDB1, 0x2D8 is FDB2,

Chonks

The following note on what each chonk does, or what I think it does.

Chnk - Type - Data
0x00 - 0x80 - FDB 1
0x01 - 0x80 - FDB 2
0x02 -
 ||  -  These are always blank
0x07 - 
0x08 - 0x80 - Date the code plug was saved 02 0502 2020 10 25 0058
                                           uu NNnn yyyy mm dd hhmm 
              uu is unknown, NNnn is the Latest Codeplug, yyyy-mm-dd hh:mm is the latest programing date  
0x09 - 0x80 - Radio Configuration
0x0A - 0x84 - Personality assignment to zone 
0x0B - 0x84 - Zone names, not present in the A or C or F control head Radios and 0x84 chonk
0x0C - 0x80 - UNKNOWN - only seems to be a few different options
0x0D - 0x84 - Phone List (25 entries)
0x0E - 0x84 - Phone List Names (25 names)
0x0F - 0x80 - Phone Systems
0x10 - 0xC4 - scan list config data
0x11 - 0xC0 - Scan list channel assignments
0x12 - 0x80 - Trunking Buttons
0x13 - 0x80 - Conventional buttons
0x14 - 0x80 - Menu Items
0x15 - no present on any radio other than GP3688, uses a special chonk type of 0x4.  Some radios use a 0x80 chonk type here and normal checksum. 
0x16 - 0x80 - Option Board Programing info?  Changing the voice storage tab under radio configuration changes this.
0x17 - 0x80 - Accessory Config, Accessory Pins
0x18 - 0x80 - Auxiliary Control 
0x19 - 0x80 - Present in all code plugs, always 0x0000
0x1A - 0
0x1B - 0
0x1C - 0
0x1D - 0
0x1E - 0
0x1F - 0
0x20 - 0x80 - UNKNOWN
0x21 - 0xC0 - MDC Call List
0x22 - 0xC0 - QCII Call List
0x23 - 0xC0 - DTMF Call List
0x24 - 0xC0 - MDC Message List
0x25 - 0xC0 - MDC status List
0x26 - 0x80 - One Touch Setup
0x27 - 0x80 - UNKNOWN
0x28 - 0xC0 - LS Trunking personalities
0x29 - 0x84 - UNKNOWN - Maybe control head config (1/4 line?)
0x2A - 0x84 - LTR Group ID List
0x2B - 0x84 - LS Trunking Universal ID List
0x2C - 0x84 - Trunking universal ID List Names 0x84 
0x2D - 0x84 - Trunking repeater config
0x2E - 0x80 - Trunking site system config
0x2F - blank
0x30 - 0xC0 - Conventional Personalities - channel data
0x31 - 0x84 - Conventional Personalities - Names
       0x0E (14) in length, chonk header has the number of fields in it.  They are stored every 14 bytes
0x32 - 0x80 - Signaling Config
0x33 - 0x80 - MDC Systems
0x34 - 0x80 - QCII Systems
0x35 - 0x80 - DTMF Systems

0x12 & 0x13

0x12 is the trunking buttons

0x13 is the conventional buttons

These are two byte values, the first byte is the short press, the last byte is the long press.

P1   P2   P3   P4                       A    B    C 
0d00 0d00 0d0b 1934 0000 0000 0000 0000 3100 2c00 3000 0000 0000 0000 0000

# Conventional Functions:
Hex  Function
00 - unassigned
05 - Monitor - short press only, Long press must be Open Squelch
07 - Volume Set
09 - Toggle Sytem Scan On/Off - 
0a - Nuisance Delete - must be a long press and short press _must_ be Toggle System Scan On/Off
0b - Toggle High/Low Power
0d - Toggle Repeater/Talkaround
0F - Toggle Option Board On/Off
11 - Speed Dial (Memory)
12 - Radio Call
14 - Voice Storage Playback Exit
15 - Voice Storage Reset 
16 - Voice Storage Playback
17 - Voice Storage Delete 
19 - Backlight Control
1f - Aux Control 1
20 - Aux Control 2
21 - Priority Request to Talk 
22 - Status
23 - Message 
24 - One Touch 1
25 - One Touch 2
26 - One Touch 3
27 - One Touch 4
28 - One Touch 5
29 - One Touch 6
2A - One Touch 7
2B - One Touch 8
2C - Menu/Channel Up   - Long press must be unassigned with this
2D - Menu/Channel Down - Long press must be unassigned with this
30 - Select/Enter - Must be a Short Press and long press must be unassigned
31 - Exit
33 - Direct Channel
34 - Home Revert
35 - Zone - if Long, short must be unassigned, if short long must be unassigned
36 - Open Squelch - Long press only, Short press must be Monitor
37 - Horn and Lights (External Alarm)
39 - Display Clock
3A - Toggle Voice Operated Tx
3C - Toggle Answer Mode On/Off
3D - Scan List Edit
3f - Home Revert 2
40 - Call Alert Member #1
41 - Call Alert Member #2
42 - Call Alert Member #3
43 - Sel Cal Member #1
44 - Sel Cal Member #2
45 - Sel Cal Member #3
46 - Speed Call Alert
47 - Speed Sel Cal

0x30 Conventional Personalities

RX freq 224.280 to 224.285

0x88 5d80 5ec0 4 f 0 000 0 5b6 50 10 07 31 1 0 00ff0000 0000 0000 ff 27 - Rx only, disables TX, TPL, talkaround, vox, power level, tot tx signaling, compression, 
0x88 5d80 5ec0 c f 0 5b6 0 5b6 50 28 07 31 1 1 00000000 0000 0000 ff d2  146.2 encode/decode TPL
0x88 5d80 5ec0 c f 0 5b6 0 5b6 50 08 07 31 1 1 00000000 0000 0000 reverse burst
0x88 5d80 5ec0 c f 0 5b6 0 5b6 50 00 07 31 1 1 00000000 0000 0000  no reverse burst
0x88 5d80 5ec0 c f 0 5b6 0 000 10 28 07 31 1 1 00000000 0000 0000 ff - CSQ on rx, 146.2 on tx
0x88 5d80 5ec0 c f 0 000 0 000 00 28 07 31 1 1 00000000 0000 0000 ff - csq on rx and csq on tx, reverse burst on but grayed out
0x88 5d80 5ec0 c f 0 813 0 000 20 20 07 31 1 1 00000000 0000 0000 ff - CSQ RX, DPL 023 TX, no invert, no turnoff code
0x88 5d80 5ec0 c f 0 815 0 000 20 20 07 31 1 1 00000000 0000 0000 ff - CSQ RX, DPL 025 TX, no invert, no turnoff code
0x88 5d80 5ec0 c f 0 9ec 0 000 28 20 07 31 1 1
0x88 5d80 5ec0 c f 0 9ec 0 000 28 28 07 31 1 1 00000000 0000 0000ff7b
0x88 5d80 5ec0 c f 0 9ec 0 000 20 00 07 31 1 1 00000000 0000 0000ff
0x88 5d80 5ec0 c f 0 9ec 0 000 20 00 47 31 1 1 00000000 0000 0000ff
0x88 5d80 5ec0 c f 0 9ec 0 000 20 00 07 30 1 1 00000000 0000 0000 - low power, tot 180
0x88 5d80 5ec0 c f 0 9ec 0 000 20 00 00 31 1 1 00000000 0000 0000 tot Infinity 
0x88 5d80 5ec0 c f 0 9ec 0 000 20 00 01 31 1 1 00000000 0000 0000 ffb1 - tot 15
0x88 5d80 5ec0 c f 0 9ec 0 000 21 00 07 31 1 1
0x88 5d80 5ec0 c f 0 9ec 0 5b6 62 00 07 31 1 1
0x88 5d80 5ec0 c f 0 9ec 0 5b6 60 02 07 31 1 1
0x88 5d80 5ec0 c f 0 9ec 0 5b6 60 03 07 31 1 1 0000 00 00 0000 00 00 FF
0x88 5d80 5ec0 c f 0 5b6 0 5b6 50 28 07 31 1 1 0000 00 00 1234 00 00 FF
  RF TX   RX   E W   tPL   rPL PD TU BM Sc D C      PP SS AAAA DZ DP    CK

RF
reference frequency and channel frequency multiplier
high nibble is TX and low nibble is RX > nibble, high two bits is channel multiplier,
low two bits are reference frequency
  TX     RX
10 00 - 10 00 
Mt Rt   Mr Rr

M 00 = 2500
M 01 = 3125
M 10 = 5000
M 11 = 6250
R 00 = default
R 01 = 2.100
R 10 = 2.225
R 11 = 2.400 
M = multiplier
R = reference frequency
t/r is transmit or receive  
00 = is default ref frequencies and 2500 on tx and 2500 on rx
44 = is default ref frequencies and 3125 on tx and 3125 on rx
56 = tx 2.100, rx 2.225 and 3125 on tx and 3125 on rx
88 = default ref frequencies and 5000 on tx and 5000 on rx
98 = tx 2.100 and rx default, and 5000 on tx and 5000 on rx
8c is default ref frequencies and 5000 on tx and 6250 on rx
cc is default ref frequencies and 6250 on tx and 6250 on rx

Width - channel
C F0 - 25 khz 
C A0 - 20 khz
c 50 - 12.5 KHz

PL
5B6 - 1462d 146.2 hz
5B7 - 1463 

DPL is 0x800 + DPL code in Hex:
DPL - OCTAL Hex 
813 - \023 	0x13
815 - \025 
9ec - \754 	0x1EC

P is the system enabled, high nibble
5 = TX PL, RX PL
1 = RX PL, RX CSQ
0 = TX CSQ, RX CSQ

D is DPL invert code Low nibble, and Busy channel lockout
00 00
0 = no invert
1 = no invert, on busy channel 
2 = no invert, on busy channel with wrong PL code
8 = invert



E is emphasis and option board 
0 = none
1 - none and option board
4 = De-Emphasis & no option board
5 = De-Emphasis & option board
8 = Pre-Emphasis & no option board 
9 = Pre-Emphasis & option board 
C = De and pre and no option board
d - De and Pre and option board

T is Txonly personality and talk around and auto scan
0000 - 0 - No Talkaround, 
0010 - 2 - not tx only 
1010 - a - tx only
0110 - 6 - Auto scan

U - turn off code or reverse burst Low nibble, and unmute rule 
turn off code and reverse burst is bit 3
0000 - 0 - no turn off code, std/std
1000 - 8 - turn off code, std/std
0010 - 2 - no turn off code, and/std
0011 - 3 - no turn off code, and/or

BM
non standard reverse burst and VOX and TPL/DPL required for Data
upper nibble
bit
0 - Signaling squelch, 0 = OR,  1 = AND
1 - Signaling RX, PL/DPL required for data 
2 - VOX, 0 = no, 1 = VOX
3 - Non standard reverse burst, 0 = no, 1 = yes

0000 - 0 - No vox, no RX signaling PL, Or signaling squelch, no non-standard reverse burst
0001 - 1 - RX signaling squelch AND
0100 - 4 - RX Signaling Squelch OR and VOX
0101 - 5 - RX signaling squelch AND and VOX
0110 - 6 - RX Signaling Squelch OR and VOX and TPL/DPL required for Data
0111 - 7 - AND, PL, VOX
1000 - 8 - non standard reverse burst set 

M - lower 3 bits
0000 - infinity
0001 - 15 seconds
0010 - 30 seconds
0011 - 45 seconds
0100 - 60 seconds
0101 - 90 Seconds
0110 - 120 Seconds
0111 - 180 seconds

Sc is ExpanSion/compression Type and Tx power
01 - Disabled/disabled - High
21 - AGC/Disabled	High
30 - Low Level/Disabled	- low
31 - Low Level/Disabled	- high
59 - Full/Full - high
81 - disabled/AGC Mode - high
a1 - AGC/AGC - high

D is RX signaling system
0 = none
1 = mdc
2 = QCII

C is the TX signaling system
0 = none
1 = MDC 1
2 = QCII 1
3 = DTMF-1

AAAA is the repeater access ID in hex for mdc

SS is scan list, 
FF = disabled 
00 = Scan List 1

PP is Phone system, max of 4 phone systems
03 = Phone 4
FF = disabled

DZ = data revert zone

DP = Data revert Personality in the zone

options in a conventional personality

Options in a Conventional Personality in a mobile
	BASIC
Alias - 14 char
Channel bandwidth - 12.5, 20, 25
RX Frequency MHz
Squelch Type - CSQ, TPL, DCS
TPL Freq Hz - 67.0
DPL Code - 
DPL Invert
RX Only Personality - binary 
TX Frequency MHz
Squelch Type - CSQ, TPL, DCS
TPL Freq Hz - 67.0 
Reverse Burst 
DPL Code - 
DPL Invert - binary 
DPL Turn off code - binary 

	OPTIONS
Talk around - binary
VOX - binary 
Edit mode - binary 
ARTS Enable - binary
TX Power Level - High or Low
Time out Timer - Infinite, 15, 30, 45, 60, 90, 120, 180
Squelch Setting - HT only
Unmute/Mute Rule - std unmute/std mute, and unmute/std mute, and unmute/or mute
Busy Channel Lockout - disabled, on busy channel, one busy channel with wrong PL code

	SIGNALING
RX system, none or MDC or Quick call system
TPL/DPL required for data - binary
Signaling squelch - Or, And
TX system, none or DTMF, or MDC or Quick call system
Repeater Access  ID - MDC 4 hex digits, not for DTMF, nor QCII

	SCAN
Scan List selection - available scan lists
auto scan - binary

	PHONE
Phone system selection 

	ADVANCED
Option Board Feature - Binary
Option Board Configuration Index
Noise Blanker - Binary, only on low band radios
TX Only Personality - Binary
Non-Standard Reverse Burst - Binary 
Compression Type - Disabled, Full Compression, AGC Mode
Expansion Type - Disabled, Full Expansion, ACG Mode, Low-Level Expansion
Emphasis Selection - None, De-emphasis, Pre-emphasis, De-emphasis & Pre-Emphasis
RX Reference Frequency - Default, 2.100, 2.225, 2.400
TX Reference Frequency - Default, 2.100, 2.225, 2.400

	Data Revert
Data Revert Zone - Zone number
Data Revert Channel - Channel number in that zone