当前位置: 首页>>代码示例>>C++>>正文


C++ CHeaderData::getId方法代码示例

本文整理汇总了C++中CHeaderData::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ CHeaderData::getId方法的具体用法?C++ CHeaderData::getId怎么用?C++ CHeaderData::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CHeaderData的用法示例。


在下文中一共展示了CHeaderData::getId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: writeHeaderInt

void CDPlusHandler::writeHeaderInt(IReflectorCallback* handler, CHeaderData& header, DIRECTION direction)
{
	wxASSERT(handler != NULL);

	if (m_linkState != DPLUS_LINKED)
		return;

	if (direction != m_direction)
		return;

	// Already is use?
	if (m_dPlusId != 0x00U)
		return;

	switch (m_direction) {
		case DIR_OUTGOING:
			if (m_destination == handler) {
				header.setRepeaters(m_callsign, m_reflector);
				header.setDestination(m_yourAddress, m_yourPort);
				m_handler->writeHeader(header);
				m_rptrId = header.getId();
			}
			break;

		case DIR_INCOMING:
			header.setDestination(m_yourAddress, m_yourPort);
			m_handler->writeHeader(header);
			break;
	}
}
开发者ID:BackupTheBerlios,项目名称:opendv-svn,代码行数:30,代码来源:DPlusHandler.cpp

示例2: processInt

void CXReflectorDPlusHandler::processInt(CHeaderData& header)
{
    wxString   rpt1 = header.getRptCall1();
    wxString   rpt2 = header.getRptCall2();
    unsigned int id = header.getId();

    if (!m_linked)
        return;

    // Convert the callsign(s) from the DPlus call to the repeater call
    wxString rpt = m_dplusCallsign;

    wxChar band = rpt2.GetChar(LONG_CALLSIGN_LENGTH - 1U);
    rpt.SetChar(LONG_CALLSIGN_LENGTH - 1U, band);

    // Check the destination callsign
    m_destination = CXReflectorReflectorHandler::findReflector(rpt);
    if (m_destination == NULL) {
        band = rpt1.GetChar(LONG_CALLSIGN_LENGTH - 1U);
        rpt.SetChar(LONG_CALLSIGN_LENGTH - 1U, band);

        m_destination = CXReflectorReflectorHandler::findReflector(rpt);
        if (m_destination == NULL) {
            wxLogMessage(wxT("Incoming unmatched D-Plus header, RPT1=%s, RPT2=%s"), rpt1.c_str(), rpt2.c_str());
            return;
        }
    }

    if (m_dPlusId != 0x00)
        return;

    m_dPlusId = id;
    m_inactivityTimer.start();
    m_pollInactivityTimer.reset();

    header.setCQCQCQ();
    header.setFlag1(0x00U);
    bool ret = m_destination->process(m_dPlusId, header);

    // Write to Users.log if it's enabled
    if (ret && m_userLogger != NULL)
        m_userLogger->write(header.getMyCall1(), header.getRptCall2(), m_reflector, PROTO_DPLUS);
}
开发者ID:jcyfkimi,项目名称:OpenDV,代码行数:43,代码来源:XReflectorDPlusHandler.cpp

示例3: writeHeaderInt

void CDExtraHandler::writeHeaderInt(const wxString& callsign, CHeaderData& header, DIRECTION direction)
{
	if (m_linkState != DEXTRA_LINKED)
		return;

	// Is it link in the right direction
	if (m_direction != direction)
		return;

	// Reject on invalid callsign if not a dongle link
	if (!m_repeater.IsEmpty()) {
		// Do the callsigns match?
		if (!callsign.IsSameAs(m_repeater))
			return;
	}

	// Already in use?
	if (m_dExtraId != 0x00)
		return;

	header.setDestination(m_address, m_port);
	m_handler->writeHeader(header);
	m_rptrId = header.getId();
}
开发者ID:BackupTheBerlios,项目名称:opendv-svn,代码行数:24,代码来源:DExtraHandler.cpp

示例4:

