MOBILISIS-Calculator/main/terminal_utils.h
2024-06-14 11:54:43 +02:00

32 lines
885 B
C++

#ifndef TERMINAL_UTILS_H_INCLUDED
#define TERMINAL_UTILS_H_INCLUDED
#include <cinttypes>
#include <QByteArray>
namespace TU {
enum STATUS : uint8_t {
TERMINAL_CB2_KEYS_NOT_PRESENT = 0x30,
TERMINAL_NO_BANKING_PARAMETERS_PRESENT = 0x31,
TERMINAL_IS_BLOCKED = 0x32,
TERMINAL_NOT_OPERATIVE = 0x33,
TERMINAL_IS_READY_AND_ACTIVE = 0x34,
TERMINAL_IS_READY_AND_NOT_ACTIVE = 0x35,
TERMINAL_LOG_FULL = 0x36
};
char const *terminalStatus(uint8_t status);
QByteArray int2Hex(int i);
uint16_t getNextTransactionId();
//uint32_t crc32(const char *s, size_t n);
//uint32_t crc32(QByteArray const &ba);
uint32_t crc32(QByteArray const &ba);
uint32_t crc32(uint32_t crc, unsigned char* pData, size_t len);
char lrc(QByteArray const &ba);
bool isBigEndian();
}
#endif // TERMINAL_UTILS_H_INCLUDED