-
Notifications
You must be signed in to change notification settings - Fork 1
/
rfkill.h
60 lines (46 loc) · 945 Bytes
/
rfkill.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
56
57
58
59
60
#ifndef RFKILL_H
#define RFKILL_H
#include <stdint.h>
#include <string>
#include <vector>
namespace rfkill {
enum Type {
ALL = 0,
WLAN,
BLUETOOTH,
UWB,
WIMAX,
WWAN,
GPS,
FM,
NFC,
NUM_RFKILL_TYPES,
};
enum Operation {
ADD = 0,
DEL,
CHANGE,
CHANGE_ALL,
};
struct RawEvent {
u_int32_t index;
u_int8_t type;
u_int8_t operation;
u_int8_t soft, hard;
} __attribute__((packed));
struct Event {
std::string name;
uint32_t index;
Type type;
bool soft;
bool hard;
Event();
Event(RawEvent &rawEvent_);
};
std::string getName(uint32_t index);
std::vector<Event> list();
bool send(RawEvent event);
bool block(uint32_t index, bool value);
bool block(Type type, bool value);
}
#endif