summaryrefslogtreecommitdiff
path: root/lib/bt/esp_ble_mesh/common/include/mesh/queue.h
blob: 021c99ba670a9254f67390d729389a002f2a6a7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _BLE_MESH_QUEUE_H_
#define _BLE_MESH_QUEUE_H_

#include "mesh/kernel.h"
#include "mesh/slist.h"
#include "mesh/atomic.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    QueueHandle_t handle;
#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC
    StaticQueue_t *buffer;
    uint8_t *storage;
#endif
} bt_mesh_queue_t;

int bt_mesh_queue_init(bt_mesh_queue_t *queue, uint16_t queue_size, uint8_t item_size);
int bt_mesh_queue_deinit(bt_mesh_queue_t *queue);

#ifdef __cplusplus
}
#endif

#endif /* _BLE_MESH_QUEUE_H_ */