MOBILISIS-Calculator/main/terminal_utils.h

32 lines
885 B
C
Raw Normal View History

2024-06-13 17:23:47 +02:00
#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();
2024-06-14 11:54:43 +02:00
//uint32_t crc32(const char *s, size_t n);
//uint32_t crc32(QByteArray const &ba);
2024-06-13 17:23:47 +02:00
uint32_t crc32(QByteArray const &ba);
2024-06-14 11:54:43 +02:00
uint32_t crc32(uint32_t crc, unsigned char* pData, size_t len);
2024-06-13 17:23:47 +02:00
char lrc(QByteArray const &ba);
bool isBigEndian();
}
#endif // TERMINAL_UTILS_H_INCLUDED