esp-nimble-cpp
2.3.2
Loading...
Searching...
No Matches
NimBLEAttribute.h
1
/*
2
* Copyright 2020-2025 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_ATTRIBUTE_H_
19
#define NIMBLE_CPP_ATTRIBUTE_H_
20
21
#include "syscfg/syscfg.h"
22
#if CONFIG_BT_NIMBLE_ENABLED && (MYNEWT_VAL(BLE_ROLE_PERIPHERAL) || MYNEWT_VAL(BLE_ROLE_CENTRAL))
23
24
# include "NimBLEUUID.h"
25
29
class
NimBLEAttribute {
30
public
:
35
const
NimBLEUUID
& getUUID()
const
{
return
m_uuid; }
36
40
uint16_t getHandle()
const
{
return
m_handle; };
41
42
protected
:
48
NimBLEAttribute(
const
NimBLEUUID
& uuid, uint16_t handle) : m_uuid{uuid}, m_handle{handle} {}
49
53
~NimBLEAttribute() =
default
;
54
55
const
NimBLEUUID
m_uuid{};
56
uint16_t m_handle{0};
57
};
58
59
#endif
// CONFIG_BT_NIMBLE_ENABLED && (MYNEWT_VAL(BLE_ROLE_PERIPHERAL) || MYNEWT_VAL(BLE_ROLE_CENTRAL))
60
#endif
// NIMBLE_CPP_ATTRIBUTE_H_
NimBLEUUID
A model of a BLE UUID.
Definition
NimBLEUUID.h:41
src
NimBLEAttribute.h
Generated by
1.9.8