mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 07:33:37 +08:00
Fix transmit error reporting.
This commit is contained in:
@@ -186,10 +186,8 @@ hx_stream_send(hx_stream_t stream,
|
|||||||
const uint8_t *p = (const uint8_t *)data;
|
const uint8_t *p = (const uint8_t *)data;
|
||||||
unsigned resid = count;
|
unsigned resid = count;
|
||||||
|
|
||||||
if (resid > HX_STREAM_MAX_FRAME) {
|
if (resid > HX_STREAM_MAX_FRAME)
|
||||||
errno = EINVAL;
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* start the frame */
|
/* start the frame */
|
||||||
hx_tx_raw(stream, FBO);
|
hx_tx_raw(stream, FBO);
|
||||||
@@ -214,10 +212,11 @@ hx_stream_send(hx_stream_t stream,
|
|||||||
/* check for transmit error */
|
/* check for transmit error */
|
||||||
if (stream->txerror) {
|
if (stream->txerror) {
|
||||||
stream->txerror = false;
|
stream->txerror = false;
|
||||||
return -1;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
perf_count(stream->pc_tx_frames);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -102,8 +102,7 @@ __EXPORT extern void hx_stream_set_counters(hx_stream_t stream,
|
|||||||
* @param stream A handle returned from hx_stream_init.
|
* @param stream A handle returned from hx_stream_init.
|
||||||
* @param data Pointer to the data to send.
|
* @param data Pointer to the data to send.
|
||||||
* @param count The number of bytes to send.
|
* @param count The number of bytes to send.
|
||||||
* @return Zero on success, nonzero with errno
|
* @return Zero on success, -errno on error.
|
||||||
* set on error.
|
|
||||||
*/
|
*/
|
||||||
__EXPORT extern int hx_stream_send(hx_stream_t stream,
|
__EXPORT extern int hx_stream_send(hx_stream_t stream,
|
||||||
const void *data,
|
const void *data,
|
||||||
|
|||||||
Reference in New Issue
Block a user