Zephyr API 3.6.99
Loading...
Searching...
No Matches
bt_mesh_model_pub Struct Reference

Model publication context. More...

#include <access.h>

Data Fields

const struct bt_mesh_modelmod
 The model the context belongs to.
 
uint16_t addr
 Publish Address.
 
const uint8_tuuid
 Label UUID if Publish Address is Virtual Address.
 
uint16_t key:12
 Publish AppKey Index.
 
uint16_t cred:1
 Friendship Credentials Flag.
 
uint16_t send_rel:1
 Force reliable sending (segment acks)
 
uint16_t fast_period:1
 Use FastPeriodDivisor.
 
uint16_t retr_update:1
 Call update callback on every retransmission.
 
uint8_t ttl
 Publish Time to Live.
 
uint8_t retransmit
 Retransmit Count & Interval Steps.
 
uint8_t period
 Publish Period.
 
uint8_t period_div:4
 Divisor for the Period.
 
uint8_t count:4
 Transmissions left.
 
uint8_t delayable:1
 Use random delay for publishing.
 
uint32_t period_start
 Start of the current period.
 
struct net_buf_simplemsg
 Publication buffer, containing the publication message.
 
int(* update )(const struct bt_mesh_model *mod)
 Callback for updating the publication buffer.
 
struct k_work_delayable timer
 Publish Period Timer.
 

Detailed Description

Model publication context.

The context should primarily be created using the BT_MESH_MODEL_PUB_DEFINE macro.

Field Documentation

◆ addr

uint16_t bt_mesh_model_pub::addr

Publish Address.

◆ count

uint8_t bt_mesh_model_pub::count

Transmissions left.

◆ cred

uint16_t bt_mesh_model_pub::cred

Friendship Credentials Flag.

◆ delayable

uint8_t bt_mesh_model_pub::delayable

Use random delay for publishing.

◆ fast_period

uint16_t bt_mesh_model_pub::fast_period

Use FastPeriodDivisor.

◆ key

uint16_t bt_mesh_model_pub::key

Publish AppKey Index.

◆ mod

const struct bt_mesh_model* bt_mesh_model_pub::mod

The model the context belongs to.

Initialized by the stack.

◆ msg

struct net_buf_simple* bt_mesh_model_pub::msg

Publication buffer, containing the publication message.

This will get correctly created when the publication context has been defined using the BT_MESH_MODEL_PUB_DEFINE macro.

BT_MESH_MODEL_PUB_DEFINE(name, update, size);

◆ period

uint8_t bt_mesh_model_pub::period

Publish Period.

◆ period_div

uint8_t bt_mesh_model_pub::period_div

Divisor for the Period.

◆ period_start

uint32_t bt_mesh_model_pub::period_start

Start of the current period.

◆ retr_update

uint16_t bt_mesh_model_pub::retr_update

Call update callback on every retransmission.

◆ retransmit

uint8_t bt_mesh_model_pub::retransmit

Retransmit Count & Interval Steps.

◆ send_rel

uint16_t bt_mesh_model_pub::send_rel

Force reliable sending (segment acks)

◆ timer

struct k_work_delayable bt_mesh_model_pub::timer

Publish Period Timer.

Only for stack-internal use.

◆ ttl

uint8_t bt_mesh_model_pub::ttl

Publish Time to Live.

◆ update

int(* bt_mesh_model_pub::update) (const struct bt_mesh_model *mod)

Callback for updating the publication buffer.

When set to NULL, the model is assumed not to support periodic publishing. When set to non-NULL the callback will be called periodically and is expected to update bt_mesh_model_pub::msg with a valid publication message.

If the callback returns non-zero, the publication is skipped and will resume on the next periodic publishing interval.

When bt_mesh_model_pub::retr_update is set to 1, the callback will be called on every retransmission.

Parameters
modThe Model the Publication Context belongs to.
Returns
Zero on success or (negative) error code otherwise.

◆ uuid

const uint8_t* bt_mesh_model_pub::uuid

Label UUID if Publish Address is Virtual Address.


The documentation for this struct was generated from the following file: