HAL_Linux: improved help output and errors for udp and bcast

This commit is contained in:
Andrew Tridgell 2016-06-28 21:00:44 +10:00
parent 72b5cecdb2
commit beb3591f67
2 changed files with 7 additions and 1 deletions

View File

@ -232,7 +232,9 @@ void _usage(void)
printf("\t -B /dev/ttyS1\n");
printf("\t-tcp: -C tcp:192.168.2.15:1243:wait\n");
printf("\t -A tcp:11.0.0.2:5678\n");
printf("\t -A udp:11.0.0.2:5678\n");
printf("\t -A udp:11.0.0.2:14550\n");
printf("\t -A udp:11.0.0.255:14550:bcast\n");
printf("\t -A udpin:0.0.0.0:14550\n");
printf("\t-custom log path:\n");
printf("\t --log-directory /var/APM/logs\n");
printf("\t -l /var/APM/logs\n");

View File

@ -312,6 +312,10 @@ void UARTDriver::_udp_start_connection(void)
*/
void UARTDriver::_udpin_start_connection(void)
{
bool bcast = (_flag && strcmp(_flag, "bcast") == 0);
if (bcast) {
AP_HAL::panic("Can't combine udpin with bcast");
}
_device = new UDPDevice(_ip, _base_port, false, true);
_connected = _device->open();
_device->set_blocking(false);