|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Fake LoRa driver. More...
Files | |
| file | lora_fake.h |
| Fake LoRa driver API functions. | |
Functions | |
| int | fake_lora_config (const struct device *, const struct lora_modem_config *) |
| Fake implementation of the lora_driver_api::config driver operation. | |
| uint32_t | fake_lora_airtime (const struct device *, uint32_t) |
| Fake implementation of the lora_driver_api::airtime driver operation. | |
| int | fake_lora_send (const struct device *, uint8_t *, uint32_t) |
| Fake implementation of the lora_driver_api::send driver operation. | |
| int | fake_lora_send_async (const struct device *, uint8_t *, uint32_t, struct k_poll_signal *) |
| Fake implementation of the lora_driver_api::send_async driver operation. | |
| int | fake_lora_recv (const struct device *, uint8_t *, uint8_t, k_timeout_t, int16_t *, int8_t *) |
| Fake implementation of the lora_driver_api::recv driver operation. | |
| int | fake_lora_recv_async (const struct device *, lora_recv_cb, void *) |
| Fake implementation of the lora_driver_api::recv_async driver operation. | |
| int | fake_lora_cad (const struct device *, k_timeout_t) |
| Fake implementation of the lora_driver_api::cad driver operation. | |
| int | fake_lora_cad_async (const struct device *, lora_cad_cb, void *) |
| Fake implementation of the lora_driver_api::cad_async driver operation. | |
| int | fake_lora_rssi (const struct device *, int16_t *) |
| Fake implementation of the lora_driver_api::rssi driver operation. | |
| int | fake_lora_recv_duty_cycle (const struct device *, k_timeout_t, k_timeout_t, uint8_t *, uint8_t, k_timeout_t, int16_t *, int8_t *) |
| Fake implementation of the lora_driver_api::recv_duty_cycle driver operation. | |
| int | fake_lora_recv_duty_cycle_async (const struct device *, k_timeout_t, k_timeout_t, lora_recv_cb, void *) |
| Fake implementation of the lora_driver_api::recv_duty_cycle_async driver operation. | |
| int | fake_lora_test_cw (const struct device *, uint32_t, int8_t, uint16_t) |
| Fake implementation of the lora_driver_api::test_cw driver operation. | |
Fake LoRa driver.
This is a Fake Function Framework (FFF) implementation of the LoRa API, provided for use in tests. It is enabled by CONFIG_LORA_FAKE and instantiated from zephyr,fake-lora devicetree nodes.
Each fake below is paired with an FFF control structure named after it with an additional _fake suffix, which tests use to set return values, install custom fakes, or inspect call counts and captured arguments. The control structures are not listed here; see Mocking via FFF.
Use return_val for fakes that only report status; a fake with output parameters must be driven with a custom_fake, as return_val leaves those parameters untouched.
When CONFIG_ZTEST is enabled, a ztest rule resets every fake before each test case.
fake_lora_recv() is given a default custom_fake that initializes its output parameters with zero values, re-installed on every reset. When CONFIG_LORA_FAKE_OPTIONAL_API is enabled, fake_lora_rssi() and fake_lora_recv_duty_cycle() receive equivalent delegates. Install your own custom_fake in the test case to change what they report.
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::airtime driver operation.
| int fake_lora_cad | ( | const struct device * | , |
| k_timeout_t | ) |
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::cad driver operation.
| int fake_lora_cad_async | ( | const struct device * | , |
| lora_cad_cb | , | ||
| void * | ) |
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::cad_async driver operation.
| int fake_lora_config | ( | const struct device * | , |
| const struct lora_modem_config * | ) |
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::config driver operation.
| int fake_lora_recv | ( | const struct device * | , |
| uint8_t * | , | ||
| uint8_t | , | ||
| k_timeout_t | , | ||
| int16_t * | , | ||
| int8_t * | ) |
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::recv driver operation.
| int fake_lora_recv_async | ( | const struct device * | , |
| lora_recv_cb | , | ||
| void * | ) |
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::recv_async driver operation.
| int fake_lora_recv_duty_cycle | ( | const struct device * | , |
| k_timeout_t | , | ||
| k_timeout_t | , | ||
| uint8_t * | , | ||
| uint8_t | , | ||
| k_timeout_t | , | ||
| int16_t * | , | ||
| int8_t * | ) |
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::recv_duty_cycle driver operation.
| int fake_lora_recv_duty_cycle_async | ( | const struct device * | , |
| k_timeout_t | , | ||
| k_timeout_t | , | ||
| lora_recv_cb | , | ||
| void * | ) |
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::recv_duty_cycle_async driver operation.
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::rssi driver operation.
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::send driver operation.
| int fake_lora_send_async | ( | const struct device * | , |
| uint8_t * | , | ||
| uint32_t | , | ||
| struct k_poll_signal * | ) |
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::send_async driver operation.
#include <zephyr/drivers/lora/lora_fake.h>
Fake implementation of the lora_driver_api::test_cw driver operation.