summaryrefslogtreecommitdiff
path: root/src/BLEExceptions.h
diff options
context:
space:
mode:
authorNeil Kolban <kolban1@kolban.com>2018-01-17 18:16:31 -0600
committerNeil Kolban <kolban1@kolban.com>2018-01-17 18:16:31 -0600
commit3f5005c383540d07dd16ac044c78d7be28d4aa8e (patch)
treec5236ddbe5c8dd99ad7083dd498110152ad0e9be /src/BLEExceptions.h
parentRemoval of unneeded file (diff)
downloadthermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.tar.gz
thermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.tar.bz2
thermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.zip
0.4.8
Diffstat (limited to 'src/BLEExceptions.h')
-rw-r--r--src/BLEExceptions.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/BLEExceptions.h b/src/BLEExceptions.h
new file mode 100644
index 0000000..369fcaf
--- /dev/null
+++ b/src/BLEExceptions.h
@@ -0,0 +1,31 @@
+/*
+ * BLExceptions.h
+ *
+ * Created on: Nov 27, 2017
+ * Author: kolban
+ */
+
+#ifndef COMPONENTS_CPP_UTILS_BLEEXCEPTIONS_H_
+#define COMPONENTS_CPP_UTILS_BLEEXCEPTIONS_H_
+#include "sdkconfig.h"
+
+#if CONFIG_CXX_EXCEPTIONS != 1
+#error "C++ exception handling must be enabled within make menuconfig. See Compiler Options > Enable C++ Exceptions."
+#endif
+
+#include <exception>
+
+
+class BLEDisconnectedException : public std::exception {
+ const char *what() const throw () {
+ return "BLE Disconnected";
+ }
+};
+
+class BLEUuidNotFoundException : public std::exception {
+ const char *what() const throw () {
+ return "No such UUID";
+ }
+};
+
+#endif /* COMPONENTS_CPP_UTILS_BLEEXCEPTIONS_H_ */