Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
Header for commands to interact with the simulator outside of normal device interface. More...
#include <zephyr/mgmt/ec_host_cmd/backend.h>
Go to the source code of this file.
Functions | |
void | ec_host_cmd_backend_sim_install_send_cb (ec_host_cmd_backend_api_send cb, struct ec_host_cmd_tx_buf **tx_buf) |
Install callback for when this device would sends data to host. | |
int | ec_host_cmd_backend_sim_data_received (const uint8_t *buffer, size_t len) |
Simulate receiving data from host as passed in to this function. | |
Header for commands to interact with the simulator outside of normal device interface.
Simulate receiving data from host as passed in to this function.
Calling this function simulates that data was sent from the host to the DUT.
buffer | The buffer that contains the data to receive. |
len | The number of bytes that are received from the above buffer. |
0 | if successful |
-ENOMEM | if len is greater than the RX buffer size. |
-EBUSY | if the host command framework is busy with another request. |
void ec_host_cmd_backend_sim_install_send_cb | ( | ec_host_cmd_backend_api_send | cb, |
struct ec_host_cmd_tx_buf ** | tx_buf | ||
) |
Install callback for when this device would sends data to host.
When this host command simulator device should send data to the host, it will call the callback parameter provided by this function. Note that only one callback may be installed at a time. Calling this a second time will override the first callback installation.
cb | Callback that is called when device would send data to host. |
tx_buf | Pointer of a pointer to the tx buf structure where data will be sent. |