Lines Matching +full:data +full:- +full:timeout
4 * SPDX-License-Identifier: Apache-2.0
9 * @brief Public API for ISO-TP (ISO 15765-2:2016)
11 * ISO-TP is a transport protocol for CAN (Controller Area Network)
18 * @brief CAN ISO-TP Protocol
19 * @defgroup can_isotp CAN ISO-TP Protocol
31 * CAN_DL CAN LL data size
34 * DLC Data length code
44 * RX_DL CAN RX LL data size
45 * TX_DL CAN TX LL data size
50 * N_Result according to ISO 15765-2:2016
58 #define ISOTP_N_TIMEOUT_A -1
61 #define ISOTP_N_TIMEOUT_BS -2
64 #define ISOTP_N_TIMEOUT_CR -3
67 #define ISOTP_N_WRONG_SN -4
70 #define ISOTP_N_INVALID_FS -5
73 #define ISOTP_N_UNEXP_PDU -6
76 #define ISOTP_N_WFT_OVRN -7
79 #define ISOTP_N_BUFFER_OVERFLW -8
82 #define ISOTP_N_ERROR -9
87 #define ISOTP_NO_FREE_FILTER -10
90 #define ISOTP_NO_NET_BUF_LEFT -11
92 /** Not sufficient space in the buffer left for the data */
93 #define ISOTP_NO_BUF_DATA_LEFT -12
96 #define ISOTP_NO_CTX_LEFT -13
98 /** Timeout for recv */
99 #define ISOTP_RECV_TIMEOUT -14
102 * CAN ID filtering for ISO-TP fixed addressing according to SAE J1939
104 * Format of 29-bit CAN identifier:
105 * ------------------------------------------------------
107 * ------------------------------------------------------
109 * ------------------------------------------------------
138 * @name ISO-TP message ID flags
144 /** Message uses ISO-TP extended addressing (first payload byte of CAN frame) */
148 * Message uses ISO-TP fixed addressing (according to SAE J1939). Only valid in combination with
153 /** Message uses extended (29-bit) CAN ID */
165 * @brief ISO-TP message id struct
173 * If ISO-TP fixed addressing is used, isotp_bind ignores SA and
180 /** ISO-TP extended address (if used) */
183 * ISO-TP frame data length (TX_DL for TX address or RX_DL for RX address).
199 * 0-127: 0ms-127ms
200 * 128-240: Reserved
201 * 241-249: 100us-900us (multiples of 100us)
202 * 250- : Reserved
206 * @brief ISO-TP frame control options struct
232 * When data arrives from the specified address, it is buffered and can be read
239 * @param rx_addr Identifier for incoming data.
242 * @param timeout Timeout for FF SF buffer allocation.
251 k_timeout_t timeout);
266 * @brief Read out received data from fifo.
268 * This function reads the data from the receive FIFO of the context.
271 * data buffer unchanged.
274 * @param data Pointer to a buffer where the data is copied to.
276 * @param timeout Timeout for incoming data.
279 * @retval ISOTP_RECV_TIMEOUT when "timeout" timed out
282 int isotp_recv(struct isotp_recv_ctx *rctx, uint8_t *data, size_t len, k_timeout_t timeout);
285 * @brief Get the net buffer on data reception
287 * This function reads incoming data into net-buffers.
289 * occurred. If BS was zero, the data is in a single net_buf. Otherwise,
290 * the data is fragmented in chunks of BS size.
291 * The net-buffers are referenced and must be freed with net_buf_unref after the
292 * data is processed.
296 * @param timeout Timeout for incoming data.
298 * @retval Remaining data length for this transfer if BS > 0, 0 for BS = 0
299 * @retval ISOTP_RECV_TIMEOUT when "timeout" timed out
302 int isotp_recv_net(struct isotp_recv_ctx *rctx, struct net_buf **buffer, k_timeout_t timeout);
305 * @brief Send data
307 * This function is used to send data to a peer that listens to the tx_addr.
308 * An internal work-queue is used to transfer the segmented data.
309 * Data and context must be valid until the transmission has finished.
310 * If a complete_cb is given, this function is non-blocking, and the callback
315 * @param data Data to be sent.
316 * @param len Length of the data to be sent.
326 const uint8_t *data, size_t len,
333 * @brief Send data with buffered context
339 * @param data Data to be sent.
340 * @param len Length of the data to be sent.
345 * @param timeout Timeout for buffer allocation.
351 const uint8_t *data, size_t len,
355 k_timeout_t timeout);
358 * @brief Send data with buffered context
360 * This function is similar to isotp_send_ctx_buf, but the data is carried in
364 * @param data Data to be sent.
365 * @param len Length of the data to be sent.
370 * @param timeout Timeout for buffer allocation.
376 struct net_buf *data,
380 k_timeout_t timeout);
387 * @brief Send data with buffered context
390 * allocated from an internal pool and the data to be send is buffered in an
394 * @param data Data to be sent.
395 * @param len Length of the data to be sent.
400 * @param timeout Timeout for buffer allocation.
406 const uint8_t *data, size_t len,
410 k_timeout_t timeout);
427 const uint8_t *data; member