DLE Encoder Improvements #467
|
@ -8,14 +8,6 @@ DleEncoder::~DleEncoder() {}
|
|||
ReturnValue_t DleEncoder::encode(const uint8_t* sourceStream,
|
||||
size_t sourceLen, uint8_t* destStream, size_t maxDestLen,
|
||||
size_t* encodedLen, bool addStxEtx) {
|
||||
if (addStxEtx) {
|
||||
size_t currentIdx = 0;
|
||||
if(not escapeStxEtx) {
|
||||
destStream[currentIdx++] = DLE_CHAR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(escapeStxEtx) {
|
||||
mohr marked this conversation as resolved
Outdated
|
||||
return encodeStreamEscaped(sourceStream, sourceLen,
|
||||
destStream, maxDestLen, encodedLen, addStxEtx);
|
||||
|
|
Loading…
Reference in New Issue
Block a user
addStxEtx comes into play here, too. If it is false, 1 or even 0 might be valid. I think STREAM_TOO_SHORT should be caught directely when writing to the dest stream