Currently there is six variations of (IPv4) UDPSocket.cpp.
- FMClients, NXDNClients, P25Clients, YSFClients(YSFParrot)
use ::fprintf() for logging
- YSFClients(YSFReflector)
use LogError() and LogInfo() for logging
special open(string &bindaddr) function
- YSFClients(YSFGateway), DAPNETGateway
use LogError() and LogInfo() for logging
- P25Clients, DMRGateway
use LogError() for logging
no LogInfo("Opening UDP port on") message
- NXDNClients
use LogError() for logging
no LogInfo("Opening UDP port on") message
add #include <ifaddrs.h>
- MMDVMHost
use LogError() for logging
no LogInfo("Opening UDP port on") message
no assert(!address.empty()) at constructor
to avoid explosion, commonized them.
switch ::fprintf()/LogError by #define HAVE_LOG_H
always display LogInfo("Opening UDP port on") message
delete #include <ifaddrs.h>, this is not needed
no assert(!address.empty()) at constructor
and to support YSFReflector, add multiple socket support.
default is #define UDP_SOCKET_MAX 1 so normally this feature is disabled.
added these functions.
CUDPSocket() (constructor without any parameters)
open(index, af, addr, port)
close(index)
CUDPSocket() means CUDPSocket(address = "", port = 0)
index selects socket, address and port is defined at open.
to have compatibility for old codes, these function works as
CUDPSocket(addr, port) store addr and port to index #0
CUDPSocket(port) store addr = "" and port to index #0
open() open with addr and port of index #0, AF_UNSPEC
open(af) open with addr and port of index #0, specified af
close() close *all* sockets
read/write operation is for all opened sockets.
============================
Display.cpp: In static member function 'static CDisplay* CDisplay::createDisplay(const CConf&, CUMP*, CModem*)':
Display.cpp:645:128: error: invalid new-expression of abstract class type 'COLED'
645 | display = new COLED(type, brightness, invert, scroll, rotate, logosaver, conf.getDMRNetworkSlot1(), conf.getDMRNetworkSlot2());
| ^
In file included from Display.cpp:39:
OLED.h:40:7: note: because the following virtual functions are pure within 'COLED':
40 | class COLED : public CDisplay
| ^~~~~
In file included from Display.cpp:19:
Display.h:105:15: note: 'virtual void CDisplay::writeFusionInt(const char*, const char*, unsigned char, const char*, const char*)'
105 | virtual void writeFusionInt(const char* source, const char* dest, unsigned char dgid, const char* type, const char* origin) = 0;
============================
Please remove reset to zero or setting of DG-ID because is not necessary.
There are many reflectors that use DG-ID to change communication between TGs or rooms.
To implement this feature, using strtok() is not enough.
This cannot handle this case:
Key=#value#comment
it will be #value is the contents of Key. And,
Key=value #comment
(there is a space and a tab between value and #comment)
this will be value<space><tab>. Sometimes these trailing spaces and
tabs makes thing wrong.
Whether in-line comment is used or not, delete trailing space/tab after
value.
simply merged upstream code.
following files are conflicted, all fixed
GPSD.h, MobileGPS.cpp, NXDNNetwork.cpp, NXDNNetwork.h, UDPSocket.h
NXDNIcomNetwork and NXDNKenwoodNetwork is still original code,
not support IPv6-UDPSocket yet.
two minor improvements
- ScreenLayout in Nextion section can use hexadecimal (0xXXXXX),
octal (0XXXX) and decimal value
- in-line comment enabled
example:
# conventional comment, the line starts with #
[Section]
Key=value # this is new style comment
Key="quoted value # this is not comment"
Key="quoted value" # this is prohibited (not comment)
Previous implementation uses SSRC as IPv4 address that is same behaviour
of Kenwood's NXDN repeater.
RFC 3350 RTP protocol recommends SSRC uses random number.
So I use MT19937 random number generator instead of IP address.
And if this is no problem, I will do two changes.
- replace rand() in DMRNetwork.cpp and DStarNetwork.cpp to MT19937
- remove getLocalAddress() in UDPSocket.cpp
to add new feature easily, the definition of ScreenLayout in [Nextion]
has changed like this.
ScreenLayout < 8: compatibile setting for old config file
0: G4KLX @ 9600bps
1: (reserved)
2: ON7LDS @ 9600bps
3: ON7LDS-DIY @ 9600bps
4: ON7LDS-DIY @ 115200bps
ScreenLayout >= 8: new world, set the bit to enable each feature
bit3 (8) use 115200bps
bit4 (16) Display DMR Talker Alias
bit5 (32) Colour change when displaying TA
bit6 (64) Font size change when displaying long TA text
bit7 (128) Display DIY status when MMDVM IDLE
old settings are same as:
0 -> 0
2 -> 112 (16+32+64)
3 -> 144 (16+128)
4 -> 152 (8+16+128)