Constrain G2 stuff to specific functions

Code is much more lighter !
This commit is contained in:
Geoffrey Merck F4FXL - KC3FRA 2018-11-18 16:54:57 +01:00
parent 1f76e03cf5
commit cda4300f34
5 changed files with 63 additions and 40 deletions

View file

@ -91,11 +91,6 @@ CRepeaterData* CCacheManager::findRepeater(const wxString& repeater)
}
void CCacheManager::updateUser(const wxString& user, const wxString& repeater, const wxString& gateway, const wxString& address, const wxString& timestamp, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
{
updateUser(user, repeater, gateway, address, G2_DV_PORT, true, timestamp, protocol, addrLock, protoLock);
}
void CCacheManager::updateUser(const wxString& user, const wxString& repeater, const wxString& gateway, const wxString& address, unsigned int g2Port, bool ignoreG2Port, const wxString& timestamp, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
{
wxMutexLocker locker(m_mutex);
@ -108,15 +103,10 @@ void CCacheManager::updateUser(const wxString& user, const wxString& repeater, c
if (!repeater7.IsSameAs(gateway7))
m_repeaterCache.update(repeater, gateway);
updateGateway(gateway, address, g2Port, ignoreG2Port, protocol, addrLock, protoLock);
m_gatewayCache.update(gateway, address, protocol, addrLock, protoLock);
}
void CCacheManager::updateRepeater(const wxString& repeater, const wxString& gateway, const wxString& address, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
{
updateRepeater(repeater, gateway, address, G2_DV_PORT, true, protocol, addrLock, protoLock);
}
void CCacheManager::updateRepeater(const wxString& repeater, const wxString& gateway, const wxString& address, unsigned int g2Port, bool ignoreG2Port, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
{
wxMutexLocker locker(m_mutex);
@ -127,24 +117,17 @@ void CCacheManager::updateRepeater(const wxString& repeater, const wxString& gat
if (!repeater7.IsSameAs(gateway7))
m_repeaterCache.update(repeater, gateway);
updateGateway(gateway, address, g2Port, ignoreG2Port, protocol, addrLock, protoLock);
m_gatewayCache.update(gateway, address, protocol, addrLock, protoLock);
}
void CCacheManager::updateGateway(const wxString& gateway, const wxString& address, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
{
updateGateway(gateway, address, G2_DV_PORT, true, protocol, addrLock, protoLock);
}
void CCacheManager::updateGateway(const wxString& gateway, const wxString& address, unsigned int g2Port, bool ignoreG2Port, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
{
wxMutexLocker locker(m_mutex);
m_gatewayCache.update(gateway, address, g2Port, ignoreG2Port, protocol, addrLock, protoLock);
m_gatewayCache.update(gateway, address, protocol, addrLock, protoLock);
}
void CCacheManager::updateGatewayG2(const wxString& gateway, const wxString& address, unsigned int g2Port)
void CCacheManager::updateGatewayG2(const wxString& gateway, const in_addr& address, unsigned int g2Port)
{
CGatewayRecord* gr = m_gatewayCache.find(gateway);
DSTAR_PROTOCOL protocol = gr != NULL? gr->getProtocol() : DP_UNKNOWN;
updateGateway(gateway, address, g2Port, false, protocol, false, false);
m_gatewayCache.updateG2(gateway, address, g2Port);
}