try writing n bytes, handling an unresponsive port */
| 301 | try writing n bytes, handling an unresponsive port |
| 302 | */ |
| 303 | int UARTDriver::_write_fd(const uint8_t *buf, uint16_t n) |
| 304 | { |
| 305 | /* |
| 306 | allow for delayed connection. This allows ArduPilot to start |
| 307 | before a network interface is available. |
| 308 | */ |
| 309 | if (!_connected) { |
| 310 | _connected = _device->open(); |
| 311 | } |
| 312 | if (!_connected) { |
| 313 | return 0; |
| 314 | } |
| 315 | |
| 316 | return _device->write(buf, n); |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | try reading n bytes, handling an unresponsive port |