-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathnxdnmessage.h
99 lines (88 loc) · 4.69 KB
/
nxdnmessage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2016 Edouard Griffiths, F4EXB. //
// //
// 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 as version 3 of the License, or //
// //
// 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 V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef NXDNMESSAGE_H_
#define NXDNMESSAGE_H_
#include "export.h"
namespace DSDcc
{
struct DSDCC_API AdjacentSiteInformation
{
unsigned char m_siteNumber; // 1 to 16
unsigned int m_locationId; // 24 bit
unsigned short m_channelNumber; // 10 bit
};
/** A layer-3 message */
struct DSDCC_API Message
{
public:
void reset();
void setMessageIndex(unsigned int index); //!< sets the message index in dual message case
void setFromSACCH(int index, const unsigned char *data);
void setFromFACCH1(const unsigned char *data);
void setFromFACCH2(const unsigned char *data);
void setFromCAC(const unsigned char *data);
void setFromCACShort(const unsigned char *data);
void setFromCACLong(const unsigned char *data);
bool hasBroadcastInformation() const;
unsigned char getMessageType() const;
bool getSourceUnitId(unsigned short& id) const;
bool getDestinationGroupId(unsigned short& id) const;
bool isGroupCall(bool& sw) const;
bool getLocationId(unsigned int& id) const;
bool getServiceInformation(unsigned short& sibits) const;
bool getAdjacentSitesInformation(AdjacentSiteInformation *adjacentSites, int nbSitesToGet) const;
bool isFullRate(bool& fullRate) const;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_IV;
static const unsigned char NXDN_MESSAGE_TYPE_DCALL_HDR;
static const unsigned char NXDN_MESSAGE_TYPE_DCALL_DATA;
static const unsigned char NXDN_MESSAGE_TYPE_DCALL_ACK;
static const unsigned char NXDN_MESSAGE_TYPE_TX_REL;
static const unsigned char NXDN_MESSAGE_TYPE_HEAD_DLY;
static const unsigned char NXDN_MESSAGE_TYPE_SDCALL_REQ_HDR;
static const unsigned char NXDN_MESSAGE_TYPE_SDCALL_REQ_DATA;
static const unsigned char NXDN_MESSAGE_TYPE_SDCALL_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_SDCALL_IV;
static const unsigned char NXDN_MESSAGE_TYPE_STAT_INQ_REQ;
static const unsigned char NXDN_MESSAGE_TYPE_STAT_INQ_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_STAT_REQ;
static const unsigned char NXDN_MESSAGE_TYPE_STAT_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_REM_CON_REQ;
static const unsigned char NXDN_MESSAGE_TYPE_REM_CON_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_IDLE;
static const unsigned char NXDN_MESSAGE_TYPE_AUTH_INQ_REQ;
static const unsigned char NXDN_MESSAGE_TYPE_AUTH_INQ_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_PROP_FORM;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_ASSGN;
static const unsigned char NXDN_MESSAGE_TYPE_SRV_INFO;
static const unsigned char NXDN_MESSAGE_TYPE_SITE_INFO;
static const unsigned char NXDN_MESSAGE_TYPE_ADJ_SITE_INFO;
static const unsigned char NXDN_MESSAGE_TYPE_GRP_REG_REQ_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_REQ;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_REC_REQ;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_REC_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_CONN_REQ;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_CONN_RESP;
static const unsigned char NXDN_MESSAGE_TYPE_VCALL_ASSGN_DUP;
private:
bool hasCallDetails() const;
bool hasGroupCallInfo() const;
unsigned char m_data[22]; //!< Maximum 22 bytes
unsigned int m_shift; //!< index shift for dual messages
};
} // namespace
#endif /* NXDNMESSAGE_H_ */