summaryrefslogtreecommitdiff
path: root/sensor/patchedBLE/src/BLEExceptions.h
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2018-08-03 12:23:17 +0100
committerdakkar <dakkar@thenautilus.net>2018-08-03 12:23:17 +0100
commitbb00c2da73b6ab8837f50c9f889ee151f8abc036 (patch)
tree3922eb826386260568ccaa1da7056c141f752a97 /sensor/patchedBLE/src/BLEExceptions.h
parentdon't print from callback, there's races (diff)
parentUpload of 0.4.16 (diff)
downloadthermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.tar.gz
thermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.tar.bz2
thermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.zip
Add 'sensor/patchedBLE/' from commit '7951347ed68313d75c367e1f2cce763cb56d1eb2'
git-subtree-dir: sensor/patchedBLE git-subtree-mainline: 27e209cf58abeda1dc110777f99a98804a13fdbf git-subtree-split: 7951347ed68313d75c367e1f2cce763cb56d1eb2
Diffstat (limited to 'sensor/patchedBLE/src/BLEExceptions.h')
-rw-r--r--sensor/patchedBLE/src/BLEExceptions.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/sensor/patchedBLE/src/BLEExceptions.h b/sensor/patchedBLE/src/BLEExceptions.h
new file mode 100644
index 0000000..369fcaf
--- /dev/null
+++ b/sensor/patchedBLE/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_ */