mirror of https://github.com/g4klx/MMDVMHost
Add access to the M17 META data field in the LSF.
This commit is contained in:
parent
8d6da34b79
commit
ccdf708bbd
|
|
@ -50,8 +50,8 @@ const unsigned int M17_PAYLOAD_LENGTH_BITS = 128U;
|
||||||
const unsigned int M17_PAYLOAD_LENGTH_BYTES = M17_PAYLOAD_LENGTH_BITS / 8U;
|
const unsigned int M17_PAYLOAD_LENGTH_BYTES = M17_PAYLOAD_LENGTH_BITS / 8U;
|
||||||
|
|
||||||
const unsigned char M17_NULL_NONCE[] = {0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U};
|
const unsigned char M17_NULL_NONCE[] = {0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U};
|
||||||
const unsigned int M17_NONCE_LENGTH_BITS = 112U;
|
const unsigned int M17_META_LENGTH_BITS = 112U;
|
||||||
const unsigned int M17_NONCE_LENGTH_BYTES = M17_NONCE_LENGTH_BITS / 8U;
|
const unsigned int M17_META_LENGTH_BYTES = M17_META_LENGTH_BITS / 8U;
|
||||||
|
|
||||||
const unsigned int M17_FN_LENGTH_BITS = 16U;
|
const unsigned int M17_FN_LENGTH_BITS = 16U;
|
||||||
const unsigned int M17_FN_LENGTH_BYTES = M17_FN_LENGTH_BITS / 8U;
|
const unsigned int M17_FN_LENGTH_BYTES = M17_FN_LENGTH_BITS / 8U;
|
||||||
|
|
|
||||||
16
M17LSF.cpp
16
M17LSF.cpp
|
|
@ -144,9 +144,23 @@ void CM17LSF::setCAN(unsigned char can)
|
||||||
m_lsf[12U] |= (can >> 1) & 0x07U;
|
m_lsf[12U] |= (can >> 1) & 0x07U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CM17LSF::getMeta(unsigned char* data) const
|
||||||
|
{
|
||||||
|
assert(data != NULL);
|
||||||
|
|
||||||
|
::memcpy(data, m_lsf + 14U, M17_META_LENGTH_BYTES);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CM17LSF::setMeta(const unsigned char* data)
|
||||||
|
{
|
||||||
|
assert(data != NULL);
|
||||||
|
|
||||||
|
::memcpy(m_lsf + 14U, data, M17_META_LENGTH_BYTES);
|
||||||
|
}
|
||||||
|
|
||||||
void CM17LSF::reset()
|
void CM17LSF::reset()
|
||||||
{
|
{
|
||||||
::memset(m_lsf, 0x00U, 30U);
|
::memset(m_lsf, 0x00U, M17_LSF_LENGTH_BYTES);
|
||||||
|
|
||||||
m_valid = false;
|
m_valid = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
M17LSF.h
3
M17LSF.h
|
|
@ -50,6 +50,9 @@ public:
|
||||||
unsigned char getCAN() const;
|
unsigned char getCAN() const;
|
||||||
void setCAN(unsigned char can);
|
void setCAN(unsigned char can);
|
||||||
|
|
||||||
|
void getMeta(unsigned char* data) const;
|
||||||
|
void setMeta(const unsigned char* data);
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue