Skip to content

Commit 62a4c0d

Browse files
Skorpionmskotopes
andauthored
[Documentation]: add documentation SubGhz Bin_RAW file format (#3133)
* [Documentation]: add documentation SubGhz Bin_RAW file format * [Documentation]: fix error Co-authored-by: あく <[email protected]>
1 parent d47e5ca commit 62a4c0d

File tree

1 file changed

+46
-9
lines changed

1 file changed

+46
-9
lines changed

documentation/file_formats/SubGhzFileFormats.md

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Flipper uses `.sub` files to store SubGhz transmissions. These are text files in
66

77
A `.sub` files consist of 3 parts:
88

9-
- **header**: contains file type, version, and frequency
10-
- **preset information**: preset type and, in case of a custom preset, transceiver configuration data
11-
- **protocol and its data**: contains protocol name and its specific data, such as key, bit length, etc., or RAW data
9+
- **header**, contains file type, version, and frequency
10+
- **preset information**, preset type and, in case of a custom preset, transceiver configuration data
11+
- **protocol and its data**, contains protocol name and its specific data, such as key, bit length, etc., or RAW data
1212

1313
Flipper's SubGhz subsystem uses presets to configure the radio transceiver. Presets are used to configure modulation, bandwidth, filters, etc. There are several presets available in stock firmware, and there is a way to create custom presets. See [SubGhz Presets](#adding-a-custom-preset) for more details.
1414

@@ -45,10 +45,10 @@ Built-in presets:
4545

4646
Transceiver configuration data is a string of bytes, encoded in hex format, separated by spaces. For CC1101 data structure is: `XX YY XX YY .. 00 00 ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ`, where:
4747

48-
- XX holds register address,
49-
- YY contains register value,
50-
- 00 00: marks register block end,
51-
- `ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ`: 8 byte PA table (Power amplifier ramp table).
48+
- **XX**, holds register address,
49+
- **YY**, contains register value,
50+
- **00 00**, marks register block end,
51+
- **ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ**, 8 byte PA table (Power amplifier ramp table).
5252

5353
You can find more details in the [CC1101 datasheet](https://www.ti.com/lit/ds/symlink/cc1101.pdf) and `furi_hal_subghz` code.
5454

@@ -87,8 +87,8 @@ RAW `.sub` files contain raw signal data that is not processed through protocol-
8787

8888
For RAW files, 2 fields are required:
8989

90-
- `Protocol`, must be `RAW`
91-
- `RAW_Data`, contains an array of timings, specified in microseconds Values must be non-zero, start with a positive number, and interleaved (change sign with each value). Up to 512 values per line. Can be specified multiple times to store multiple lines of data.
90+
- **Protocol**, must be `RAW`
91+
- **RAW_Data**, contains an array of timings, specified in microseconds Values must be non-zero, start with a positive number, and interleaved (change sign with each value). Up to 512 values per line. Can be specified multiple times to store multiple lines of data.
9292

9393
Example of RAW data:
9494

@@ -97,6 +97,43 @@ Example of RAW data:
9797

9898
Long payload not fitting into internal memory buffer and consisting of short duration timings (< 10us) may not be read fast enough from the SD card. That might cause the signal transmission to stop before reaching the end of the payload. Ensure that your SD Card has good performance before transmitting long or complex RAW payloads.
9999

100+
### BIN_RAW Files
101+
102+
BinRAW `.sub` files and `RAW` files both contain data that has not been decoded by any protocol. However, unlike `RAW`, `BinRAW` files only record a useful repeating sequence of durations with a restored byte transfer rate and without broadcast noise. These files can emulate nearly all static protocols, whether Flipper knows them or not.
103+
104+
- Usually, you have to receive the signal a little longer so that Flipper accumulates sufficient data for correct analysis.
105+
106+
For `BinRAW` files, the following parameters are required and must be aligned to the left:
107+
108+
- **Protocol**, must be `BinRAW`.
109+
- **Bit**, is the length of the payload of the entire file, in bits (max 4096).
110+
- **TE**, is the quantization interval, in us.
111+
- **Bit_RAW**, is the length of the payload in the next Data_RAW parameter, in bits.
112+
- **Data_RAW**, is an encoded sequence of durations, where each bit in the sequence encodes one TE interval: 1 - high level (there is a carrier), 0 - low (no carrier).
113+
For example, TE=100, Bit_RAW=8, Data_RAW=0x37 => 0b00110111, that is, `-200 200 -100 300` will be transmitted.
114+
When sending uploads, `Bit_RAW` and `Data_RAW` form a repeating block. Several such blocks are necessary if you want to send different sequences sequentially. However, usually, there will be only one block.
115+
116+
Example data from a `BinRAW` file:
117+
118+
```
119+
...
120+
Protocol: BinRAW
121+
Bit: 1572
122+
TE: 597
123+
Bit_RAW: 260
124+
Data_RAW: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 4A B5 55 4C B3 52 AC D5 2D 53 52 AD 4A D5 35 00
125+
Bit_RAW: 263
126+
Data_RAW: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 04 D5 32 D2 AB 2B 33 32 CB 2C CC B3 52 D3 00
127+
Bit_RAW: 259
128+
Data_RAW: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 4A AB 55 34 D5 2D 4C CD 33 4A CD 55 4C D2 B3 00
129+
Bit_RAW: 263
130+
Data_RAW: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 7F 4A AA D5 2A CC B2 B4 CB 34 CC AA AB 4D 53 53 00
131+
Bit_RAW: 264
132+
Data_RAW: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FC 00 00 15 2C CB 34 D3 35 35 4D 4B 32 B2 D3 33 00
133+
Bit_RAW: 263
134+
Data_RAW: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DE 02 D3 54 D5 4C D2 CC AD 4B 2C B2 B5 54 CC AB 00
135+
```
136+
100137
## File examples
101138

102139
### Key file, standard preset

0 commit comments

Comments
 (0)