forked from sandeepmistry/arduino-BLEPeripheral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBLEMultimedia.h
55 lines (46 loc) · 1.57 KB
/
BLEMultimedia.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _BLE_MULTIMEDIA_H_
#define _BLE_MULTIMEDIA_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)
// multimedia keys
#define MMKEY_KB_VOL_UP 0x80 // do not use
#define MMKEY_KB_VOL_DOWN 0x81 // do not use
#define MMKEY_VOL_UP 0xE9
#define MMKEY_VOL_DOWN 0xEA
#define MMKEY_SCAN_NEXT_TRACK 0xB5
#define MMKEY_SCAN_PREV_TRACK 0xB6
#define MMKEY_STOP 0xB7
#define MMKEY_PLAYPAUSE 0xCD
#define MMKEY_MUTE 0xE2
#define MMKEY_BASSBOOST 0xE5
#define MMKEY_LOUDNESS 0xE7
#define MMKEY_KB_EXECUTE 0x74
#define MMKEY_KB_HELP 0x75
#define MMKEY_KB_MENU 0x76
#define MMKEY_KB_SELECT 0x77
#define MMKEY_KB_STOP 0x78
#define MMKEY_KB_AGAIN 0x79
#define MMKEY_KB_UNDO 0x7A
#define MMKEY_KB_CUT 0x7B
#define MMKEY_KB_COPY 0x7C
#define MMKEY_KB_PASTE 0x7D
#define MMKEY_KB_FIND 0x7E
#define MMKEY_KB_MUTE 0x7F // do not use
class BLEMultimedia : public BLEHID
{
public:
BLEMultimedia();
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