Mercurial > public > ostc4
annotate Discovery/Inc/cv_heartbeat.h @ 1033:5f66e44d69f0 Puls_Integration
Added functionality needed for subscription of standard Bluetooth pulse service notifications
| author | Ideenmodellierer |
|---|---|
| date | Sat, 02 Aug 2025 22:42:51 +0200 |
| parents | 33b91584d827 |
| children | 195bfbdf961d |
| rev | line source |
|---|---|
| 1032 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Inc/cv_heartbeat.h | |
| 5 /// \brief Function definitions for connecting to a Polar HC10 heartbeat sensor | |
| 6 /// \date 3 July 2025 | |
| 7 | |
| 8 /////////////////////////////////////////////////////////////////////////////// | |
| 9 /// \par Copyright (c) 2014-2015 Heinrichs Weikamp gmbh | |
| 10 /// | |
| 11 /// This program is free software: you can redistribute it and/or modify | |
| 12 /// it under the terms of the GNU General Public License as published by | |
| 13 /// the Free Software Foundation, either version 3 of the License, or | |
| 14 /// (at your option) any later version. | |
| 15 /// | |
| 16 /// This program is distributed in the hope that it will be useful, | |
| 17 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 /// GNU General Public License for more details. | |
| 20 /// | |
| 21 /// You should have received a copy of the GNU General Public License | |
| 22 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 23 ////////////////////////////////////////////////////////////////////////////// | |
| 24 | |
| 25 #ifndef INC_CV_HEARTBEAT_H_ | |
| 26 #define INC_CV_HEARTBEAT_H_ | |
| 27 | |
| 28 #include <stdint.h> | |
| 29 | |
| 30 | |
| 31 #define BLUEMOD_ADDR_SIZE (20u) /* length of address respond */ | |
| 32 #define BLUEMOD_RSSI_SIZE (5u) | |
| 33 #define BLUEMOD_NAME_SIZE (40u) | |
| 34 | |
| 35 void openEdit_Heartbeat(void); | |
| 36 | |
| 37 typedef enum | |
| 38 { | |
| 39 NO_INDICATOR = 0, | |
| 40 DEVICE_INDICATOR, | |
| 41 CONNECTION_INDICATOR, | |
| 42 SERVICE_INDICATOR, | |
|
1033
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
43 CHARACTERISTIC_INDICATOR, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
44 DESCRIPTOR_INDICATOR, |
| 1032 | 45 OK_INDICATOR, /* module control */ |
| 46 ERROR_INDICATOR /* module control */ | |
| 47 } indicatior_t; | |
| 48 | |
| 49 typedef enum | |
| 50 { | |
| 51 BT_READ_NOTHING = 0, | |
| 52 BT_READ_DEVICE_ADDR, | |
| 53 BT_READ_DEVICE_RSSI, | |
| 54 BT_READ_DEVICE_NAME, | |
| 55 BT_READ_CON_DETAILS, | |
| 56 BT_READ_SERV_HANDLE, | |
| 57 BT_READ_SERV_START, | |
| 58 BT_READ_SERV_END, | |
|
1033
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
59 BT_READ_SERV_UUID, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
60 BT_READ_CHAR_CONHANDLE, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
61 BT_READ_CHAR_ATTRIBUTE, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
62 BT_READ_CHAR_PROPERTY, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
63 BT_READ_CHAR_VALUEHANDLE, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
64 BT_READ_CHAR_UUID, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
65 BT_READ_DESC_CONHANDLE, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
66 BT_READ_DESC_CHARHANDLE, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
67 BT_READ_DESC_DESCHANDLE, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
68 BT_READ_DESC_UUID |
| 1032 | 69 } readDataType_t; |
| 70 | |
| 71 typedef enum | |
| 72 { | |
| 73 SENSOR_HB_OFFLINE = 0, /* Default Status no data available */ | |
| 74 SENSOR_HB_ENABLE_BLE, | |
| 75 SENSOR_HB_CHECK_CONFIG, | |
| 76 SENSOR_HB_DISCOVER, | |
| 77 SENSOR_HB_CONNECT, | |
|
1033
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
78 SENSOR_HB_DISCONNECT, |
| 1032 | 79 SENSOR_HB_SERVICES, |
|
1033
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
80 SENSOR_HB_CHARACTERISTIC, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
81 SENSOR_HB_DESCRIPTOR, |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
82 SENSOR_HB_SUBSCRIBE, |
| 1032 | 83 SENSOR_HB_RESTART, |
| 84 SENSOR_HB_DETECTION_INDICATOR, /* searching for indicators to identify data items */ | |
| 85 SENSOR_HB_DETECTION_RSSI, | |
| 86 SENSOR_HB_DETECTION_NAME, | |
| 87 SENSOR_HB_DETECTION_MAN, | |
| 88 SENSOR_HB_DETECTION_UUID, | |
| 89 SENSOR_HB_FOUND, /* A device providing the requested service was found */ | |
| 90 SENSOR_HB_CONNECTED, /* Connection to heartbeat sensor established */ | |
| 91 SENSOR_HB_OFFLINEMODE, /* Oflline measurement started */ | |
| 92 } sensorHeartbeat_State_t; | |
| 93 | |
| 94 typedef struct | |
| 95 { | |
| 96 uint8_t address[BLUEMOD_ADDR_SIZE]; | |
| 97 uint8_t rssi[BLUEMOD_RSSI_SIZE]; | |
| 98 uint8_t name[BLUEMOD_NAME_SIZE]; | |
| 99 } btDdeviceData_t; | |
| 100 | |
| 101 | |
| 102 typedef struct | |
| 103 { | |
| 104 uint8_t handle; | |
| 105 uint8_t start[6]; | |
| 106 uint8_t end[6]; | |
| 107 uint8_t uuid[50]; | |
| 108 } btDeviceService_t; | |
| 109 | |
|
1033
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
110 typedef struct |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
111 { |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
112 uint8_t conHandle; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
113 uint8_t attrHandle[10]; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
114 uint8_t properties[10]; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
115 uint8_t valueHandle[10]; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
116 uint8_t uuid[50]; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
117 } btDeviceCharacteristic_t; |
| 1032 | 118 |
|
1033
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
119 typedef struct |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
120 { |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
121 uint8_t conHandle; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
122 uint8_t charHandle[10]; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
123 uint8_t descHandle[10]; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
124 uint8_t uuid[50]; |
|
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
125 } btDeviceDescriptor_t; |
| 1032 | 126 |
| 127 sensorHeartbeat_State_t cv_heartbeat_getState(); | |
| 128 void refresh_Heartbeat(void); | |
| 129 void cv_heartbeat_Control(void); | |
|
1033
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
130 uint8_t cv_heartbeat_HandleData(); |
| 1032 | 131 |
| 132 #endif /* INC_CV_HEARTBEAT_H_ */ |
