1 # Bluetooth Policy Virtual Table
3 | Table | Column | Type | Value |
5 | bluetooth | state | int | 0 = off , 1 = on |
6 | | desktopConnectivity | int | 0 = off , 1 = on |
7 | | tethering | int | 0 = off , 1 = on |
8 | | pairing | int | 0 = off , 1 = on |
10 ## Get bluetooth policies
12 SELECT * FROM bluetooth
13 SELECT state FROM bluetooth
14 SELECT desktopConnectivity FROM bluetooth
15 SELECT pairing FROM bluetooth
16 SELECT tethering FROM bluetooth
19 ## Set bluetooth policies
21 UPDATE bluetooth SET state = 1 # on
22 UPDATE bluetooth SET desktopConnectivity = 0 # off
23 UPDATE bluetooth SET pairing = 1 # on
24 UPDATE bluetooth SET tethering = 0 # off
25 UPDATE bluetooth SET state = 1, pairing = 0
33 int desktopConnectivity;
37 DECLARE_COLUMN(State, "state", &Bluetooth::state);
38 DECLARE_COLUMN(DesktopConnectivity, "desktopConnectivity", &Bluetooth::DesktopConnectivity);
39 DECLARE_COLUMN(Pairing, "pairing", &Bluetooth::pairing);
40 DECLARE_COLUMN(Tethering, "tethering", &Bluetooth::tethering);
43 DECLARE_TABLE(bluetoothTable, "bluetooth", Bluetooth::State,
44 Bluetooth::DesktopConnectivity,
46 Bluetooth::Tethering);
49 ## Generate type-safed query
52 // SELECT * FROM bluetooth
53 bluetoothTable.selectAll();
55 // SELECT state FROM bluetooth
56 bluetoothTable.selectAll(Bluetooth::State);
58 // UPDATE bluetooth SET state = 1
59 bluetoothTable.update(Bluetooth::State = 1);
61 // UPDATE bluetooth SET state = 1, pairing = 0
62 bluetoothTable.update(Bluetooth::State = 1, Bluetooth::Pairing = 0);