esp-nimble-cpp 2.0.2
Loading...
Searching...
No Matches
NimBLELocalAttribute.h
1/*
2 * Copyright 2020-2024 Ryan Powell <ryan@nable-embedded.io> and
3 * esp-nimble-cpp, NimBLE-Arduino contributors.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NIMBLE_CPP_LOCAL_ATTRIBUTE_H_
19#define NIMBLE_CPP_LOCAL_ATTRIBUTE_H_
20
21#include "nimconfig.h"
22#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
23
24# include "NimBLEAttribute.h"
25
30 public:
35 uint8_t getRemoved() const { return m_removed; }
36
37 protected:
41 NimBLELocalAttribute(const NimBLEUUID& uuid, uint16_t handle) : NimBLEAttribute{uuid, handle}, m_removed{0} {}
42
47
52 void setRemoved(uint8_t removed) { m_removed = removed; }
53
54 uint8_t m_removed{0};
55};
56
57#endif // CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
58#endif // NIMBLE_CPP_LOCAL_ATTRIBUTE_H_
A base class for BLE attributes.
Definition NimBLEAttribute.h:29
A base class for local BLE attributes.
Definition NimBLELocalAttribute.h:29
void setRemoved(uint8_t removed)
Set the removed flag.
Definition NimBLELocalAttribute.h:52
uint8_t getRemoved() const
Get the removed flag.
Definition NimBLELocalAttribute.h:35
NimBLELocalAttribute(const NimBLEUUID &uuid, uint16_t handle)
Construct a local attribute.
Definition NimBLELocalAttribute.h:41
~NimBLELocalAttribute()=default
Destroy the local attribute.
A model of a BLE UUID.
Definition NimBLEUUID.h:41