mirror of
https://github.com/espressif/esp-idf
synced 2025-03-12 10:39:11 -04:00
ble_mesh: Add net_buf_simple_init_with_data [Zephyr]
This commit is contained in:
parent
d6a247f7e4
commit
8271ae4a1e
@ -152,6 +152,18 @@ static inline void net_buf_simple_init(struct net_buf_simple *buf,
|
||||
buf->len = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize a net_buf_simple object with data.
|
||||
*
|
||||
* Initialized buffer object with external data.
|
||||
*
|
||||
* @param buf Buffer to initialize.
|
||||
* @param data External data pointer
|
||||
* @param size Amount of data the pointed data buffer if able to fit.
|
||||
*/
|
||||
void net_buf_simple_init_with_data(struct net_buf_simple *buf,
|
||||
void *data, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Reset buffer
|
||||
*
|
||||
|
@ -383,6 +383,15 @@ void net_buf_reset(struct net_buf *buf)
|
||||
net_buf_simple_reset(&buf->b);
|
||||
}
|
||||
|
||||
void net_buf_simple_init_with_data(struct net_buf_simple *buf,
|
||||
void *data, size_t size)
|
||||
{
|
||||
buf->__buf = data;
|
||||
buf->data = data;
|
||||
buf->size = size;
|
||||
buf->len = size;
|
||||
}
|
||||
|
||||
void net_buf_simple_reserve(struct net_buf_simple *buf, size_t reserve)
|
||||
{
|
||||
NET_BUF_ASSERT(buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user