mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-20 22:45:44 +08:00
Add more asserts to catch bugs.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "DMRCSBK.h"
|
||||
#include "Log.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cassert>
|
||||
|
||||
CDMRControl::CDMRControl(unsigned int id, unsigned int colorCode, unsigned int timeout, CModem* modem, CDMRIPSC* network, IDisplay* display, bool duplex) :
|
||||
@@ -38,6 +39,8 @@ CDMRControl::~CDMRControl()
|
||||
|
||||
bool CDMRControl::processWakeup(const unsigned char* data)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
// Wakeups always come in on slot 1
|
||||
if (data[0U] != TAG_DATA || data[1U] != (DMR_IDLE_RX | DMR_SYNC_DATA | DT_CSBK))
|
||||
return false;
|
||||
@@ -65,21 +68,29 @@ bool CDMRControl::processWakeup(const unsigned char* data)
|
||||
|
||||
void CDMRControl::writeModemSlot1(unsigned char *data)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
m_slot1.writeModem(data);
|
||||
}
|
||||
|
||||
void CDMRControl::writeModemSlot2(unsigned char *data)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
m_slot2.writeModem(data);
|
||||
}
|
||||
|
||||
unsigned int CDMRControl::readModemSlot1(unsigned char *data)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
return m_slot1.readModem(data);
|
||||
}
|
||||
|
||||
unsigned int CDMRControl::readModemSlot2(unsigned char *data)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
return m_slot2.readModem(data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user