+/* Public: A handle for beginning and continuing sending a single ISO-TP
+ * message - both single and multi-frame.
+ *
+ * Since an ISO-TP message may contain multiple frames, we need to keep a handle
+ * around while waiting for flow control messages from the receiver.
+ * This struct encapsulates the local state required.
+ *
+ * completed - True if the message was completely sent, or the send was
+ * otherwise cancelled.
+ * success - True if the message send request was successful. The value if this
+ * field isn't valid if 'completed' isn't true.
+ */
+typedef struct {
+ bool completed;
+ bool success;
+
+ // Private
+ uint16_t sending_arbitration_id;
+ uint16_t receiving_arbitration_id;
+ IsoTpMessageSentHandler message_sent_callback;
+ IsoTpCanFrameSentHandler can_frame_sent_callback;
+ // TODO going to need some state here for multi frame messages
+} IsoTpSendHandle;
+
+/* Public: Initiate sending a single ISO-TP message.
+ *
+ * If the message fits in a single ISO-TP frame (i.e. the payload isn't more
+ * than 7 bytes) it will be sent immediately and the returned IsoTpSendHandle's
+ * 'completed' flag will be true.
+ *
+ * For multi-frame messages, see isotp_continue_send(...).
+ *
+ * shims - Low-level shims required to send CAN messages, etc.
+ * arbitration_id - The arbitration ID to send the message on.
+ * payload - The payload for the message. If no payload, NULL is valid is size
+ * is also 0.
+ * size - The size of the payload, or 0 if no payload.
+ * callback - an optional function to be called when the message is completely
+ * sent (use NULL if no callback required).
+ *
+ * Returns a handle to be used with isotp_continue_send to continue sending
+ * multi-frame messages. The 'completed' field in the returned IsoTpSendHandle
+ * will be true when the message is completely sent.
+ */
+IsoTpSendHandle isotp_send(IsoTpShims* shims, const uint16_t arbitration_id,
+ const uint8_t payload[], uint16_t size,