aboutsummaryrefslogtreecommitdiff
path: root/src/Globals.h
blob: 02b7fa0e9a92fe99f0013a015d1d4186fcddddb2 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
// Copyright 2017 Paul Nettle. 
// 
// This file is part of Gobbledegook. 
// 
// Gobbledegook is free software: you can redistribute it and/or modify 
// it under the terms of the GNU General Public License as published by 
// the Free Software Foundation, either version 3 of the License, or 
// (at your option) any later version. 
// 
// Gobbledegook is distributed in the hope that it will be useful, 
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
// GNU General Public License for more details. 
// 
// You should have received a copy of the GNU General Public License 
// along with Gobbledegook.  If not, see <http://www.gnu.org/licenses/>. 
 
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
// 
// >> 
// >>>  INSIDE THIS FILE 
// >> 
// 
// System-wide globals. 
// 
// >> 
// >>>  DISCUSSION 
// >> 
// 
// The globals below define the name of the server, along with any name-based items (such as errors.) 
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 
#pragma once
 
#include <string>
 
// The name for this controller, as advertised over LE 
// 
// IMPORTANT: Setting the advertisingName will change the system-wide name of the device. If that's not what you want, set BOTH 
// kCustomGlobalAdvertisingName and kCustomGlobalAdvertisingShortName to as empty string ("") to prevent setting the advertising 
// name. 
#define kCustomGlobalAdvertisingName std::string("Gobbledegook")
 
// The short name for this controller, as advertised over LE 
// 
// According to the spec, the short name is used in case the full name doesn't fit within Extended Inquiry Response (EIR) or 
// Advertising Data (AD). 
// 
// IMPORTANT: Setting the advertisingName will change the system-wide name of the device. If that's not what you want, set BOTH 
// kCustomGlobalAdvertisingName and kCustomGlobalAdvertisingShortName to as empty string ("") to prevent setting the advertising 
// name. 
#define kCustomGlobalAdvertisingShortName std::string("Gobbledegook")
 
// The name of our server (collectino of services) 
// 
// This is used to build the path for our Bluetooth services (and we'll go ahead and use it as the owned name as well for 
// consistency.) 
#define kServerName std::string("gobbledegook")
 
// Our owned name 
// 
// D-Bus uses owned names to locate servers on the bus. Think of this as a namespace within D-Bus. Building this with the server 
// name, though it's not necessary to do so. We can call this anything we want, really. 
#define kServerOwnedName (std::string("com.") + kServerName)
 
// 
// Custom defined errors 
// 
// In order to avoid confusion, we should use the owned name here, so errors are like extensions to that name. This way, if a 
// client gets one of these errors, it'll be clear which server it came from. 
#define kErrorNotImplemented (kServerOwnedName + ".NotImplemented")