FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
STM32duinoBLE/src/BLECharacteristic.h at main · stm32duino/STM32duinoBLE · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
stm32duino
/
STM32duinoBLE
Public
forked from
arduino-libraries/ArduinoBLE
Notifications
You must be signed in to change notification settings
Fork
23
Star
21
Code
Issues
3
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
STM32duinoBLE
/
src
/
BLECharacteristic.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
132 lines (100 loc) · 3.93 KB
Breadcrumbs
STM32duinoBLE
/
src
/
BLECharacteristic.h
Copy path
File metadata and controls
132 lines (100 loc) · 3.93 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
This file is part of the ArduinoBLE library.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#
ifndef
_BLE_CHARACTERISTIC_H_
#
define
_BLE_CHARACTERISTIC_H_
#
include
<
stdint.h
>
#
include
"
BLEDescriptor.h
"
enum
BLECharacteristicEvent {
BLESubscribed =
0
,
BLEUnsubscribed =
1
,
//
BLERead = 2, // defined in BLEProperties.h
BLEWritten =
3
,
BLEUpdated = BLEWritten,
//
alias
BLECharacteristicEventLast
};
class
BLECharacteristic
;
class
BLEDevice
;
typedef
void
(*BLECharacteristicEventHandler)(BLEDevice device, BLECharacteristic characteristic);
class
BLELocalCharacteristic
;
class
BLERemoteCharacteristic
;
class
BLECharacteristic
{
public:
BLECharacteristic
();
BLECharacteristic
(
const
char
* uuid,
uint16_t
permissions,
int
valueSize,
bool
fixedLength =
false
);
BLECharacteristic
(
const
char
* uuid,
uint16_t
permissions,
const
char
* value);
BLECharacteristic
(
const
BLECharacteristic& other);
virtual
~BLECharacteristic
();
const
char
*
uuid
()
const
;
uint8_t
properties
()
const
;
int
valueSize
()
const
;
const
uint8_t
*
value
()
const
;
int
valueLength
()
const
;
uint8_t
operator
[] (
int
offset)
const
;
int
readValue
(
uint8_t
value[],
int
length);
int
readValue
(
void
* value,
int
length);
int
readValue
(
uint8_t
& value);
int
readValue
(
int8_t
& value);
int
readValue
(
uint16_t
& value);
int
readValue
(
int16_t
& value);
int
readValue
(
uint32_t
& value);
int
readValue
(
int32_t
& value);
int
writeValue
(
const
uint8_t
value[],
int
length,
bool
withResponse =
true
);
int
writeValue
(
const
void
* value,
int
length,
bool
withResponse =
true
);
int
writeValue
(
const
char
* value,
bool
withResponse =
true
);
int
writeValue
(
uint8_t
value,
bool
withResponse =
true
);
int
writeValue
(
int8_t
value,
bool
withResponse =
true
);
int
writeValue
(
uint16_t
value,
bool
withResponse =
true
);
int
writeValue
(
int16_t
value,
bool
withResponse =
true
);
int
writeValue
(
uint32_t
value,
bool
withResponse =
true
);
int
writeValue
(
int32_t
value,
bool
withResponse =
true
);
//
deprecated, use writeValue(...)
int
setValue
(
const
uint8_t
value[],
int
length) {
return
writeValue
(value, length); }
int
setValue
(
const
char
* value) {
return
writeValue
(value); }
int
broadcast
();
bool
written
();
bool
subscribed
();
bool
valueUpdated
();
void
addDescriptor
(BLEDescriptor& descriptor);
operator
bool
()
const
;
void
setEventHandler
(
int
event, BLECharacteristicEventHandler eventHandler);
int
descriptorCount
()
const
;
bool
hasDescriptor
(
const
char
* uuid)
const
;
bool
hasDescriptor
(
const
char
* uuid,
int
index)
const
;
BLEDescriptor
descriptor
(
int
index)
const
;
BLEDescriptor
descriptor
(
const
char
* uuid)
const
;
BLEDescriptor
descriptor
(
const
char
* uuid,
int
index)
const
;
bool
canRead
();
bool
read
();
bool
canWrite
();
bool
canSubscribe
();
bool
subscribe
();
bool
canUnsubscribe
();
bool
unsubscribe
();
protected:
friend
class
BLELocalCharacteristic
;
friend
class
BLELocalService
;
BLECharacteristic
(BLELocalCharacteristic* local);
BLELocalCharacteristic*
local
();
protected:
friend
class
BLEDevice
;
friend
class
BLEService
;
friend
class
BLERemoteCharacteristic
;
BLECharacteristic
(BLERemoteCharacteristic* remote);
private:
BLELocalCharacteristic* _local;
BLERemoteCharacteristic* _remote;
};
#
endif
Back
|
FazBrowse Home
|
New Git URL