XfcTransportProtocol/Inc/XfcProtDecoder.h

37 lines
911 B
C

//
// Created by xemon on 05.05.2022.
//
#ifndef XFCTRANSPORTPACKETPARSER_H
#define XFCTRANSPORTPACKETPARSER_H
#include "stdint.h"
#include "stdbool.h"
#include "XfcArray.h"
typedef struct {
uint8_t magic;
tXfcArray *buffer;
} tXfcProtDecoder;
uint16_t XfcTransPackDecoderNextMagicFrom(tXfcProtDecoder *env, uint16_t begin);
bool XfcTransPackDecoderIsStartsWithMagick(tXfcProtDecoder *env);
bool XfcTransPackDecoderHasHeader(tXfcProtDecoder *env);
uint16_t XfcTransPackDecoderGetId(tXfcProtDecoder *env);
uint16_t XfcTransPackDecoderGetDataSegmentLength(tXfcProtDecoder *env);
uint16_t XfcTransPackDecoderGetRequiredFullPackLength(tXfcProtDecoder *env);
bool XfcTransPackDecoderHasRequiredLength(tXfcProtDecoder *env);
bool XfcTransPackDecoderIsCrcCorrect(tXfcProtDecoder *env);
tXfcArray XfcTransPackDecoderGetDataSegmentAsArray(tXfcProtDecoder *env);
#endif //XFCTRANSPORTPACKETPARSER_H