mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 06:55:52 +08:00
Reverse the bit order of the transmitted characters.
This commit is contained in:
@@ -184,14 +184,14 @@ void CPOCSAGControl::addAddress()
|
|||||||
|
|
||||||
void CPOCSAGControl::packASCII()
|
void CPOCSAGControl::packASCII()
|
||||||
{
|
{
|
||||||
const unsigned char MASK = 0x40U;
|
const unsigned char MASK = 0x01U;
|
||||||
|
|
||||||
uint32_t word = 0x80000000U;
|
uint32_t word = 0x80000000U;
|
||||||
unsigned int n = 0U;
|
unsigned int n = 0U;
|
||||||
|
|
||||||
for (std::string::const_iterator it = m_text.cbegin(); it != m_text.cend(); ++it) {
|
for (std::string::const_iterator it = m_text.cbegin(); it != m_text.cend(); ++it) {
|
||||||
unsigned char c = *it;
|
unsigned char c = *it;
|
||||||
for (unsigned int j = 0U; j < 7U; j++, c <<= 1) {
|
for (unsigned int j = 0U; j < 7U; j++, c >>= 1) {
|
||||||
bool b = (c & MASK) == MASK;
|
bool b = (c & MASK) == MASK;
|
||||||
if (b)
|
if (b)
|
||||||
word |= DATA_MASK[n];
|
word |= DATA_MASK[n];
|
||||||
@@ -209,7 +209,7 @@ void CPOCSAGControl::packASCII()
|
|||||||
// Add at least one EOT to the message
|
// Add at least one EOT to the message
|
||||||
do {
|
do {
|
||||||
unsigned char c = ASCII_EOT;
|
unsigned char c = ASCII_EOT;
|
||||||
for (unsigned int j = 0U; j < 7U; j++, c <<= 1) {
|
for (unsigned int j = 0U; j < 7U; j++, c >>= 1) {
|
||||||
bool b = (c & MASK) == MASK;
|
bool b = (c & MASK) == MASK;
|
||||||
if (b)
|
if (b)
|
||||||
word |= DATA_MASK[n];
|
word |= DATA_MASK[n];
|
||||||
|
|||||||
Reference in New Issue
Block a user