ardupilot/libraries/AP_HAL
Leandro Pereira e3b676ba89 AP_HAL: Add method to peek non-contiguous parts of a ByteBuffer
Modify ByteBuffer class to have a `peekiovec()` method, that takes in a
`struct IoVec` array (similar to `struct iovec` from POSIX), and a
number of bytes, and returns the number of elements from this array
that have been filled out.  It is either 0 (buffer is empty), 1
(there's enough contiguous bytes to read that amount) or 2 (ring buffer
is wrapping around).

This enables using scatter-gather I/O (i.e. writev()), removing calls
to memcpy().  That's one call when no wrap-around is happening, and
two calls if it is.

Also, rewrite `ByteBuffer::peekbytes()` to use `peekiovec()`, so that
some of the checks performed by the former are not replicated in the
latter.
2016-07-08 13:10:16 -03:00
..
examples AP_HAL: fix signed and unsigned comparison warning 2016-05-04 08:58:37 -03:00
utility AP_HAL: Add method to peek non-contiguous parts of a ByteBuffer 2016-07-08 13:10:16 -03:00
AP_HAL.h AP_HAL: Add support for an Optflow driver 2015-12-18 17:56:03 +11:00
AP_HAL_Boards.h AP_HAL: added hal.util->set_imu_target_temp() API 2016-07-01 15:29:52 +10:00
AP_HAL_Macros.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
AP_HAL_Main.h AP_HAL: remove support for main without argc 2016-05-23 21:49:45 -03:00
AP_HAL_Namespace.h AP_HAL: Remove trailing spaces from AP_HAL_Namespace.h 2016-06-22 16:03:30 -03:00
AnalogIn.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
Device.h Global: rename bus type enum entries 2016-06-27 17:51:41 -03:00
GPIO.h AP_HAL: GPIO: remove unused functions 2016-06-21 12:16:32 -03:00
HAL.cpp AP_HAL: add run() method 2015-10-21 09:16:07 +11:00
HAL.h AP_HAL: added uartF 2016-04-20 09:39:48 +10:00
I2CDevice.h Global: rename bus type enum entries 2016-06-27 17:51:41 -03:00
I2CDriver.h AP_HAL: Fix typos 2016-05-13 19:20:06 -03:00
OpticalFlow.h AP_HAL: follow coding style 2015-12-18 17:56:03 +11:00
RCInput.h AP_HAL: fixed typo 2016-07-01 15:35:07 +10:00
RCOutput.h AP_HAL: defer calls to safety_state switch to queue an async attempt. 2016-05-27 21:34:40 +10:00
SPIDevice.h Global: rename bus type enum entries 2016-06-27 17:51:41 -03:00
SPIDriver.h AP_HAL: add interface for SPIDevice devices 2016-02-16 19:49:09 -02:00
Scheduler.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
Semaphores.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
Storage.h AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
UARTDriver.cpp AP_HAL: remove unused in_progmem flag to print_vprintf 2015-12-27 15:58:12 -02:00
UARTDriver.h AP_HAL: fixed typo 2016-07-01 15:35:07 +10:00
Util.cpp AP_HAL: add support for get realtime on Darwin systems 2016-07-07 11:35:17 -03:00
Util.h AP_HAL: fixed typo 2016-07-01 15:35:07 +10:00
system.h Global: Rename printf format attribute 2015-12-01 07:22:12 +11:00