Lines Matching +full:context +full:- +full:buffer +full:- +full:size
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
30 * BS Block Size
31 * CAN_DL CAN LL data size
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
89 /** No net buffer left to allocate */
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
95 /** No context buffer left to allocate */
96 #define ISOTP_NO_CTX_LEFT -13
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
211 uint8_t bs; /**< Block size. Number of CF PDUs before next CF is sent */
229 * @brief Bind an address to a receiving context.
231 * This function binds an RX and TX address combination to an RX context.
235 * context is initialized. The context must be valid until calling unbind.
237 * @param rctx Context to store the internal states.
242 * @param timeout Timeout for FF SF buffer allocation.
254 * @brief Unbind a context from the interface
259 * The context can be discarded safely after calling this function.
261 * @param rctx Context that should be unbound.
268 * This function reads the data from the receive FIFO of the context.
271 * data buffer unchanged.
273 * @param rctx Context that is already bound.
274 * @param data Pointer to a buffer where the data is copied to.
275 * @param len Size of the buffer.
285 * @brief Get the net buffer on data reception
287 * This function reads incoming data into net-buffers.
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
294 * @param rctx Context that is already bound.
295 * @param buffer Pointer where the net_buf pointer is written to.
302 int isotp_recv_net(struct isotp_recv_ctx *rctx, struct net_buf **buffer, k_timeout_t timeout);
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
313 * @param sctx Context to store the internal states.
333 * @brief Send data with buffered context
335 * This function is similar to isotp_send, but the context is automatically
345 * @param timeout Timeout for buffer allocation.
358 * @brief Send data with buffered context
370 * @param timeout Timeout for buffer allocation.
387 * @brief Send data with buffered context
389 * This function is similar to isotp_send, but the context is automatically
400 * @param timeout Timeout for buffer allocation.
456 /* buffer currently processed in isotp_recv */