Commit graph

2196 commits

Author SHA1 Message Date
SASANO Takayoshi
f2543de3da fix CUDPSocket(port) constructor bug
constructor CUDPSocket(port) cannot create properly, fixed
2020-09-06 16:32:33 +09:00
SASANO Takayoshi
9856025923 rewrite for UDPSocket renewal 2020-09-06 15:52:46 +09:00
SASANO Takayoshi
def0edbaca UDPSocket renewal (2)
introduced YSFClients code

	match_addr(addr1, addr2) -> match(addr1, addr2, IMT_ADDRESS_ONLY)
	isnone() -> isNone()
	open(sockaddr_storage&) added (this refers address family only)
2020-09-06 15:48:22 +09:00
SASANO Takayoshi
457be810a3 UDPSocket renewal
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.
2020-09-06 12:09:37 +09:00
Jonathan Naylor
34db212360
Merge pull request #617 from jg1uaa/ipv6
IPv6: catch up current source
2020-07-14 14:15:16 +01:00
SASANO Takayoshi
c40291dcc2 Merge remote-tracking branch 'upstream/master' into ipv6 2020-07-04 18:48:13 +09:00
Jonathan Naylor
16fac0b41c
Merge pull request #616 from jg1uaa/master
permit inline comment (2)
2020-07-04 10:45:25 +01:00
SASANO Takayoshi
1ded19c5b2 permit inline comment (2)
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.
2020-07-04 17:58:00 +09:00
SASANO Takayoshi
9137399ea9 NXDNKenwoodNetwork: IPv6 support 2020-07-03 06:56:36 +09:00
SASANO Takayoshi
8a0db8cb8b NXDNIcomNetwork: IPv6 support 2020-07-03 04:40:41 +09:00
SASANO Takayoshi
6de0bdb536 add match_addr()
match() compares IP address and port
match_addr() compares IP address only
2020-07-03 04:35:22 +09:00
SASANO Takayoshi
74adbd4895 Merge remote-tracking branch 'upstream/master' into ipv6
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.
2020-07-03 04:17:14 +09:00
Jonathan Naylor
5dcdfd8159
Merge pull request #615 from jg1uaa/master
permit inline comment and hex-value to ScreenLayout of Nextion
2020-07-02 13:20:20 +01:00
SASANO Takayoshi
15a8e87c3e permit inline comment and ScreenLayout of Nextion
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)
2020-07-02 18:47:33 +09:00
SASANO Takayoshi
c8e31ce657 Merge remote-tracking branch 'upstream/master' 2020-07-02 18:23:10 +09:00
SASANO Takayoshi
4217ccebc4 remove getLocalAddress()
It was used for NXDNKenwoodNetwork.cpp to creates SSRC.
currently SSRC uses random value, this function is no longer used.
2020-07-02 06:59:51 +09:00
Jonathan Naylor
ee2e997cfd
Merge pull request #613 from jg1uaa/master
replace rand() -> MT19937 random number generator
2020-07-01 22:55:27 +01:00
SASANO Takayoshi
dfaedb450b replace rand() -> MT19937 random number generator
sometimes rand() makes problem so replace it to MT19937 in C++11 <random>.
2020-07-02 06:40:26 +09:00
Jonathan Naylor
4dd39696b4 Remove unused UDPSocket code. 2020-07-01 13:38:23 +01:00
Jonathan Naylor
8edfc62049
Merge pull request #612 from jg1uaa/master
m_ssrc use random value
2020-07-01 13:16:52 +01:00
SASANO Takayoshi
0892aaaaae eliminate SSRC range 0x00000001 - 0xfffffffe 2020-07-01 20:39:22 +09:00
SASANO Takayoshi
79b3eaa57a replace SSRC source from IPv4 address to random number
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
2020-07-01 19:48:07 +09:00
SASANO Takayoshi
974251485d Merge remote-tracking branch 'upstream/master' 2020-06-30 19:41:27 +09:00
SASANO Takayoshi
236d467c1a change ScreenLayout definition for Nextion
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)
2020-06-30 19:40:34 +09:00
Jonathan Naylor
df47466aa2 Use USE_GPSD instead of USE_GPS. 2020-06-30 11:38:25 +01:00
Jonathan Naylor
be8c29da3e Fix Windows compilation. 2020-06-29 11:50:33 +01:00
Jonathan Naylor
edce667018 Replace MobileGPS with gpsd. 2020-06-29 11:25:10 +01:00
Jonathan Naylor
1dc91b9a64 Add the install target to the other makefiles. 2020-06-25 09:55:28 +01:00
Jonathan Naylor
c174c10caf
Merge pull request #604 from jcyfkimi/master
Add install rule into Makefile
2020-06-25 09:35:24 +01:00
Kimi Jin
325b30d30b Add install rules into Makefile. This will insatll MMDVMHost and RemoteCommand to /usr/local/bin/ path, so need exec with command 'sudo make install'. 2020-06-24 13:33:23 +08:00
jcyfkimi
e8c21493c1
Merge pull request #1 from g4klx/master
Update to newest version
2020-06-24 13:28:59 +08:00
Jonathan Naylor
50888777e6
Merge pull request #602 from AndyTaylorTweet/master
Update OLED.cpp
2020-06-15 18:13:23 +01:00
Andy Taylor
3313fe8ec3
Update OLED.cpp
Modify the OLED code to only allow scroll commands when scrolling is enabled
2020-06-15 17:00:37 +01:00
Jonathan Naylor
7c95e231e2
Merge pull request #601 from jg1uaa/master
change ScreenLayout definition for Nextion
2020-06-14 08:30:26 +01:00
SASANO Takayoshi
36a852b38b change ScreenLayout definition for Nextion
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)
2020-06-14 16:00:20 +09:00
Jonathan Naylor
1ab09e21fe Merge branch 'master' into Kenwood 2020-06-13 17:48:03 +01:00
Jonathan Naylor
19c8c6515c
Merge pull request #565 from jg1uaa/ipv6
add IPv6 support
2020-06-12 12:53:36 +01:00
SASANO Takayoshi
816f8ea0a1 Merge remote-tracking branch 'origin' into ipv6 2020-06-12 20:24:17 +09:00
Jonathan Naylor
933b9ef014 Fix crash with POCSAG and no network. 2020-06-08 14:34:29 +01:00
Jonathan Naylor
4c7a2526e5 Merge branch 'master' into Kenwood 2020-05-28 11:50:44 +01:00
Jonathan Naylor
7bfe2f2b2f Fix Linux compile. 2020-05-27 12:52:15 +01:00
Jonathan Naylor
0b7efee2a7 Upgrade the Kenwood protocol to pass data calls. 2020-05-27 12:47:21 +01:00
Jonathan Naylor
924baeacd1 More work on integrating the Kenwood NXDN protocol. 2020-05-27 12:07:21 +01:00
Jonathan Naylor
45eafe3672 Start adding the Kenwood protocol as an option. 2020-05-27 11:38:46 +01:00
Jonathan Naylor
e7ffcb5090
Merge pull request #594 from m0vse/FM
Update RemoteCommand to disable/enable network modes
2020-05-25 20:39:15 +01:00
m0vse
26243c0247 Update RemoteCommand to disable/enable network modes 2020-05-25 20:29:49 +01:00
Jonathan Naylor
0dbfe896bb Update README. 2020-05-21 11:17:02 +01:00
Jonathan Naylor
4eb534aab6 Remove extraneous logging message. 2020-05-18 11:20:44 +01:00
Jonathan Naylor
eb4dcc22a7
Merge pull request #592 from shawnchain/update_null_modem
Update NullModem code to sync with FM changes
2020-05-18 06:34:24 +01:00
Shawn Chain
953530c23b Update NullModem code to sycn with FM changes 2020-05-18 13:28:55 +08:00