Cherry picked changes/fixes from Shawnchain's OpenWrt changes.

This commit is contained in:
Jonathan Naylor 2018-11-09 11:31:10 +00:00
parent ccd6352e72
commit baeee75cfd
7 changed files with 41 additions and 15 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2014 by Jonathan Naylor G4KLX
* Copyright (C) 2010-2014,2018 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -216,7 +216,7 @@ bool CAPRSWriterThread::connect()
m_socket.close();
return false;
}
wxLogMessage(wxT("Received login banner : ") + serverResponse);
wxLogMessage(wxT("Received login banner : %s"), serverResponse.c_str());
wxString filter(m_filter);
if (filter.Length() > 0) filter.Prepend(wxT(" filter "));
@ -242,7 +242,7 @@ bool CAPRSWriterThread::connect()
return false;
}
wxLogMessage(wxT("Response from APRS server: ") + serverResponse);
wxLogMessage(wxT("Response from APRS server: %s"), serverResponse.c_str());
wxLogMessage(wxT("Connected to the APRS server"));

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011,2012,2013 by Jonathan Naylor G4KLX
* Copyright (C) 2011,2012,2013,2018 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -22,8 +22,7 @@
#include <wx/filename.h>
#if !defined(WIN32)
// XXX Check these
#if defined(__linux__)
#include <net/if.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
@ -103,7 +102,7 @@ void CDDHandler::initialise(unsigned int maxRoutes, const wxString& name)
// Add a dummy entry for "DX-Cluster" multicast
m_list[2] = new CEthernet(DX_MULTICAST_ADDRESS, wxT("CQCQCQ "));
#if !defined(WIN32)
#if defined(__linux__)
m_fd = ::open("/dev/net/tun", O_RDWR);
if (m_fd < 0) {
wxLogError(wxT("Cannot open /dev/net/tun"));
@ -238,7 +237,7 @@ void CDDHandler::process(CDDData& data)
}
}
#if !defined(WIN32)
#if defined(__linux__)
unsigned int length = data.getEthernetFrame(m_buffer, BUFFER_LENGTH);
ssize_t len = ::write(m_fd, (char*)m_buffer, length);
@ -253,7 +252,7 @@ CDDData* CDDHandler::read()
if (m_maxRoutes == 0U)
return NULL;
#if defined(WIN32)
#if !defined(WIN32)
return NULL;
#else
// Check that the read() won't block

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2013,2015 by Jonathan Naylor G4KLX
* Copyright (C) 2010-2013,2015,2018 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -28,6 +28,8 @@
wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL)
{
#ifdef XLX_USE_WGET
wxLogMessage(_T("Downloading XLX reflector list from %s"), xlxHostsFileURL.c_str());
wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_"));
wxString commandLine = _T("wget -q -O ") + xlxHostsFileName + _T(" ") + xlxHostsFileURL;
bool execResult = wxShell(commandLine);