amiro-os / components / bluetooth / bluetooth-descriptor.cpp @ a47d64ad
History | View | Annotate | Download (965 Bytes)
1 |
#include <ch.hpp> |
---|---|
2 |
#include <hal.h> |
3 |
|
4 |
#include <amiro/bluetooth/bluetooth-descriptor.hpp> |
5 |
|
6 |
|
7 |
using namespace chibios_rt; |
8 |
using namespace amiro; |
9 |
|
10 |
|
11 |
BluetoothDescriptor::BluetoothDescriptor() : |
12 |
linkId(0), length(0), buffer{0} { |
13 |
} |
14 |
|
15 |
//----------------------------------------------------------------
|
16 |
|
17 |
|
18 |
void BluetoothDescriptor::bluetoothDescriptorSetLinkId(uint8_t linkId) {
|
19 |
this->linkId = linkId;
|
20 |
} |
21 |
|
22 |
void BluetoothDescriptor::bluetoothDescriptorSetPayloadLength(size_t length) {
|
23 |
this->length = length;
|
24 |
} |
25 |
|
26 |
uint8_t BluetoothDescriptor::bluetoothDescriptorGetLinkId() { |
27 |
return this->linkId; |
28 |
} |
29 |
|
30 |
size_t BluetoothDescriptor::bluetoothDescriptorGetBufferLength() { |
31 |
return sizeof(this->buffer); |
32 |
} |
33 |
|
34 |
size_t BluetoothDescriptor::bluetoothDescriptorGetPayloadLength() { |
35 |
return this->length; |
36 |
} |
37 |
|
38 |
uint8_t* BluetoothDescriptor::bluetoothDescriptorGetBuffer() { |
39 |
return this->buffer; |
40 |
} |
41 |
|
42 |
uint8_t* BluetoothDescriptor::bluetoothDescriptorGetPayload() { |
43 |
return this->buffer; |
44 |
} |