2016-09-12 22:26:05 +00:00
|
|
|
/*
|
2017-08-19 11:37:32 +00:00
|
|
|
* Copyright (C) 2016,2017 by Jonathan Naylor G4KLX
|
2016-09-12 22:26:05 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if !defined(P25Data_H)
|
|
|
|
#define P25Data_H
|
|
|
|
|
2016-09-27 17:36:08 +00:00
|
|
|
#include "RS241213.h"
|
2016-09-15 19:28:56 +00:00
|
|
|
|
2016-09-12 22:26:05 +00:00
|
|
|
class CP25Data {
|
|
|
|
public:
|
|
|
|
CP25Data();
|
|
|
|
~CP25Data();
|
|
|
|
|
2016-09-22 18:39:19 +00:00
|
|
|
void encodeHeader(unsigned char* data);
|
2016-09-12 22:26:05 +00:00
|
|
|
|
2017-08-19 11:37:32 +00:00
|
|
|
bool decodeLDU1(const unsigned char* data);
|
2016-09-22 18:39:19 +00:00
|
|
|
void encodeLDU1(unsigned char* data);
|
2016-09-12 22:26:05 +00:00
|
|
|
|
2016-09-22 18:39:19 +00:00
|
|
|
void encodeLDU2(unsigned char* data);
|
2016-09-12 22:26:05 +00:00
|
|
|
|
2016-09-22 18:39:19 +00:00
|
|
|
void setMI(const unsigned char* mi);
|
|
|
|
void getMI(unsigned char* mi) const;
|
2016-09-12 22:26:05 +00:00
|
|
|
|
2016-09-22 18:39:19 +00:00
|
|
|
void setMFId(unsigned char id);
|
|
|
|
unsigned char getMFId() const;
|
2016-09-20 19:13:13 +00:00
|
|
|
|
2016-09-22 18:39:19 +00:00
|
|
|
void setAlgId(unsigned char id);
|
|
|
|
unsigned char getAlgId() const;
|
|
|
|
|
|
|
|
void setKId(unsigned int id);
|
|
|
|
unsigned int getKId() const;
|
|
|
|
|
|
|
|
void setEmergency(bool on);
|
|
|
|
bool getEmergency() const;
|
|
|
|
|
|
|
|
void setSrcId(unsigned int Id);
|
|
|
|
unsigned int getSrcId() const;
|
|
|
|
|
|
|
|
void setLCF(unsigned char lcf);
|
|
|
|
unsigned char getLCF() const;
|
|
|
|
|
|
|
|
void setDstId(unsigned int id);
|
|
|
|
unsigned int getDstId() const;
|
2016-09-12 22:26:05 +00:00
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
private:
|
2016-09-22 18:39:19 +00:00
|
|
|
unsigned char* m_mi;
|
|
|
|
unsigned char m_mfId;
|
|
|
|
unsigned char m_algId;
|
|
|
|
unsigned int m_kId;
|
|
|
|
unsigned char m_lcf;
|
|
|
|
bool m_emergency;
|
|
|
|
unsigned int m_srcId;
|
|
|
|
unsigned int m_dstId;
|
|
|
|
CRS241213 m_rs241213;
|
2016-09-13 17:27:50 +00:00
|
|
|
|
|
|
|
void decodeLDUHamming(const unsigned char* raw, unsigned char* data);
|
|
|
|
void encodeLDUHamming(unsigned char* data, const unsigned char* raw);
|
2016-09-12 22:26:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|