forked from sandeepmistry/arduino-BLEPeripheral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBLESystemControl.h
35 lines (26 loc) · 940 Bytes
/
BLESystemControl.h
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
#ifndef _BLE_SYSTEM_CONTROL_H_
#define _BLE_SYSTEM_CONTROL_H_
#include "Arduino.h"
#include "BLECharacteristic.h"
#include "BLEHIDReportReferenceDescriptor.h"
#include "BLEHID.h"
// From: https://github.com/adafruit/Adafruit-Trinket-USB/blob/master/TrinketHidCombo/TrinketHidCombo.h
// permission to use under MIT license by @ladyada (https://github.com/adafruit/Adafruit-Trinket-USB/issues/10)
// system control keys
#define SYSCTRLKEY_POWER 0x01
#define SYSCTRLKEY_SLEEP 0x02
#define SYSCTRLKEY_WAKE 0x03
class BLESystemControl : public BLEHID
{
public:
BLESystemControl();
size_t write(uint8_t k);
protected:
virtual void setReportId(unsigned char reportId);
virtual unsigned char numAttributes();
virtual BLELocalAttribute** attributes();
private:
BLECharacteristic _reportCharacteristic;
BLEHIDReportReferenceDescriptor _reportReferenceDescriptor;
};
#endif