[][src]Function esp_idf_sys::can_transmit

pub unsafe extern "C" fn can_transmit(
    message: *const can_message_t,
    ticks_to_wait: TickType_t
) -> esp_err_t

@brief Transmit a CAN message

This function queues a CAN message for transmission. Transmission will start immediately if no other messages are queued for transmission. If the TX queue is full, this function will block until more space becomes available or until it timesout. If the TX queue is disabled (TX queue length = 0 in configuration), this function will return immediately if another message is undergoing transmission. This function can only be called when the CAN driver is in the running state and cannot be called under Listen Only Mode.

@param[in] message Message to transmit @param[in] ticks_to_wait Number of FreeRTOS ticks to block on the TX queue

@note This function does not guarantee that the transmission is successful. The TX_SUCCESS/TX_FAILED alert can be enabled to alert the application upon the success/failure of a transmission.

@note The TX_IDLE alert can be used to alert the application when no other messages are awaiting transmission.

@return - ESP_OK: Transmission successfully queued/initiated - ESP_ERR_INVALID_ARG: Arguments are invalid - ESP_ERR_TIMEOUT: Timed out waiting for space on TX queue - ESP_FAIL: TX queue is disabled and another message is currently transmitting - ESP_ERR_INVALID_STATE: CAN driver is not in running state, or is not installed - ESP_ERR_NOT_SUPPORTED: Listen Only Mode does not support transmissions