Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

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.

Detailed Description

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.

Function Documentation

◆ fake_lora_airtime()

uint32_t fake_lora_airtime ( const struct device * ,
uint32_t  )

#include <zephyr/drivers/lora/lora_fake.h>

Fake implementation of the lora_driver_api::airtime driver operation.

◆ fake_lora_cad()

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.

◆ fake_lora_cad_async()

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.

◆ fake_lora_config()

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.

◆ fake_lora_recv()

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.

◆ fake_lora_recv_async()

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.

◆ fake_lora_recv_duty_cycle()

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.

◆ fake_lora_recv_duty_cycle_async()

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.

◆ fake_lora_rssi()

int fake_lora_rssi ( const struct device * ,
int16_t *  )

#include <zephyr/drivers/lora/lora_fake.h>

Fake implementation of the lora_driver_api::rssi driver operation.

◆ fake_lora_send()

int fake_lora_send ( const struct device * ,
uint8_t * ,
uint32_t  )

#include <zephyr/drivers/lora/lora_fake.h>

Fake implementation of the lora_driver_api::send driver operation.

◆ fake_lora_send_async()

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.

◆ fake_lora_test_cw()

int fake_lora_test_cw ( const struct device * ,
uint32_t ,
int8_t ,
uint16_t  )

#include <zephyr/drivers/lora/lora_fake.h>

Fake implementation of the lora_driver_api::test_cw driver operation.