Skip to content

Commit d984b90

Browse files
committed
Partial reorganization of the codeplug format:
Contacts: - extended info field to 15 bytes, padding the structure to 48 byte and to leave space for future extensions Channels: - extended info to 9 bytes, padding the structure to 96 byte and to leave space for future extensions - dropped the 20kHz channel bandwidth M17 channel info block: - dropped split TX and RX CAN and moved to a unique CAN field - merged CAN and channel mode into the same 8 bit field - merged encryption type and GNSS transmission in the same 8 bit field
1 parent edce4b3 commit d984b90

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

binary_cps_format.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ This structure is the beginning of the file. The fields are laid out in the foll
7171

7272
#### Field definition
7373

74-
| Field name | Data Type | Description |
75-
| ---------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
76-
| name | char[32] | Display name for the contact |
77-
| mode | uint8_t | Mode that the contact is intended to be used for |
78-
| info | [m17Contact_t](#m17contact_t-type-description) or [dmrContact_t](#dmrcontact_t-type-description) | Either contains the m17 info or the dmr info, as described further below |
74+
| Field name | Data Type | Description |
75+
| ---------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------|
76+
| name | char[32] | Display name for the contact |
77+
| mode | uint8_t | Mode that the contact is intended to be used for |
78+
| info | uint8_t[15] | Mode-specific contact info. See [m17Contact_t](#m17contact_t-type-description) and [dmrContact_t](#dmrcontact_t-type-description) |
7979

8080
#### Mode lookup table
8181

@@ -119,7 +119,7 @@ For M17 contacts, this section is laid out in the following manner:
119119
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
120120
0000 |<-name-----------------------------------------
121121
0010 ---------------------------------------------->|
122-
0020 |<m|<-address------->|
122+
0020 |<m|<-address------->|<-unused----------------->|
123123
```
124124

125125
For DMR contacts, this section is laid out in the following manner:
@@ -128,32 +128,32 @@ For DMR contacts, this section is laid out in the following manner:
128128
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
129129
0000 |<-name-----------------------------------------
130130
0010 ---------------------------------------------->|
131-
0020 |<m|<-id------>|<i| |
131+
0020 |<m|<-id------>|<s|<-unused-------------------->|
132132
```
133133

134134
### Channels
135135

136136
#### Field descriptions
137137

138-
| Field name | Data Type | Description |
139-
| --------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
140-
| mode | uint8_t | Operating mode; refer to [Mode lookup table](#mode-lookup-table) |
141-
| traits | uint8_t | First two bits are channel bandwidth (refer to [Bandwidth lookup table](#bandwidth-lookup-table)), then one bit indicating true if the channel is RX only |
142-
| power | uint32_t | transmit power, in mW
143-
| rx_frequency | uint32_t | RX frequency, in Hz |
144-
| tx_frequency | uint32_t | TX frequency, in Hz |
145-
| name | char[32] | display name for channel |
146-
| descr | char[32] | Description of the channel |
147-
| ch_location | [geo_t](#geo_t-type-description) | transmitter location |
148-
| infoblock | [fmInfo_t](#fminfo_t-type-description), [dmrInfo_t](#dmrinfo_t-type-description), or [m17Info_t](#m17info_t-type-description) | Information block for the channel |
138+
| Field name | Data Type | Description |
139+
| --------------- | ---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------- |
140+
| mode | uint8_t | Operating mode; refer to [Mode lookup table](#mode-lookup-table) |
141+
| traits | uint8_t | Bit 0:1 channel bandwidth (refer to [Bandwidth lookup table](#bandwidth-lookup-table)). Bit 2 RX only flag. Bit 3:7 reserved |
142+
| power | uint32_t | transmit power, in mW |
143+
| rx_frequency | uint32_t | RX frequency, in Hz |
144+
| tx_frequency | uint32_t | TX frequency, in Hz |
145+
| name | char[32] | display name for channel |
146+
| descr | char[32] | Description of the channel |
147+
| ch_location | [geo_t](#geo_t-type-description) | transmitter location |
148+
| infoblock | uint8_t[9] | Information block for the channel, operating mode dependent. See [fmInfo_t](#fminfo_t-type-description), [dmrInfo_t](#dmrinfo_t-type-description), or [m17Info_t](#m17info_t-type-description) |
149149

150150
#### Bandwidth lookup table
151151

152152
| Bits | Bandwidth (kHz) |
153153
| ---- | --------------- |
154154
| 0b00 | 12.5 |
155-
| 0b01 | 20 |
156-
| 0b10 | 25 |
155+
| 0b01 | 25 |
156+
| 0b10 | Reserved |
157157
| 0b11 | Reserved |
158158

159159
#### geo_t type description
@@ -183,12 +183,11 @@ For DMR contacts, this section is laid out in the following manner:
183183

184184
#### m17Info_t type description
185185

186-
| Field | Data Type | Description |
187-
| ------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
188-
| can | uint8_t | RX and TX channel access numbers (CANs) used, as defined by [M17 Specification section 3.1.3](https://spec.m17project.org/), with the RXvalue represented in the first half (e.g. an RX CAN of 0 and TX CAN of 2 is represented as 0b00000010) |
189-
| mode_encr | uint8_t | Channel operation mode and encryption mode, as defined by [M17 channel modes lookup table](#m17-channel-modes-lookup-table) and [M17 channel encryption lookup table](#m17-channel-encryption-lookup-table) |
190-
| gps_mode | uint8_t | Boolean whether GPS position should be embedded in transmit payload |
191-
| contact_index | uint16_t | Index to retrieve contact from list for reverse lookups |
186+
| Field | Data Type | Description |
187+
| ------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
188+
| config | uint8_t | Bit 0:3 channel access number (CAN), as defined by [M17 Specification section 3.1.3](https://spec.m17project.org/). Bit 4:7 channel operation mode, as defined by [M17 channel modes lookup table](#m17-channel-modes-lookup-table) |
189+
| encr_gnss | uint8_t | Bit 0:3 encryption mode, as defined by [M17 channel encryption lookup table](#m17-channel-encryption-lookup-table). Bit 4: embed GPS position in transmit payload. Bit 5:7 reserved |
190+
| contact_index | uint16_t | Index to retrieve contact from list for reverse lookups |
192191

193192
#### M17 channel modes lookup table
194193

@@ -298,7 +297,7 @@ For DMR channels, this section is laid out in the following manner:
298297
0020 ---------------------------------------->|<descr
299298
0030 -----------------------------------------------
300299
0040 ---------------------------------------->|<ch_lo
301-
0050 cation---------------->|<c|<d|<cont|
300+
0050 cation---------------->|<c|<d|<cont|<-unused-->|
302301
```
303302

304303
For FM channels, this section is laid out in the following manner:
@@ -310,7 +309,7 @@ For FM channels, this section is laid out in the following manner:
310309
0020 ---------------------------------------->|<descr
311310
0030 -----------------------------------------------
312311
0040 ---------------------------------------->|<ch_loca
313-
0050 tion------------------>|<r|<t
312+
0050 tion------------------>|<r|<t|<-unused-------->|
314313
```
315314

316315
For M17 channels, this section is laid out in the following manner:
@@ -322,7 +321,7 @@ For M17 channels, this section is laid out in the following manner:
322321
0020 ---------------------------------------->|<descr
323322
0030 -----------------------------------------------
324323
0040 ---------------------------------------->|<ch_lo
325-
0050 cation---------------->|<c|<m|<g|<cont|
324+
0050 cation---------------->|<t|<m|<cont|<-unused-->|
326325
```
327326

328327
### Bank Data Offsets
@@ -355,6 +354,7 @@ The Bank structure is variable in length depending on the number of channels. So
355354
| ch_count | uint16_t | Count of all of the channels in the bank |
356355
| channels | uint16_t[n] | The indexes of the channels that are present in the bank |
357356

357+
358358
#### Layout
359359

360360
This structure is repeated for each bank present. Its start is immediately after the preceding section, and the memory locations referenced below are relative to that. The final field _channels_ is optional and variable in size depending on the _ch_count_.

0 commit comments

Comments
 (0)