mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:41:38 +08:00
Simplify the P25 protocol.
This commit is contained in:
@@ -468,9 +468,6 @@ void CP25Control::writeNetwork(const unsigned char *data, unsigned char type, bo
|
|||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case P25_DUID_HEADER:
|
|
||||||
m_network->writeHeader();
|
|
||||||
break;
|
|
||||||
case P25_DUID_LDU1:
|
case P25_DUID_LDU1:
|
||||||
m_network->writeLDU1(data, m_rfData, m_rfLSD, end);
|
m_network->writeLDU1(data, m_rfData, m_rfLSD, end);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -26,17 +26,6 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
const unsigned char STARTICW[] = {
|
|
||||||
0x00U, 0x02U, 0x02U, 0x0CU, 0x0BU, 0x35U, 0xA3U, 0x00U, 0x00U, 0x00U};
|
|
||||||
|
|
||||||
const unsigned char VHDR1[] = {
|
|
||||||
0x60U, 0x02U, 0x02U, 0x0CU, 0x0BU, 0x35U, 0xA3U, 0x1AU, 0x65U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
|
||||||
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x08U, 0x00U, 0x00U, 0x00U, 0x00U, 0x02U, 0x2EU};
|
|
||||||
|
|
||||||
const unsigned char VHDR2[] = {
|
|
||||||
0x61U, 0x1DU, 0x35U, 0x34U, 0x37U, 0x0AU, 0x22U, 0x35U, 0x3EU, 0x00U, 0x10U, 0x02U, 0x11U, 0x28U, 0x1DU, 0x21U,
|
|
||||||
0x03U, 0x1BU, 0x00U, 0x35U, 0x23U, 0x02U};
|
|
||||||
|
|
||||||
const unsigned char REC62[] = {
|
const unsigned char REC62[] = {
|
||||||
0x62U, 0x02U, 0x02U, 0x0CU, 0x0BU, 0x35U, 0xA3U, 0x1AU, 0x65U, 0x80U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
0x62U, 0x02U, 0x02U, 0x0CU, 0x0BU, 0x35U, 0xA3U, 0x1AU, 0x65U, 0x80U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U,
|
||||||
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x02U};
|
0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x02U};
|
||||||
@@ -73,32 +62,6 @@ bool CP25Network::open()
|
|||||||
return m_socket.open();
|
return m_socket.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CP25Network::writeHeader()
|
|
||||||
{
|
|
||||||
if (m_debug)
|
|
||||||
CUtils::dump(1U, "P25 Network ICW Sent", STARTICW, 10U);
|
|
||||||
|
|
||||||
bool ret = m_socket.write(STARTICW, 10U, m_address, m_port);
|
|
||||||
if (!ret)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (m_debug)
|
|
||||||
CUtils::dump(1U, "P25 Network VHDR1 Sent", VHDR1, 30U);
|
|
||||||
|
|
||||||
ret = m_socket.write(VHDR1, 30U, m_address, m_port);
|
|
||||||
if (!ret)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (m_debug)
|
|
||||||
CUtils::dump(1U, "P25 Network VHDR2 Sent", VHDR2, 22U);
|
|
||||||
|
|
||||||
ret = m_socket.write(VHDR2, 22U, m_address, m_port);
|
|
||||||
if (!ret)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CP25Network::writeLDU1(const unsigned char* ldu1, const CP25Data& control, const CP25LowSpeedData& lsd, bool end)
|
bool CP25Network::writeLDU1(const unsigned char* ldu1, const CP25Data& control, const CP25LowSpeedData& lsd, bool end)
|
||||||
{
|
{
|
||||||
assert(ldu1 != NULL);
|
assert(ldu1 != NULL);
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ public:
|
|||||||
|
|
||||||
void enable(bool enabled);
|
void enable(bool enabled);
|
||||||
|
|
||||||
bool writeHeader();
|
|
||||||
|
|
||||||
bool writeLDU1(const unsigned char* ldu1, const CP25Data& control, const CP25LowSpeedData& lsd, bool end);
|
bool writeLDU1(const unsigned char* ldu1, const CP25Data& control, const CP25LowSpeedData& lsd, bool end);
|
||||||
|
|
||||||
bool writeLDU2(const unsigned char* ldu2, const CP25Data& control, const CP25LowSpeedData& lsd, bool end);
|
bool writeLDU2(const unsigned char* ldu2, const CP25Data& control, const CP25LowSpeedData& lsd, bool end);
|
||||||
|
|||||||
Reference in New Issue
Block a user