NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
lpn.h
1/* Bluetooth Mesh */
2
3/*
4 * Copyright (c) 2017 Intel Corporation
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8#ifndef __LPN_H__
9#define __LPN_H__
10
11#include "../include/mesh/mesh.h"
12
13int bt_mesh_lpn_friend_update(struct bt_mesh_net_rx *rx,
14 struct os_mbuf *buf);
15int bt_mesh_lpn_friend_offer(struct bt_mesh_net_rx *rx,
16 struct os_mbuf *buf);
17int bt_mesh_lpn_friend_clear_cfm(struct bt_mesh_net_rx *rx,
18 struct os_mbuf *buf);
19int bt_mesh_lpn_friend_sub_cfm(struct bt_mesh_net_rx *rx,
20 struct os_mbuf *buf);
21
22static inline bool bt_mesh_lpn_established(void)
23{
24#if (MYNEWT_VAL(BLE_MESH_LOW_POWER))
25 return bt_mesh.lpn.established;
26#else
27 return false;
28#endif
29}
30
31static inline bool bt_mesh_lpn_match(uint16_t addr)
32{
33#if (MYNEWT_VAL(BLE_MESH_LOW_POWER))
34 if (bt_mesh_lpn_established()) {
35 return (addr == bt_mesh.lpn.frnd);
36 }
37#endif
38 return false;
39}
40
41static inline bool bt_mesh_lpn_waiting_update(void)
42{
43#if (MYNEWT_VAL(BLE_MESH_LOW_POWER))
44 return (bt_mesh.lpn.state == BT_MESH_LPN_WAIT_UPDATE);
45#else
46 return false;
47#endif
48}
49
50void bt_mesh_lpn_msg_received(struct bt_mesh_net_rx *rx);
51
52void bt_mesh_lpn_group_add(uint16_t group);
53void bt_mesh_lpn_group_del(uint16_t *groups, size_t group_count);
54
55void bt_mesh_lpn_disable(bool force);
56
57int bt_mesh_lpn_init(void);
58
59#endif
Definition os_mbuf.h:86