feature/AudioLoginLogoff
Geoffrey Merck 6 years ago
parent db6d8bdf48
commit e2f1c6273b

@ -148,7 +148,7 @@ CAudioUnit::~CAudioUnit()
delete[] m_data;
}
void CAudioUnit::sendStatus()
void CAudioUnit::sendAck()
{
if (m_ambe == NULL)
return;
@ -160,21 +160,6 @@ void CAudioUnit::sendStatus()
m_timer.start();
}
// void CAudioUnit::setStatus(LINK_STATUS status, const std::string& reflector, const std::string& text)
// {
// m_linkStatus = status;
// m_reflector = reflector;
// m_text = text;
// }
// void CAudioUnit::setTempStatus(LINK_STATUS status, const std::string& reflector, const std::string& text)
// {
// m_tempLinkStatus = status;
// m_tempReflector = reflector;
// m_tempText = text;
// m_hasTemporary = true;
// }
void CAudioUnit::setAck(ACK_TYPE ackType, const std::string& groupName, const std::string& user, const std::string& repeater, const std::string& gateway, const in_addr& destination)
{
m_ackType = ackType;
@ -293,49 +278,6 @@ bool CAudioUnit::lookup(unsigned int id, const std::string &name, const in_addr&
return true;
}
// void CAudioUnit::spellReflector(unsigned int id, const std::string &reflector)
// {
// unsigned int length = reflector.size();
// for (unsigned int i = 0; i < (length - 1); i++) {
// std::string c = reflector.substr(i, 1);
// if (c.compare(" "))
// lookup(id, c);
// }
// char c = reflector.at(length - 1);
// if (c == ' ')
// return;
// std::string cstr;
// cstr.push_back(c);
// if (m_linkStatus == LS_LINKING_DCS || m_linkStatus == LS_LINKED_DCS ||
// m_linkStatus == LS_LINKING_CCS || m_linkStatus == LS_LINKED_CCS) {
// lookup(id, cstr);
// return;
// }
// switch (c) {
// case 'A':
// lookup(id, "alpha");
// break;
// case 'B':
// lookup(id, "bravo");
// break;
// case 'C':
// lookup(id, "charlie");
// break;
// case 'D':
// lookup(id, "delta");
// break;
// default:
// lookup(id, cstr);
// break;
// }
// }
bool CAudioUnit::readAMBE(const std::string& name)
{
std::string dir = DATA_DIR;
@ -491,58 +433,3 @@ void CAudioUnit::spellGroup(unsigned int id, const std::string& groupName, const
lookup(id, cstr, destination);
}
}
// void CAudioUnit::sendStatus(LINK_STATUS status, const std::string& reflector, const std::string &text)
// {
// m_encoder.setTextData(text);
// // Create the message
// unsigned int id = CHeaderData::createId();
// lookup(id, " ");
// lookup(id, " ");
// lookup(id, " ");
// lookup(id, " ");
// bool found;
// switch (status) {
// case LS_NONE:
// lookup(id, "notlinked");
// break;
// case LS_LINKED_CCS:
// case LS_LINKED_DCS:
// // case LS_LINKED_DPLUS:
// case LS_LINKED_DEXTRA:
// case LS_LINKED_LOOPBACK:
// found = lookup(id, "linkedto");
// if (!found) {
// lookup(id, "linked");
// lookup(id, "2");
// }
// spellReflector(id, reflector);
// break;
// default:
// found = lookup(id, "linkingto");
// if (!found) {
// lookup(id, "linking");
// lookup(id, "2");
// }
// spellReflector(id, reflector);
// break;
// }
// lookup(id, " ");
// lookup(id, " ");
// lookup(id, " ");
// lookup(id, " ");
// // RPT1 and RPT2 will be filled in later
// CHeaderData header;
// header.setMyCall1(m_callsign);
// header.setMyCall2("INFO");
// header.setYourCall("CQCQCQ ");
// header.setId(id);
// m_handler->process(header, DIR_INCOMING, AS_INFO);
// }

@ -76,7 +76,7 @@ public:
CAudioUnit(CG2ProtocolHandler* handler);
~CAudioUnit();
void sendStatus();
void sendAck();
// void setStatus(LINK_STATUS status, const std::string& reflector, const std::string& text);
// void setTempStatus(LINK_STATUS status, const std::string& reflector, const std::string& text);
@ -99,7 +99,6 @@ private:
static unsigned int m_ambeLength;
static TEXT_LANG m_language;
CG2ProtocolHandler* m_handler;
//std::string m_callsign;
CSlowDataEncoder m_encoder;
AUDIO_STATUS m_status;
ACK_TYPE m_ackType;
@ -108,13 +107,6 @@ private:
std::string m_repeater;
std::string m_gateway;
in_addr m_destination;
// LINK_STATUS m_linkStatus;
// LINK_STATUS m_tempLinkStatus;
// std::string m_text;
// std::string m_tempText;
// std::string m_reflector;
// std::string m_tempReflector;
// bool m_hasTemporary;
CTimer m_timer;
CAMBEData** m_data;
unsigned int m_in;
@ -123,8 +115,6 @@ private:
std::chrono::high_resolution_clock::time_point m_time;
bool lookup(unsigned int id, const std::string& name, const in_addr& destination);
// void spellReflector(unsigned int id, const std::string& reflector);
// void sendStatus(LINK_STATUS status, const std::string& reflector, const std::string& text);
void sendAck(ACK_TYPE ackType, const std::string& groupeName, const std::string& user, const std::string& repeater, const std::string& gateway, const in_addr& destination);
void spellGroup(unsigned int id, const std::string& groupName, const in_addr& destination);

@ -1064,7 +1064,7 @@ void CGroupHandler::sendAck(const CUserData &user, ACK_TYPE ackType)
m_audioUnit = new CAudioUnit(m_g2Handler);
}
m_audioUnit->setAck(ackType, m_groupCallsign, user.getUser(), user.getRepeater(), user.getGateway(), user.getAddress());
m_audioUnit->sendStatus();
m_audioUnit->sendAck();
// unsigned int id = CHeaderData::createId();
// CHeaderData header(m_groupCallsign, " ", user.getUser(), user.getGateway(), user.getRepeater());

Loading…
Cancel
Save

Powered by TurnKey Linux.