AtCmdCommon/Inc/AtCmdBase.h

49 lines
846 B
C

//
// Created by xemon on 09.09.22.
//
#ifndef GSMAT_GSMATCOMMANDRESULT_H
#define GSMAT_GSMATCOMMANDRESULT_H
#include <SystemMutexInterface.h>
#include "SerialPort.h"
#include "stddef.h"
typedef enum {
AT_BUSY = -3,
AT_TIMEOUT = -2,
AT_NONE = -1,
AT_ERROR = 0,
AT_OK = 1,
} AtCommandResult;
typedef struct {
size_t len;
char *data;
size_t limit;
} tAtBuffer;
typedef struct {
void *env;
void (*process)(void *env, tAtBuffer *buffer);
} tAtCmdUrcProcessor;
#define AtCmdUrcProcessor_Process(ENV, BUFF) (ENV)->process((ENV)->env,BUFF)
typedef struct {
tSerialPortIO *io;
tAtBuffer txBuffer;
tAtBuffer rxBuffer;
uint32_t stdTxTimeout;
uint32_t stdRxTimeout;
tAtCmdUrcProcessor urcProcessor;
tSystemMutexInterface *access;
} tAtCmd;
#endif //GSMAT_GSMATCOMMANDRESULT_H