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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
/**
******************************************************************************
* @file motenv_stm.h
* @author SRA/AST
* @brief Header for motenv_stm.c module
******************************************************************************
* @attention
*
* Copyright (c) 2018-2021 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef MOTENV_STM_H
#define MOTENV_STM_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/**
* @brief MOTENV Event Opcode definition
*/
typedef enum
{
/* HW Service Chars related events */
HW_MOTION_NOTIFY_ENABLED_EVT,
HW_MOTION_NOTIFY_DISABLED_EVT,
HW_ENV_NOTIFY_ENABLED_EVT,
HW_ENV_NOTIFY_DISABLED_EVT,
HW_ENV_READ_EVT,
HW_ACC_EVENT_NOTIFY_ENABLED_EVT,
HW_ACC_EVENT_NOTIFY_DISABLED_EVT,
HW_ACC_EVENT_READ_EVT,
/* SW Service Chars related events */
SW_MOTIONFX_NOTIFY_ENABLED_EVT,
SW_MOTIONFX_NOTIFY_DISABLED_EVT,
SW_ECOMPASS_NOTIFY_ENABLED_EVT,
SW_ECOMPASS_NOTIFY_DISABLED_EVT,
SW_ACTIVITY_REC_NOTIFY_ENABLED_EVT,
SW_ACTIVITY_REC_NOTIFY_DISABLED_EVT,
SW_ACTIVITY_REC_READ_EVT,
SW_CARRY_POSITION_NOTIFY_ENABLED_EVT,
SW_CARRY_POSITION_NOTIFY_DISABLED_EVT,
SW_CARRY_POSITION_READ_EVT,
SW_GESTURE_REC_NOTIFY_ENABLED_EVT,
SW_GESTURE_REC_NOTIFY_DISABLED_EVT,
SW_GESTURE_REC_READ_EVT,
SW_PEDOMETER_NOTIFY_ENABLED_EVT,
SW_PEDOMETER_NOTIFY_DISABLED_EVT,
SW_PEDOMETER_READ_EVT,
SW_INTENSITY_DET_NOTIFY_ENABLED_EVT,
SW_INTENSITY_DET_NOTIFY_DISABLED_EVT,
/* Config Service Chars related events */
CONFIG_NOTIFY_ENABLED_EVT,
CONFIG_NOTIFY_DISABLED_EVT,
CONFIG_WRITE_EVT,
/* Console Service Chars related events */
CONSOLE_TERM_NOTIFY_ENABLED_EVT,
CONSOLE_TERM_NOTIFY_DISABLED_EVT,
CONSOLE_STDERR_NOTIFY_ENABLED_EVT,
CONSOLE_STDERR_NOTIFY_DISABLED_EVT,
CONSOLE_TERM_READ_EVT,
CONSOLE_STDERR_READ_EVT
} MOTENV_STM_Opcode_evt_t;
/**
* @brief MOTENV Event data structure definition
*/
typedef struct
{
uint8_t *pPayload;
uint8_t Length;
} MOTENV_STM_Data_t;
/**
* @brief MOTENV Notification structure definition
*/
typedef struct
{
MOTENV_STM_Opcode_evt_t Motenv_Evt_Opcode;
MOTENV_STM_Data_t DataTransfered;
uint16_t ConnectionHandle;
uint8_t ServiceInstance;
} MOTENV_STM_App_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/**
* @brief Motion (Acc-Gyro-Magneto) Char shortened UUID
*/
#define MOTION_CHAR_UUID (0xE000)
/**
* @brief Environmental (Temp-Humidity-Pressure) Char shortened UUID
*/
#define ENV_CHAR_UUID (0x1D00)
/**
* @brief Acceleration event Char shortened UUID
*/
#define ACC_EVENT_CHAR_UUID (0x0004)
/**
* @brief Sensor Fusion Char shortened UUID
*/
#define MOTION_FX_CHAR_UUID (0x0100)
/**
* @brief E-Compass event Char shortened UUID
*/
#define ECOMPASS_CHAR_UUID (0x0040)
/**
* @brief Activity Recognition Char event Char shortened UUID
*/
#define ACTIVITY_REC_CHAR_UUID (0x0010)
/**
* @brief Carry Position event Char shortened UUID
*/
#define CARRY_POSITION_CHAR_UUID (0x0008)
/**
* @brief Gesture Recognition event Char shortened UUID
*/
#define GESTURE_REC_CHAR_UUID (0x0200)
/**
* @brief Pedometer Char shortened UUID
*/
#define PEDOMETER_CHAR_UUID (0x0001)
/**
* @brief Intensity Detection Char shortened UUID
*/
#define INTENSITY_DET_CHAR_UUID (0x0020)
/**
* @brief Config Char shortened UUID
*/
#define CONFIG_CHAR_UUID (0x0002)
/**
* @brief Console Terminal Char shortened UUID
*/
#define CONSOLE_TERM_CHAR_UUID (0x010E)
/**
* @brief Cosnole Stderr Char shortened UUID
*/
#define CONSOLE_STDERR_CHAR_UUID (0x020E)
/* Exported functions ------------------------------------------------------- */
void MOTENV_STM_Init(void);
void MOTENV_STM_App_Notification(MOTENV_STM_App_Notification_evt_t *pNotification);
tBleStatus MOTENV_STM_App_Update_Char(uint16_t UUID, uint8_t payloadLen, uint8_t *pPayload);
#ifdef __cplusplus
}
#endif
#endif /* MOTENV_STM_H */
|