forked from sandeepmistry/arduino-BLEPeripheral
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBLEDescriptor.cpp
More file actions
34 lines (26 loc) · 761 Bytes
/
BLEDescriptor.cpp
File metadata and controls
34 lines (26 loc) · 761 Bytes
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
#include "Arduino.h"
#include "BLEDeviceLimits.h"
#include "BLEDescriptor.h"
BLEDescriptor::BLEDescriptor(const char* uuid, const unsigned char value[], unsigned char valueLength) :
BLELocalAttribute(uuid, BLETypeDescriptor),
_value(value),
_valueLength(valueLength)
{
}
BLEDescriptor::BLEDescriptor(const char* uuid, const char* value) :
BLELocalAttribute(uuid, BLETypeDescriptor),
_value((const unsigned char*)value),
_valueLength(strlen(value))
{
}
BLEDescriptor::~BLEDescriptor() {
}
const unsigned char* BLEDescriptor::value() const {
return this->_value;
}
unsigned char BLEDescriptor::valueLength() const {
return this->_valueLength;
}
unsigned char BLEDescriptor::operator[] (int offset) const {
return this->_value[offset];
}