Skip to content

Commit a27f874

Browse files
committed
just formatting
1 parent b684317 commit a27f874

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/TCOBSv1Specification.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
</ol>
3434
</details>
3535

36-
## 1. <a name='TCOBSEncodingPrinciple'></a>TCOBS Encoding Principle
36+
## 1. <a id='TCOBSEncodingPrinciple'></a>TCOBS Encoding Principle
3737

38-
### 1.1. <a name='Symbols'></a>Symbols
38+
### 1.1. <a id='Symbols'></a>Symbols
3939

4040
* `o` = offset bit to next sigil byte
4141

@@ -52,14 +52,14 @@
5252
* `00000ooo` reserved bytes: `ooo` = 1-7
5353
* `00000000` forbidden byte
5454

55-
#### 1.1.1. <a name='NOPSigilByteN'></a>NOP Sigil Byte `N`
55+
#### 1.1.1. <a id='NOPSigilByteN'></a>NOP Sigil Byte `N`
5656

5757
This does not represent data in the stream and only serves to keep the chain linked. The remaining 5 bits encode the distance to the next sigil (0 <= n <=31).
5858
* N_0 = `101000001`
5959
* ...
6060
* N_31 = `10111111`
6161

62-
#### 1.1.2. <a name='ZeroSigilByteZ1Z2Z3'></a>Zero Sigil Byte `Z1`, `Z2`, `Z3`
62+
#### 1.1.2. <a id='ZeroSigilByteZ1Z2Z3'></a>Zero Sigil Byte `Z1`, `Z2`, `Z3`
6363

6464
* This sigil represents 1 to 3 zeroes in the data stream, and is a `00` to `00 00 00` replacement to eliminate zeroes, reduce data and keep the chain linked.
6565
* The remaining 5 bits encode the distance to the next sigil (0 <= n <= 31).
@@ -73,7 +73,7 @@ This does not represent data in the stream and only serves to keep the chain lin
7373
* ...
7474
* Z3_31 = `01111111`
7575

76-
#### 1.1.3. <a name='FullSigilByteF2F3F4'></a>Full Sigil Byte `F2`, `F3`, `F4`
76+
#### 1.1.3. <a id='FullSigilByteF2F3F4'></a>Full Sigil Byte `F2`, `F3`, `F4`
7777

7878
* This sigil represents 2 to 4 0xFF in the data stream, and is a `FF FF` to `FF FF FF FF` replacement to reduce data and keep the chain linked.
7979
* The remaining 5 bits encode the distance to the next sigil (0 <= n <= 31).
@@ -87,7 +87,7 @@ This does not represent data in the stream and only serves to keep the chain lin
8787
* ...
8888
* F4_31 = `10011111`
8989

90-
#### 1.1.4. <a name='RepeatSigilByteR2R3R4'></a>Repeat Sigil Byte `R2`, `R3`, `R4`
90+
#### 1.1.4. <a id='RepeatSigilByteR2R3R4'></a>Repeat Sigil Byte `R2`, `R3`, `R4`
9191

9292
* This sigil represents 2 to 4 repetitions of previous byte in the data stream, and is a replacement to reduce data and keep the chain linked.
9393
* The remaining 3 bits encode the distance to the next sigil (0 <= n <= 7).
@@ -101,11 +101,11 @@ This does not represent data in the stream and only serves to keep the chain lin
101101
* ...
102102
* R4_7 = `00011111`
103103

104-
### 1.2. <a name='TCOBSEncoding'></a>TCOBS Encoding
104+
### 1.2. <a id='TCOBSEncoding'></a>TCOBS Encoding
105105

106106
The encoding can be done in a straight forward code on the senders side touching each byte only once.
107107

108-
#### 1.2.1. <a name='SimpleEncodingAlgorithm'></a>Simple Encoding Algorithm
108+
#### 1.2.1. <a id='SimpleEncodingAlgorithm'></a>Simple Encoding Algorithm
109109

