Commit Graph

81 Commits

Author SHA1 Message Date
Andrew Tridgell cfa28c5246 HAL_SITL: fixed unbuffered UART writes in SITL
this was causing PPP to slow down by about 1000x due to duplicate
writes
2024-01-02 08:12:37 +11:00
Andrew Tridgell 74c2855be3 HAL_SITL: implement begin(0) on UARTs
the begin(0) is used to claim a uart for the current thread in
ChibiOS, we need to ignore it on SITL and not change baudrate
2023-12-26 06:21:42 +11:00
Thomas Watson 9044632315 AP_HAL_SITL: eliminate internal legacy UART ordering/references
Legacy command line arguments are kept to avoid breaking users.

The vestigial `_tcp_client_addr` variable is removed.

Serial port status messages are updated to a slightly different format
to clarify the numbering scheme being used and prompt any external
consumers to update.
2023-12-19 06:53:15 +11:00
Willian Galvani b3f2945dcb AP_HAL_SITL: set bw_in_bytes_per_second to 10/100Mbps connection 2023-10-31 11:00:28 +11:00
Andrew Tridgell a42a2fec2a HAL_SITL: implement multicast comms for SITL AP_Periph 2023-08-24 13:06:40 +10:00
Peter Barker 7b83ccfdd1 AP_HAL_SITL: change SITL unbuffered writes to more-closely minim ChibiOS HAL
We don't ever actually do unbuffered writes in ChibiOS.  We just poke the relevant thread to say there's data available.  This kind of mimics that my instantly evoking the same routine the timer-tick method does, which may or may not get all of the bytes out in good order.
2023-07-26 17:06:27 +10:00
Peter Barker 2cb3265131 AP_HAL_SITL: factor _timer_tick into read/write methods 2023-07-26 17:06:27 +10:00
Peter Barker 32659fd3b6 AP_HAL_SITL: correct return values on UARTDriver write call 2023-07-18 11:17:01 +10:00
Peter Barker efc7b4b6ee AP_HAL_SITL: remove race in SITL::UARTDriver::_write
txspace could change if another thread is involved
2023-07-13 18:13:42 +10:00
Andy Piper d36149e1a8 AP_HAL_SITL: remove unused counter 2023-07-13 11:02:40 +10:00
Andrew Tridgell 4f81a40066 AP_HAL_SITL: moved UART port locking up to AP_HAL 2023-07-12 17:06:02 +10:00
Andrew Tridgell 3bcceb9420 HAL_SITL: fixed multicast UDP on cygwin
this will allow the SITL button on cygwin to work with multicast,
allowing for complex vehicle interactions between machines
2023-06-26 15:49:02 +10:00
Peter Barker d626197c0b AP_HAL_SITL: add and use a "bool read(c)" method to AP_HAL
this is much less likely to not work vs the int16_t equivalent
2023-03-22 17:59:11 +11:00
Andrew Tridgell b43701fffa HAL_SITL: exit on close of port 0 on cygwin
this fixes a long standing problem with SITL not exiting when you
close connection in MissionPlanner
2023-01-24 15:48:04 +11:00
Peter Barker 6c03134169 AP_HAL_SITL: use AP_CSVReader to read from Log serial-async dump 2023-01-17 11:21:48 +11:00
Andrew Tridgell a2b0bbffdb HAL_SITL: implement SIM_UART_LOSS 2023-01-15 21:57:15 +11:00
Peter Barker c728483a7e AP_HAL_SITL: add option to create uart connection to file 2023-01-04 12:29:49 +11:00
Andy Piper 5ea3415a41 AP_HAL_SITL: allow SITL sketches to run
allow sketchname to be set
2022-12-28 18:14:56 +11:00
Peter Barker e7d30aefec AP_HAL_SITL: include required AP_Vehicle_Type header 2022-11-02 18:35:48 +11:00
Peter Barker 0d5d9c04f0 AP_HAL_SITL: SITL SerialDevice optionally checks baudrates match 2022-09-28 20:53:34 +10:00
Peter Barker cdccc67fb8 AP_HAL_SITL: make SITL::ADSB a SITL::SerialDevice 2021-11-23 11:09:29 +11:00
Peter Barker 9ebd0cdeed AP_HAL_SITL: use SITL::SerialDevice in place of pipe for communication 2021-11-06 16:54:07 +11:00
Peter Barker 1ab8a3e3aa AP_HAL_SITL: make simulated GPS work as a SerialDevice 2021-10-21 12:09:21 +11:00
Peter Barker 9c24916115 AP_HAL_SITL: move from HAL_NO_GCS to HAL_GCS_ENABLED 2021-09-22 21:37:00 +10:00
bugobliterator 26e2a4a3cb AP_HAL_SITL: change class name from SITL::SITL to SITL::SIM 2021-08-05 07:25:31 +10:00
Peter Barker a52e823967 AP_HAL_SITL: implement read(buf, length) 2021-07-12 12:11:30 +10:00
Peter Barker 5ebe505f2c AP_HAL_SITL: ensure reboot command ACK is written out in SITL 2021-04-06 10:21:59 +10:00
bugobliterator 49d934eb42 AP_HAL_SITL: add support for multiple periph instances 2021-03-12 16:32:36 +09:00
Andrew Tridgell 2e18334165 HAL_SITL: fixed baudrate 0 set in SITL
this fixes MSP sensors in SITL with real uarts
2020-12-15 11:36:16 +11:00
Andrew Tridgell d380447cd5 HAL_SITL: support command line args for replay 2020-11-10 16:15:45 +11:00
bugobliterator 09a0d8d0c0 HAL_SITL: add support for AP_Periph SITL build 2020-11-04 19:59:40 +11:00
Peter Barker be2d03b02a AP_HAL_SITL: periodically warn about failure to open real UART device 2020-08-21 21:25:59 +10:00
Peter Barker 65834234af AP_HAL_SITL: correct use of uninitialised value in tcp UARTDriver
In the case we already have a _listen_fd, sockaddr wasn't being
initialised before being printed to stdout.
2020-08-11 10:07:52 +10:00
Peter Barker f842c27070 AP_HAL_SITL: correct clearing of UART drivers 2020-06-03 17:00:44 +10:00
Peter Barker 80615c44ff AP_HAL_SITL: add discard_input method on UARTDriver 2020-05-26 09:20:32 +10:00
Peter Barker 7028eb8d24 AP_HAL_SITL: provide method to get amount of data still pending in outbound system queues 2020-04-07 14:51:32 +10:00
Andrew Tridgell dd1426cf73 HAL_SITL: allow for separate position for 2nd GPS
makes for better simulation of moving baseline
2020-01-26 16:55:17 +11:00
Peter Barker 3074855ea3 AP_HAL_SITL: correct port numbers in diagnostic output 2020-01-09 09:43:56 +11:00
Peter Barker 0c8e6f212d AP_HAL_SITL: add simulated frsky support 2020-01-08 23:53:48 +11:00
Peter Barker 9da0e480f2 AP_HAL_SITL: add support for bi-directional simulated serial devices 2019-11-08 20:12:28 +11:00
Michael du Breuil a8a71db258 AP_HAL_SITL: Correct range check on UART ports
Coverity CID 308362
2019-04-09 13:01:33 +10:00
Peter Barker fa082df040 AP_HAL_SITL: add missing CLOEXECs on tcp ports 2019-03-13 18:02:48 +11:00
Andrew Tridgell d176776357 HAL_SITL: support limiting baudrate of simulated telemetry 2019-01-27 08:56:12 +11:00
Andrew Tridgell 73672c90d1 HAL_SITL: added support for multicast UDP connections
this allows several copies of SITL to see each other on the same
network, emulating a mesh network, which is useful for swarm testing
2018-12-06 11:12:40 +11:00
Andrew Tridgell 50018d7a7c HAL_SITL: use mavlink_packetise() 2018-12-06 11:12:40 +11:00
Andrew Tridgell 9f8f36aad8 HAL_SITL: added udpclient support
this allows direct UDP output from SITL
2018-12-06 11:12:40 +11:00
Peter Barker be19ae41d4 AP_HAL_SITL: increase debug for SIM connections 2018-06-30 10:11:10 +10:00
Peter Barker e577a5564f AP_HAL_SITL: correct segfault when uartg configured 2018-06-29 18:47:30 +10:00
Michael du Breuil 8680f1ab52 AP_HAL_SITL: Clear UART buffers when opening a port 2018-06-26 02:18:18 +01:00
Peter Barker 574a2b3652 AP_HAL_SITL: set cloexec on port 5760 2018-06-19 09:14:28 +10:00