MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / _write

Method _write

libraries/AP_HAL_Linux/UARTDriver.cpp:286–298  ·  view source on GitHub ↗

write size bytes to the write buffer */

Source from the content-addressed store, hash-verified

284 write size bytes to the write buffer
285 */
286size_t UARTDriver::_write(const uint8_t *buffer, size_t size)
287{
288 if (!_initialised) {
289 return 0;
290 }
291 if (!_write_mutex.take_nonblocking()) {
292 return 0;
293 }
294
295 size_t ret = _writebuf.write(buffer, size);
296 _write_mutex.give();
297 return ret;
298}
299
300/*
301 try writing n bytes, handling an unresponsive port

Callers

nothing calls this directly

Calls 3

take_nonblockingMethod · 0.45
writeMethod · 0.45
giveMethod · 0.45

Tested by

no test coverage detected