110110
* `aa` represents any non-zero and non-FF byte
111111
* `aa aa ...` represents any non-zero and non-FF **equal** bytes
@@ -150,7 +150,7 @@ The encoding can be done in a straight forward code on the senders side touching
150150
* Example: `00 00 00 00` could be encoded `A0 20` (Z3 Z1) or `40 40` (Z2 Z2)
151151
* NOP sigil bytes are logically ignored. They simply serve as link chain elements.
152152

153-
#### 1.2.2. <a name='SigilBytesChaining'></a>Sigil Bytes Chaining
153+
#### 1.2.2. <a id='SigilBytesChaining'></a>Sigil Bytes Chaining
154154

155155
* The encoding starts at first buffer address.
156156
* The encoded buffer ends with a sigil byte.
@@ -170,15 +170,15 @@ The encoding can be done in a straight forward code on the senders side touching
170170

171171
<p align="right">(<a href="#top">back to top</a>)</p>
172172

173-
## 2. <a name='TCOBSSoftwareInterface'></a>TCOBS Software Interface
173+
## 2. <a id='TCOBSSoftwareInterface'></a>TCOBS Software Interface
174174

175-
### 2.1. <a name='CInterfaceandCode'></a>C Interface and Code
175+
### 2.1. <a id='CInterfaceandCode'></a>C Interface and Code
176176

177177
* [../tcobs.h](../tcobs.h)
178178
* [..tcobsEncode.c](../tcobsEncode.c)
179179
* [..tcobsDecode.c](../tcobsDecode.c)
180180

181-
### 2.2. <a name='GointerfaceandCode'></a>Go interface and Code
181+
### 2.2. <a id='GointerfaceandCode'></a>Go interface and Code
182182

183183
```Go
184184
// TCOBSCEncode a slice of bytes to a null-terminated frame
@@ -196,11 +196,11 @@ func TCOBSDecode(p []byte) []byte)
196196

197197
<p align="right">(<a href="#top">back to top</a>)</p>
198198

199-
## 3. <a name='Appendix:ExtendedEncodingPossibilities'></a>Appendix: Extended Encoding Possibilities
199+
## 3. <a id='Appendix:ExtendedEncodingPossibilities'></a>Appendix: Extended Encoding Possibilities
200200

201201
* The reserved bytes `00000ooo` with `ooo` = 1-7 are usable in any manner.
202202

203-
### 3.1. <a name='Example:RLEforlongerrowsofequalbytesnotimplemented'></a>Example: RLE for longer rows of equal bytes (not implemented)
203+
### 3.1. <a id='Example:RLEforlongerrowsofequalbytesnotimplemented'></a>Example: RLE for longer rows of equal bytes (not implemented)
204204

205205
It is possible to improve compression by the following means. This complicates the encoder and makes no sense for messages like [*Trice*](https://github.com/rokath/trice) produces. But if user data with long equal byte rows are expected, it can make sense to implement it, when computing power matters and a standard zipping code is too slow.
206206

@@ -264,13 +264,13 @@ These 5 sigils allow a minimum encoded byte count for equal bytes in a row of up
264264

265265
As said, these extended possibilities are currently **not implemented** and shown just for discussion. A decoder, able to interpret such extension, will decode simple encoding as well.
266266

267-
### 3.2. <a name='OtherExample:Anyproposal'></a>Other Example: Any proposal?
267+
### 3.2. <a id='OtherExample:Anyproposal'></a>Other Example: Any proposal?
268268

269269
F4 is maybe not use that often and could be used in a completely different way. But this would lead to a different method.
270270

271271
<p align="right">(<a href="#top">back to top</a>)</p>
272272

273-
## 4. <a name='Changelog'></a>Changelog
273+
## 4. <a id='Changelog'></a>Changelog
274274

275275
| Date | Version | Comment |
276276
| - | - | - |

0 commit comments

Comments
 (0)