void CG2Handler::process(CHeaderData& header)
{
	// Is this a busy reply?
	unsigned char flag1 = header.getFlag1();
	if (flag1 == 0x01) {
		// Don't check the incoming stream
		// wxLogMessage(wxT("G2 busy message received"));
		return;
	}

	// Check to see if this is for StarNet
	CStarNetHandler* handler = CStarNetHandler::findStarNet(header);
	if (handler != NULL) {
		// Write to Header.log if it's enabled
		if (m_headerLogger != NULL)
			m_headerLogger->write(wxT("StarNet"), header);

		handler->process(header);
		return;
	}

	// No need to go any further
	if (m_maxRoutes == 0U)
		return;

	in_addr address = header.getYourAddress();
	unsigned int id = header.getId();

	for (unsigned int i = 0U; i < m_maxRoutes; i++) {
		CG2Handler* route = m_routes[i];
		if (route != NULL) {
			// Is this a duplicate header, ignore it
			if (route->m_id == id)
				return;
		}
	}	

	// Find the destination repeater
	CRepeaterHandler* repeater = CRepeaterHandler::findDVRepeater(header.getRptCall2());
	if (repeater == NULL) {
		wxLogMessage(wxT("Incoming G2 header from %s to unknown repeater - %s"), header.getMyCall1().c_str(), header.getRptCall2().c_str());
		return;		// Not found, ignore
	}

	CG2Handler* route = new CG2Handler(repeater, address, id);

	for (unsigned int i = 0U; i < m_maxRoutes; i++) {
		if (m_routes[i] == NULL) {
			m_routes[i] = route;

			// Write to Header.log if it's enabled
			if (m_headerLogger != NULL)
				m_headerLogger->write(wxT("G2"), header);

			repeater->process(header, DIR_INCOMING, AS_G2);
			return;
		}
	}

	wxLogMessage(wxT("No space to add new G2 route, ignoring"));

	delete route;
}
开发者ID:KH6VM,项目名称:OpenSystemFusion,代码行数:63,代码来源:G2Handler.cpp

示例5: process

bool CStarNetHandler::process(CHeaderData &header, AUDIO_SOURCE source)
{
	if (m_id != 0x00U)
		return false;

	wxString my = header.getMyCall1();
	m_id = header.getId();

	m_linkTimer.start();

	// Change the Your callsign to CQCQCQ
	header.setCQCQCQ();

	header.setFlag1(0x00);
	header.setFlag2(0x00);
	header.setFlag3(0x00);

	// Build new repeater list
	for (CStarNetUsersHashMap::const_iterator it = m_users.begin(); it != m_users.end(); ++it) {
		CStarNetUser* user = it->second;
		if (user != NULL) {
			// Find the user in the cache
			CUserData* userData = m_cache->findUser(user->getCallsign());

			if (userData != NULL) {
				// Find the users repeater in the repeater list, add it otherwise
				CStarNetRepeater* repeater = m_repeaters[userData->getRepeater()];
				if (repeater == NULL) {
					// Add a new repeater entry
					repeater = new CStarNetRepeater;
					repeater->m_destination = wxT("/") + userData->getRepeater().Left(6U) + userData->getRepeater().Right(1U);
					repeater->m_repeater    = userData->getRepeater();
					repeater->m_gateway     = userData->getGateway();
					repeater->m_address     = userData->getAddress();
					repeater->m_local       = CRepeaterHandler::findDVRepeater(userData->getRepeater());
					m_repeaters[userData->getRepeater()] = repeater;
				}

				delete userData;
				userData = NULL;
			}
		}
	}

	switch (m_callsignSwitch) {
		case SCS_GROUP_CALLSIGN:
			// Change the My Callsign 1 to be that of the StarNet group
			header.setMyCall1(m_groupCallsign);
			header.setMyCall2(wxT("SNET"));
			break;
		case SCS_USER_CALLSIGN:
			// Change the My Callsign 2 to be that of the StarNet group
			header.setMyCall1(my);
			header.setMyCall2(m_shortCallsign);
			break;
		default:
			break;
	}

	sendToRepeaters(header);

	if (m_txMsgSwitch)
		sendFromText(my);

	return true;
}
开发者ID:BackupTheBerlios,项目名称:opendv-svn,代码行数:66,代码来源:StarNetHandler.cpp

示例6: processInt

