You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
935 B

#ifndef COMMONUTIL_H
#define COMMONUTIL_H
#include <QByteArray>
class CommonUtil
{
public:
CommonUtil();
static QByteArray quint8ArrToQByteArray(quint8 *arr,int lengths);
static void crc16(quint8 crc[], quint8 data[], int pos,int len);
static int isBigEndianOrder();
#ifdef Q_OS_WIN
static quint32 Lc_ntohl(quint32 data);
static quint32 Lc_htonl(quint32 data);
static quint16 Lc_ntohs(quint16 data);
static quint16 Lc_htons(quint16 data);
#endif
static void Lc_buf_copy_uc(quint8 *d,const quint8 *s,quint32 num);
static void delay(quint32 n);
static QString getHostIpAddress();
static QString getHostMacAddress();
static QString ByteArrayToHexString(const QByteArray &ba);
static QByteArray HexStringToByteArray(QString HexString);
static QString ByteArrayToNonZeroString(const QByteArray &ba);
static QString i_pA_2_text(unsigned int iPA);
};
#endif // COMMONUTIL_H