ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
9 мая
1152804 Топик полностью
il-2 (08.12.2021 06:03, просмотров: 252) ответил RxTx на И что смущает. Типичный прием.
Типичный - это когда делается подстановка, в результате которой управляющие коды встречаются только в тех местах, где должны. А тут - вместо одного кода поставили два, и там где его быть не должно. Вот пример правильной подстановки: 

The contents of a frame is unrestricted, this can lead to problems, since an A, C, FCS or I-field byte that appears to be flag may occur. A Control Escape (CE) byte is defined as binary 01111101 (X’7D’). Prior to transmitting a frame a station examines each byte between the beginning and ending flags. For each byte it encounters with the same value as a flag or CE byte (X’C0’, X’C1’, or X’7D’) it does the following.

1. Inserts a control escape (CE) byte preceding the byte

2. Complements bit 5 of the byte (i.e. exclusive OR’s the byte with X’20’)

The sending algorithm is shown below in a programmatic form.

Sending Algorithm Calculate FCS over Payload data For each byte in payload data and FCS

{

If byte is BOF, EOF, or CE

{

Insert CE

Insert byte XOR X’20’

}

}

Prior to FCS computation, the receiving station also examines the entire frame contents between the flags.

For each CE byte encountered it does the following:

1. Discards the CE byte

2. Complements bit 5 of the byte following CE