void CDExtraHandler::processInt(CHeaderData& header)
{
	unsigned int id = header.getId();
	wxString rpt1 = header.getRptCall1();
	wxString rpt2 = header.getRptCall2();

	if (m_linkState != DEXTRA_LINKED)
		return;

	switch (m_direction) {
		case DIR_OUTGOING: {
				// Always a repeater connection
				if (!m_reflector.IsSameAs(rpt2) && !m_reflector.IsSameAs(rpt1))
					return;

				// If we're already processing, ignore the new header
				if (m_dExtraId != 0x00U)
					return;

				// Write to Header.log if it's enabled
				if (m_headerLogger != NULL)
					m_headerLogger->write(wxT("DExtra"), header);

				m_dExtraId  = id;
				m_dExtraSeq = 0x00U;
				m_inactivityTimer.start();

				delete m_header;

				m_header = new CHeaderData(header);
				m_header->setCQCQCQ();
				m_header->setFlags(0x00U, 0x00U, 0x00U);

				m_destination->process(*m_header, AS_DEXTRA);
			}
			break;

		case DIR_INCOMING:
			if (!m_repeater.IsEmpty()) {
				// A repeater connection
				if (!m_repeater.IsSameAs(rpt2) && !m_repeater.IsSameAs(rpt1))
					return;

				// If we're already processing, ignore the new header
				if (m_dExtraId != 0x00U)
					return;

				// Write to Header.log if it's enabled
				if (m_headerLogger != NULL)
					m_headerLogger->write(wxT("DExtra"), header);

				m_dExtraId  = id;
				m_dExtraSeq = 0x00U;
				m_inactivityTimer.start();

				delete m_header;

				m_header = new CHeaderData(header);
				m_header->setCQCQCQ();
				m_header->setFlags(0x00U, 0x00U, 0x00U);

				m_destination->process(*m_header, AS_DEXTRA);
			} else {
				// A Dongle connection
				// Check the destination callsign
				m_destination = CRepeaterHandler::findDVRepeater(rpt2);
				if (m_destination == NULL) {
					m_destination = CRepeaterHandler::findDVRepeater(rpt1);
					if (m_destination == NULL)
						return;
				}

				// If we're already processing, ignore the new header
				if (m_dExtraId != 0x00U)
					return;

				// Write to Header.log if it's enabled
				if (m_headerLogger != NULL)
					m_headerLogger->write(wxT("DExtra"), header);

				m_dExtraId  = id;
				m_dExtraSeq = 0x00U;
				m_inactivityTimer.start();

				delete m_header;

				m_header = new CHeaderData(header);
				m_header->setCQCQCQ();
				m_header->setFlags(0x00U, 0x00U, 0x00U);

				m_destination->process(*m_header, AS_DEXTRA);
			}
			break;
	}
}
开发者ID:BackupTheBerlios,项目名称:opendv-svn,代码行数:95,代码来源:DExtraHandler.cpp

示例7: processInt

void CDPlusHandler::processInt(CHeaderData& header)
{
	wxString   rpt1 = header.getRptCall1();
	wxString   rpt2 = header.getRptCall2();
	unsigned int id = header.getId();

	if (m_linkState != DPLUS_LINKED)
		return;

	switch (m_direction) {
		case DIR_OUTGOING:
			if (m_reflector.IsSameAs(rpt1) || m_reflector.IsSameAs(rpt2)) {
				// If we're already processing, ignore the new header
				if (m_dPlusId != 0x00U)
					return;

				// Write to Header.log if it's enabled
				if (m_headerLogger != NULL)
					m_headerLogger->write(wxT("DPlus"), header);

				m_dPlusId  = id;
				m_dPlusSeq = 0x00U;
				m_inactivityTimer.start();
				m_pollInactivityTimer.reset();

				delete m_header;

				m_header = new CHeaderData(header);
				m_header->setCQCQCQ();
				m_header->setFlags(0x00U, 0x00U, 0x00U);

				m_destination->process(*m_header, AS_DPLUS);
			}
			break;

		case DIR_INCOMING: {
				m_destination = CRepeaterHandler::findDVRepeater(rpt1);
				if (m_destination == NULL) {
					m_destination = CRepeaterHandler::findDVRepeater(rpt2);
					if (m_destination == NULL)
						return;
				}

				if (m_dPlusId != 0x00U)
					return;

				// Write to Header.log if it's enabled
				if (m_headerLogger != NULL)
					m_headerLogger->write(wxT("DPlus"), header);

				m_dPlusId  = id;
				m_dPlusSeq = 0x00U;
				m_inactivityTimer.start();
				m_pollInactivityTimer.reset();

				delete m_header;

				m_header = new CHeaderData(header);
				m_header->setCQCQCQ();
				m_header->setFlags(0x00U, 0x00U, 0x00U);

				m_destination->process(*m_header, AS_DPLUS);
			}
			break;
	}
}
开发者ID:BackupTheBerlios,项目名称:opendv-svn,代码行数:66,代码来源:DPlusHandler.cpp


注:本文中的CHeaderData::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。