forked from sandeepmistry/arduino-BLEPeripheral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BLEDevice.cpp
44 lines (34 loc) · 1.17 KB
/
BLEDevice.cpp
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
#include "Arduino.h"
#include "BLEDevice.h"
#define DEFAULT_ADVERTISING_INTERVAL 100
#define DEFAULT_CONNECTABLE true
BLEDevice::BLEDevice() :
_advertisingInterval(DEFAULT_ADVERTISING_INTERVAL),
_minimumConnectionInterval(0),
_maximumConnectionInterval(0),
_connectable(DEFAULT_CONNECTABLE),
_bondStore(NULL),
_eventListener(NULL)
{
}
BLEDevice::~BLEDevice() {
}
void BLEDevice::setEventListener(BLEDeviceEventListener* eventListener) {
this->_eventListener = eventListener;
}
void BLEDevice::setAdvertisingInterval(unsigned short advertisingInterval) {
this->_advertisingInterval = advertisingInterval;
}
void BLEDevice::setConnectionInterval(unsigned short minimumConnectionInterval, unsigned short maximumConnectionInterval) {
if (maximumConnectionInterval < minimumConnectionInterval) {
maximumConnectionInterval = minimumConnectionInterval;
}
this->_minimumConnectionInterval = minimumConnectionInterval;
this->_maximumConnectionInterval = maximumConnectionInterval;
}
void BLEDevice::setConnectable(bool connectable) {
this->_connectable = connectable;
}
void BLEDevice::setBondStore(BLEBondStore& bondStore) {
this->_bondStore = &bondStore;
}