File tree Expand file tree Collapse file tree 4 files changed +86
-0
lines changed
libraries/Bluefruit52Lib/src Expand file tree Collapse file tree 4 files changed +86
-0
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // Created by Charlie Bershatsky on 4/19/23.
3
+ //
4
+
5
+ #include " BLEClientIas.h"
Original file line number Diff line number Diff line change
1
+ //
2
+ // Created by Charlie Bershatsky on 4/19/23.
3
+ //
4
+
5
+ #ifndef ADAFRUIT_NRF52_ARDUINO_BLECLIENTIAS_H
6
+ #define ADAFRUIT_NRF52_ARDUINO_BLECLIENTIAS_H
7
+
8
+
9
+ class BLEClientIas {
10
+
11
+ };
12
+
13
+
14
+ #endif // ADAFRUIT_NRF52_ARDUINO_BLECLIENTIAS_H
Original file line number Diff line number Diff line change
1
+ //
2
+ // Created by Charlie Bershatsky on 4/19/23.
3
+ //
4
+
5
+ #include " BLEIas.h"
6
+ #include " bluefruit.h"
7
+ #include " utility/utilities.h"
8
+ #include " BLEService.h"
9
+
10
+ BLEIas::BLEIas (void ) : BLEService(UUID16_SVC_IMMEDIATE_ALERT) {
11
+
12
+ }
13
+
14
+ void BLEIas::setAlertLevel (const uint8_t alert_level) {
15
+ _alert_level = alert_level;
16
+ }
17
+
18
+ err_t BLEIas::begin (void ) {
19
+
20
+ // Invoke the superclass begin()
21
+ VERIFY_STATUS (BLEService::begin ());
22
+
23
+ BLECharacteristic chars;
24
+
25
+ chars.setUuid (UUID16_CHR_ALERT_LEVEL);
26
+ chars.setTempMemory ();
27
+ chars.setProperties (CHR_PROPS_READ);
28
+ chars.setFixedLen (sizeof (_alert_level));
29
+ VERIFY_STATUS (chars.begin ());
30
+ chars.write (_alert_level, sizeof (_alert_level));
31
+
32
+ return ERROR_NONE;
33
+
34
+ }
Original file line number Diff line number Diff line change
1
+ //
2
+ // Created by Charlie Bershatsky on 4/19/23.
3
+ //
4
+
5
+ #ifndef ADAFRUIT_NRF52_ARDUINO_BLEIAS_H
6
+ #define ADAFRUIT_NRF52_ARDUINO_BLEIAS_H
7
+
8
+ #include " bluefruit_common.h"
9
+
10
+ #include " BLEService.h"
11
+ #include " BLECharacteristic.h"
12
+
13
+
14
+ class BLEIas : public BLEService {
15
+
16
+ protected:
17
+ union {
18
+ struct {
19
+ const uint8_t _alert_level; // UUID 0x2A06
20
+ };
21
+ };
22
+
23
+ public:
24
+ BLEIas (void );
25
+
26
+ void setAlertLevel (uint8_t alert_level);
27
+
28
+ virtual err_t begin (void );
29
+
30
+ };
31
+
32
+
33
+ #endif // ADAFRUIT_NRF52_ARDUINO_BLEIAS_H
You can’t perform that action at this time.
0 commit comments