Trinity Devboard PCB V1.0 Firmware. FreeRTOS is setup and the MCU reads IMU data over SPI fand Magnetometer data over I2C, each with a seperate task. Sensordata is then run though MadgwickAHRS and send over USB as serial packet data to use in trinity visualizer. Bare minimum functionality works and is replicated from the first prototype.

This commit is contained in:
2026-09-13 19:51:03 +02:00
commit 7ee381de58
1630 changed files with 632404 additions and 0 deletions
@@ -0,0 +1,62 @@
/**
******************************************************************************
* @file bas.h
* @author MCD Application Team
* @brief Header for bas.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 __BAS_H
#define __BAS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
BAS_LEVEL_NOT_ENABLED_EVT,
BAS_LEVEL_NOT_DISABLED_EVT,
BAS_LEVEL_READ_EVT
} BAS_Opcode_Notification_evt_t;
typedef struct
{
BAS_Opcode_Notification_evt_t BAS_Evt_Opcode;
uint8_t ServiceInstance;
}BAS_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
#define BAS_LEVEL_NOTIFICATION_OPTION 1
/* Exported functions ------------------------------------------------------- */
void BAS_Init(void);
void BAS_Update_Char(uint16_t UUID, uint8_t service_instance, uint8_t *pPayload);
void BAS_Notification(BAS_Notification_evt_t * pNotification);
#ifdef __cplusplus
}
#endif
#endif /*__BAS_H */
+102
View File
@@ -0,0 +1,102 @@
/**
******************************************************************************
* @file bls.h
* @author MCD Application Team
* @brief Header for bls.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 __BLS_H
#define __BLS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
NO_FLAG = 0,
VALUE_UNIT_KILO_PASCAL = (1<<0), /*0 -> Blood pressure systolic, diastolic & Mean values in units of mmHg - if 1 -> in units of kPa*/
TIME_STAMP_PRESENT = (1<<1),
PULSE_RATE_PRESENT = (1<<2),
USER_ID_PRESENT = (1<<3),
MEASUREMENT_STATUS_PRESENT = (1<<4)
} BLS_Measurement_Flags_t;
typedef enum
{
BLS_MEASUREMENT_IND_ENABLED_EVT,
BLS_MEASUREMENT_IND_DISABLED_EVT,
#if (BLE_CFG_BLS_INTERMEDIATE_CUFF_PRESSURE != 0)
BLS_INTERMEDIATE_CUFF_PRESSURE_NOTIF_ENABLED_EVT,
BLS_INTERMEDIATE_CUFF_PRESSURE_NOTIF_DISABLED_EVT,
#endif
} BLS_App_Opcode_Notification_evt_t;
typedef struct
{
BLS_App_Opcode_Notification_evt_t BLS_Evt_Opcode;
}BLS_App_Notification_evt_t;
typedef struct
{
uint16_t Year;
uint8_t Month;
uint8_t Day;
uint8_t Hours;
uint8_t Minutes;
uint8_t Seconds;
}BLS_TimeStamp_t;
typedef struct
{
uint16_t MeasurementValue_Systolic;
uint16_t MeasurementValue_Diastolic;
uint16_t MeasurementValue_Mean;
#if (BLE_CFG_BLS_TIME_STAMP_FLAG != 0)
BLS_TimeStamp_t TimeStamp;
#endif
#if (BLE_CFG_BLS_PULSE_RATE_FLAG != 0)
uint16_t PulseRate;
#endif
#if (BLE_CFG_BLS_USER_ID_FLAG != 0)
uint8_t UserID;
#endif
#if (BLE_CFG_BLS_MEASUREMENT_STATUS_FLAG != 0)
uint16_t MeasurementStatus;
#endif
uint8_t Flags;
}BLS_Value_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void BLS_Init(void);
void BLS_Update_Char(uint16_t UUID, uint8_t *pPayload);
void BLS_App_Notification(BLS_App_Notification_evt_t * pNotification);
#ifdef __cplusplus
}
#endif
#endif /*__BLS_H */
@@ -0,0 +1,72 @@
/**
******************************************************************************
* @file crs_stm.h
* @author MCD Application Team
* @brief Header for crs_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 __STM32XX_CRS_H
#define __STM32XX_CRS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
CRS_NOTIFY_ENABLED_EVT,
CRS_NOTIFY_DISABLED_EVT,
CRS_READ_EVT,
CRS_WRITE_EVT,
} CRS_Opcode_evt_t;
typedef struct
{
uint8_t * pPayload;
uint8_t Length;
}CRS_Data_t;
typedef struct
{
CRS_Opcode_evt_t CRS_Evt_Opcode;
CRS_Data_t DataTransfered;
uint16_t ConnectionHandle;
uint8_t ServiceInstance;
}CRS_STM_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
#define CRS_MAX_DATA_LEN (BLE_DEFAULT_ATT_MTU - 3) /**< Maximum length of data (in bytes) that can be transmitted to the peer. */
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void CRS_STM_Init(void);
void CRS_STM_Notification(CRS_STM_Notification_evt_t *p_Notification);
tBleStatus CRS_STM_Update_Char(uint16_t UUID, uint8_t *p_Payload);
#ifdef __cplusplus
}
#endif
#endif /*__STM32XX_CRS_H */
@@ -0,0 +1,52 @@
/**
******************************************************************************
* @file dis.h
* @author MCD Application Team
* @brief Header for dis.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 __DIS_H
#define __DIS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef struct
{
uint8_t *pPayload;
uint8_t Length;
}DIS_Data_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void DIS_Init(void);
tBleStatus DIS_UpdateChar(uint16_t uuid, DIS_Data_t *p_data);
#ifdef __cplusplus
}
#endif
#endif /*__DIS_H */
@@ -0,0 +1,79 @@
/**
******************************************************************************
* @file eds_stm.h
* @author MCD Application Team
* @brief Header for stm32xx_enddevicemanagement.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 __EDS_STM_H
#define __EDS_STM_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
EDS_STM_NOTIFY_DISABLED_EVT,
EDS_STM_NOTIFY_ENABLED_EVT,
} EDS_STM_Opcode_evt_t;
typedef struct
{
uint8_t Device1_Status;
uint8_t Device2_Status;
uint8_t Device3_Status;
uint8_t Device4_Status;
uint8_t Device5_Status;
uint8_t Device6_Status;
}EDS_STM_Status_t;
typedef struct
{
uint8_t * pPayload;
uint8_t Length;
}EDS_STM_Data_t;
typedef struct
{
EDS_STM_Opcode_evt_t EDS_Evt_Opcode;
EDS_STM_Data_t DataTransfered;
uint16_t ConnectionHandle;
}EDS_STM_App_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void EDS_STM_Init( void );
void EDS_STM_App_Notification(EDS_STM_App_Notification_evt_t * pNotification);
tBleStatus EDS_STM_Update_Char(uint16_t UUID, uint8_t *pPayload);
#ifdef __cplusplus
}
#endif
#endif /*__EDS_STM_H */
@@ -0,0 +1,79 @@
/**
******************************************************************************
* @file hids.h
* @author MCD Application Team
* @brief Header for hids.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 __HIDS_H
#define __HIDS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
HIDS_REPORT_NOTIFICATION_ENABLED,
HIDS_REPORT_NOTIFICATION_DISABLED,
HIDS_KEYB_INPUT_NOTIFY_ENABLED,
HIDS_KEYB_INPUT_NOTIFY_DISABLED,
HIDS_MOUSE_INPUT_NOTIFY_ENABLED,
HIDS_MOUSE_INPUT_NOTIFY_DISABLED,
HIDS_OUTPUT_REPORT,
HIDS_KEYBOARD_INPUT_REPORT,
HIDS_KEYBOARD_OUTPUT_REPORT,
HIDS_MOUSE_INPUT_REPORT,
HIDS_CONN_HANDLE_EVT,
HIDS_DISCON_HANDLE_EVT
} HIDS_Opcode_Notification_evt_t;
typedef struct
{
HIDS_Opcode_Notification_evt_t HIDS_Evt_Opcode;
uint8_t Instance;
uint8_t Index;
uint8_t ReportLength;
uint8_t *pReport;
} HIDS_App_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void HIDS_Init(void);
tBleStatus HIDS_Update_Char(uint16_t UUID,
uint8_t service_instance,
uint8_t Report_Index,
uint8_t report_size,
uint8_t *pPayload);
void HIDS_Notification(HIDS_App_Notification_evt_t *pNotification);
#ifdef __cplusplus
}
#endif
#endif /*__HIDS_H */
@@ -0,0 +1,99 @@
/**
******************************************************************************
* @file hrs.h
* @author MCD Application Team
* @brief Header for stm32xx_heartrate.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 __HRS_H
#define __HRS_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
HRS_HRM_VALUE_FORMAT_UINT16 = 1,
HRS_HRM_SENSOR_CONTACTS_PRESENT = 2,
HRS_HRM_SENSOR_CONTACTS_SUPPORTED = 4,
HRS_HRM_ENERGY_EXPENDED_PRESENT = 8,
HRS_HRM_RR_INTERVAL_PRESENT = 0x10
} HRS_HrmFlags_t;
typedef enum
{
HRS_BODY_SENSOR_LOCATION_OTHER = 0,
HRS_BODY_SENSOR_LOCATION_CHEST = 1,
HRS_BODY_SENSOR_LOCATION_WRIST = 2,
HRS_BODY_SENSOR_LOCATION_FINGER = 3,
HRS_BODY_SENSOR_LOCATION_HAND = 4,
HRS_BODY_SENSOR_LOCATION_EAR_LOBE = 5,
HRS_BODY_SENSOR_LOCATION_FOOT = 6
} HRS_BodySensorLocation_t;
typedef enum
{
HRS_RESET_ENERGY_EXPENDED_EVT,
HRS_NOTIFICATION_ENABLED,
HRS_NOTIFICATION_DISABLED,
HRS_STM_BOOT_REQUEST_EVT,
} HRS_NotCode_t;
typedef struct
{
uint8_t * pPayload;
uint8_t Length;
}HRS_Data_t;
typedef struct
{
HRS_NotCode_t HRS_Evt_Opcode;
HRS_Data_t DataTransfered;
uint16_t ConnectionHandle;
uint8_t ServiceInstance;
}HRS_App_Notification_evt_t;
typedef struct{
uint16_t MeasurementValue;
#if (BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG == 1)
uint16_t EnergyExpended;
#endif
#if (BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG != 0)
uint16_t aRRIntervalValues[BLE_CFG_HRS_ENERGY_RR_INTERVAL_FLAG + BLE_CFG_HRS_ENERGY_EXPENDED_INFO_FLAG];
uint8_t NbreOfValidRRIntervalValues;
#endif
uint8_t Flags;
}HRS_MeasVal_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void HRS_Init(void);
tBleStatus HRS_UpdateChar(uint16_t uuid, uint8_t *p_payload);
void HRS_Notification(HRS_App_Notification_evt_t *pNotification);
#ifdef __cplusplus
}
#endif
#endif /*__HRS_H */
+113
View File
@@ -0,0 +1,113 @@
/**
******************************************************************************
* @file hts.h
* @author MCD Application Team
* @brief Header for shst.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 __HTS_H
#define __HTS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
NO_FLAGS = 0,
VALUE_UNIT_FAHRENHEIT = (1<<0),
SENSOR_TIME_STAMP_PRESENT = (1<<1),
SENSOR_TEMPERATURE_TYPE_PRESENT = (1<<2),
} HTS_TM_Flags_t;
typedef enum
{
TT_Armpit = 1,
TT_Body = 2,
TT_Ear = 3,
TT_Finger = 4,
TT_Gastro_intestinal_Tract = 5,
TT_Mouth = 6,
TT_Rectum = 7,
TT_Toe = 8,
TT_Tympanum = 9
} HTS_Temperature_Type_t;
typedef enum
{
HTS_MEASUREMENT_INTERVAL_RECEIVED_EVT,
HTS_MEASUREMENT_IND_ENABLED_EVT,
HTS_MEASUREMENT_IND_DISABLED_EVT,
HTS_MEASUREMENT_INTERVAL_IND_ENABLED_EVT,
HTS_MEASUREMENT_INTERVAL_IND_DISABLED_EVT,
HTS_INTERMEDIATE_TEMPERATURE_NOT_ENABLED_EVT,
HTS_INTERMEDIATE_TEMPERATURE_NOT_DISABLED_EVT,
} HTS_App_Opcode_Notification_evt_t;
typedef struct
{
HTS_App_Opcode_Notification_evt_t HTS_Evt_Opcode;
#if (BLE_CFG_HTS_MEASUREMENT_INTERVAL != 0)
uint16_t RangeInterval;
#endif
}HTS_App_Notification_evt_t;
#if (BLE_CFG_HTS_TIME_STAMP_FLAG != 0)
typedef struct
{
uint16_t Year;
uint8_t Month;
uint8_t Day;
uint8_t Hours;
uint8_t Minutes;
uint8_t Seconds;
}HTS_TimeStamp_t;
#endif
typedef struct
{
uint32_t MeasurementValue;
#if (BLE_CFG_HTS_TIME_STAMP_FLAG != 0)
HTS_TimeStamp_t TimeStamp;
#endif
#if (BLE_CFG_HTS_TEMPERATURE_TYPE_VALUE_STATIC == 0)
HTS_Temperature_Type_t TemperatureType;
#endif
uint8_t Flags;
}HTS_TemperatureValue_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void HTS_Init(void);
tBleStatus HTS_Update_Char(uint16_t UUID,
uint8_t *pPayload);
void HTS_App_Notification(HTS_App_Notification_evt_t * pNotification);
#ifdef __cplusplus
}
#endif
#endif /*__HTS_H */
@@ -0,0 +1,62 @@
/**
******************************************************************************
* @file ias.h
* @author MCD Application Team
* @brief Header for ias.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 __IAS_H
#define __IAS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
IAS_NO_ALERT_EVT,
IAS_MID_ALERT_EVT,
IAS_HIGH_ALERT_EVT
} IAS_App_Opcode_Notification_evt_t;
typedef struct
{
IAS_App_Opcode_Notification_evt_t IAS_Evt_Opcode;
}IAS_App_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void IAS_Init(void);
tBleStatus IAS_Update_Char(uint16_t UUID, uint8_t *pPayload);
void IAS_App_Notification(IAS_App_Notification_evt_t *pNotification);
#ifdef __cplusplus
}
#endif
#endif /*__IAS_H */
@@ -0,0 +1,63 @@
/**
******************************************************************************
* @file lls.h
* @author MCD Application Team
* @brief Header for lls.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 __LLS_H
#define __LLS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
LLS_NO_ALERT_EVT,
LLS_MID_ALERT_EVT,
LLS_HIGH_ALERT_EVT,
LLS_DISCONNECT_EVT,
LLS_CONNECT_EVT
} LLS_App_Opcode_Notification_evt_t;
typedef struct
{
LLS_App_Opcode_Notification_evt_t LLS_Evt_Opcode;
}LLS_App_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void LLS_Init(void);
tBleStatus LLS_Update_Char(uint16_t UUID, uint8_t *pPayload);
void LLS_App_Notification(LLS_App_Notification_evt_t *pNotification);
#ifdef __cplusplus
}
#endif
#endif /*__LLS_H */
@@ -0,0 +1,43 @@
/**
******************************************************************************
* @file mesh.h
* @author MCD Application Team
* @brief Header for mesh.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 __MESH_H
#define __MESH_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void MESH_Init(void);
#ifdef __cplusplus
}
#endif
#endif /*__MESH_H */
@@ -0,0 +1,177 @@
/**
******************************************************************************
* @file motenv_stm.h
* @author SRA/AST
* @brief Header for motenv_stm.c module
******************************************************************************
* @attention
*
* Copyright (c) 2018-2024 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,
HW_TOF_NOTIFY_ENABLED_EVT,
HW_TOF_NOTIFY_DISABLED_EVT,
HW_TOF_WRITE_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,
MOTENV_STM_BOOT_REQUEST_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 --------------------------------------------------------*/
/* Exported Variables ------------------------------------------------------- */
extern uint8_t ToF_BoardPresent;
/* 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 ToF Char shortened UUID
*/
#define TOF_CHAR_UUID (0x0000)
/**
* @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 */
@@ -0,0 +1,108 @@
/**
******************************************************************************
* @file otas_stm.h
* @author MCD Application Team
* @brief Interface to OTA BLE service
******************************************************************************
* @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 __OTAS_STM_H
#define __OTAS_STM_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32_wpan_common.h"
/* Exported defines -----------------------------------------------------------*/
#define OTAS_STM_RAW_DATA_SIZE (248)
/* Exported types ------------------------------------------------------------*/
typedef enum
{
OTAS_STM_BASE_ADDR_ID,
OTAS_STM_RAW_DATA_ID,
OTAS_STM_CONF_ID,
OTAS_STM_CONF_EVENT_ID,
} OTAS_STM_ChardId_t;
typedef enum
{
OTAS_STM_STOP_ALL_UPLOAD = 0x00,
OTAS_STM_WIRELESS_FW_UPLOAD = 0x01,
OTAS_STM_APPLICATION_UPLOAD = 0x02,
OTAS_STM_UPLOAD_FINISHED = 0x07,
OTAS_STM_CANCEL_UPLOAD = 0x08,
} OTAS_STM_Command_t;
typedef enum
{
OTAS_STM_REBOOT_CONFIRMED = 0x01,
} OTAS_STM_Indication_Msg_t;
typedef struct{
uint8_t *pPayload;
OTAS_STM_ChardId_t ChardId;
uint8_t ValueLength;
} OTA_STM_Notification_t;
typedef PACKED_STRUCT{
OTAS_STM_Command_t Command; /**< [0:7] */
uint8_t Base_Addr[3]; /**< [8:31] */
} OTA_STM_Base_Addr_Event_Format_t;
typedef PACKED_STRUCT{
uint8_t Raw_Data[OTAS_STM_RAW_DATA_SIZE];
} OTA_STM_Raw_Data_Event_Format_t;
typedef PACKED_STRUCT{
aci_gatt_server_confirmation_event_rp0 Conf_Event;
} OTA_STM_Conf_Event_Format_t;
typedef PACKED_STRUCT{
OTAS_STM_Indication_Msg_t Conf_Msg;
} OTA_STM_Conf_Char_Format_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void OTAS_STM_Notification( OTA_STM_Notification_t *p_notification );
/**
* @brief Service initialization
* @param None
* @retval None
*/
void OTAS_STM_Init(void);
/**
* @brief Characteristic update
* @param ChardId: Id of the characteristic to be written
* @param p_payload: The new value to be written
* @retval Command status
*/
tBleStatus OTAS_STM_UpdateChar(OTAS_STM_ChardId_t ChardId, uint8_t *p_payload);
#ifdef __cplusplus
}
#endif
#endif /*__OTAS_STM_H */
@@ -0,0 +1,73 @@
/**
******************************************************************************
* @file p2p_stm.h
* @author MCD Application Team
* @brief Header for p2p_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 __P2PS_STM_H
#define __P2PS_STM_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
P2PS_STM__NOTIFY_ENABLED_EVT,
P2PS_STM_NOTIFY_DISABLED_EVT,
P2PS_STM_READ_EVT,
P2PS_STM_WRITE_EVT,
P2PS_STM_BOOT_REQUEST_EVT,
} P2PS_STM_Opcode_evt_t;
typedef struct
{
uint8_t * pPayload;
uint8_t Length;
}P2PS_STM_Data_t;
typedef struct
{
P2PS_STM_Opcode_evt_t P2P_Evt_Opcode;
P2PS_STM_Data_t DataTransfered;
uint16_t ConnectionHandle;
uint8_t ServiceInstance;
}P2PS_STM_App_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void P2PS_STM_Init( void );
void P2PS_STM_App_Notification(P2PS_STM_App_Notification_evt_t *pNotification);
tBleStatus P2PS_STM_App_Update_Char(uint16_t UUID, uint8_t *pPayload);
#ifdef __cplusplus
}
#endif
#endif /*__P2PS_STM_H */
@@ -0,0 +1,171 @@
/**
******************************************************************************
* @file svc_ctl.h
* @author MCD Application Team
* @brief Header for ble_controller.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.
*
******************************************************************************
*/
/**
* The BLE Controller supports the application to handle services and clients.
* It provides an API to initialize the BLE core Device and a handler mechanism to rout the GATT/GAP events to the
* application. When the ble_controller is used (recommended), the application shall register a callback for each
* Service and each Client implemented. This is already done with the Services and Clients provided in that delivery.
* + A GATT event is relevant to only one Service and/or one Client. When a GATT event is received, it is notified to
* the registered handlers to the BLE controller. When no registered handler acknowledges positively the GATT event,
* it is reported to the application.
* + A GAP event is not relevant to either a Service or a Client. It is sent to the application
* + In case the application does not want to take benefit from the ble_controller, it could bypass it. In that case,
* the application shall:
* - call SVCCTL_Init() to initialize the BLE core device (or implement on its own what is inside that function
* - implement TLHCI_UserEvtRx() which is the notification from the HCI layer to report all events (GATT/GAP).
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __SVCCTL_H
#define __SVCCTL_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
SVCCTL_EvtNotAck,
SVCCTL_EvtAckFlowEnable,
SVCCTL_EvtAckFlowDisable,
} SVCCTL_EvtAckStatus_t;
typedef enum
{
SVCCTL_UserEvtFlowDisable,
SVCCTL_UserEvtFlowEnable,
} SVCCTL_UserEvtFlowStatus_t;
typedef SVCCTL_EvtAckStatus_t (*SVC_CTL_p_EvtHandler_t)(void *p_evt);
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
/**
* @brief It initializes the BLE core Driver and sends some commands to initialize the BLE core device
* It shall be called before any BLE operation
*
* @param None
* @retval None
*/
void SVCCTL_Init( void );
/**
* @brief This API registers a handler to be called when a GATT user event is received from the BLE core device. When
* a Service is created, it shall register a callback to be notified when a GATT event is received from the
* BLE core device. When a GATT event is received, it shall be checked in the handler if the GATT events belongs
* to the Service or not. The handler shall return the correct status depending on the result. As soon as one
* Service handler registered acknowledges positively the GATT event, the ble_controller stops calling the
* registered Service handlers.
* This handler is called in the TL_BLE_HCI_UserEvtProc() context
*
* @param pfBLE_SVC_Service_Event_Handler: This is the Service handler that the ble_controller calls to report a GATT
* event received. If the GATT event belongs to that Service, the callback shall return positively with
* SVCCTL_EvtAckFlowEnable.
* @retval None
*/
void SVCCTL_RegisterSvcHandler( SVC_CTL_p_EvtHandler_t pfBLE_SVC_Service_Event_Handler );
/**
* @brief This API registers a handler to be called when a GATT user event is received from the BLE core device. When
* a Client is created, it shall register a callback to be notified when a GATT event is received from the
* BLE core device. When a GATT event is received, it shall be checked in the handler if the GATT events belongs
* to the Client or not. The handler shall return the correct status depending on the result. As soon as one
* Client handler registered acknowledges positively the GATT event, the ble_controller stops calling the
* registered Client handlers.
* This handler is called in the TL_BLE_HCI_UserEvtProc() context
*
* @param pfBLE_SVC_Client_Event_Handler: This is the Client handler that the ble_controller calls to report a GATT
* event received. If the GATT event belongs to that Client, the callback shall return positively with
* SVCCTL_EvtAckFlowEnable.
* @retval None
*/
void SVCCTL_RegisterCltHandler( SVC_CTL_p_EvtHandler_t pfBLE_SVC_Client_Event_Handler );
/**
* @brief This API is used to resume the User Event Flow that has been stopped in return of SVCCTL_UserEvtRx()
*
* @param None
* @retval None
*/
void SVCCTL_ResumeUserEventFlow( void );
/**
* @brief This callback is triggered when either
* + a GAP event is received from the BLE core device.
* + a GATT event that has not been positively acknowledged by the registered handler is received from the
* BLE core device.
* The event is returned in a HCI packet. The full HCI packet is stored in a single buffer and is available when
* this callback is triggered. However, an ACI event may be longer than a HCI packet and could be fragmented over
* several HCI packets. The HCI layer only handles HCI packets so when an ACI packet is split over several HCI
* packets, this callback is triggered for each HCI fragment. It is the responsibility of the application to
* reassemble the ACI event.
* This callback is triggered in the TL_BLE_HCI_UserEvtProc() context
*
* @param pckt: The user event received from the BLE core device
* @retval None
*/
SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification( void *pckt );
/**
* @brief
*
*
* @param pckt: The user event received from the BLE core device
* @retval SVCCTL_UserEvtFlowStatus_t: SVCCTL_UserEvtFlowEnable when the packet has been processed
* SVCCTL_UserEvtFlowDisable otherwise (the packet is kept in the queue)
*/
SVCCTL_UserEvtFlowStatus_t SVCCTL_UserEvtRx( void *pckt );
/**
* @brief This API may be used by the application when the Service Controller is used to add a custom service
*
*
* @param None
* @retval None
*/
void SVCCTL_InitCustomSvc( void );
/**
* @brief This API may be overloaded by the application to select a limited list of ble services to initialize.
* It is called by SVCCTL_Init()
* By default, SVCCTL_SvcInit() is implemented to initialize all BLE services which are included in the
* application at build time
* If it is required to initialize only limited part of the BLE service available in the application,
* this API may be used to call the initialization API of the subset of needed services at run time.
*
* @param None
* @retval None
*/
void SVCCTL_SvcInit( void );
#ifdef __cplusplus
}
#endif
#endif /*__SVCCTL_H */
@@ -0,0 +1,73 @@
/**
******************************************************************************
* @file template_stm.h
* @author MCD Application Team
* @brief Header for template_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 __TEMPLATE_STM_H
#define __TEMPLATE_STM_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
TEMPLATE_STM_NOTIFY_ENABLED_EVT,
TEMPLATE_STM_NOTIFY_DISABLED_EVT,
TEMPLATE_STM_READ_EVT,
TEMPLATE_STM_WRITE_EVT,
TEMPLATE_STM_BOOT_REQUEST_EVT,
} TEMPLATE_STM_Opcode_evt_t;
typedef struct
{
uint8_t * pPayload;
uint8_t Length;
}TEMPLATE_STM_Data_t;
typedef struct
{
TEMPLATE_STM_Opcode_evt_t Template_Evt_Opcode;
TEMPLATE_STM_Data_t DataTransfered;
uint16_t ConnectionHandle;
uint8_t ServiceInstance;
}TEMPLATE_STM_App_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void TEMPLATE_STM_Init( void );
void TEMPLATE_STM_App_Notification(TEMPLATE_STM_App_Notification_evt_t *pNotification);
tBleStatus TEMPLATE_STM_App_Update_Char(uint16_t UUID, uint8_t *pPayload);
#ifdef __cplusplus
}
#endif
#endif /*__TEMPLATE_STM_H */
@@ -0,0 +1,46 @@
/**
******************************************************************************
* @file tps.h
* @author MCD Application Team
* @brief Header for tps.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 __TPS_H
#define __TPS_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void TPS_Init(void);
tBleStatus TPS_Update_Char(uint16_t UUID, uint8_t *pPayload);
#ifdef __cplusplus
}
#endif
#endif /*__TPS_H */
@@ -0,0 +1,328 @@
/**
******************************************************************************
* @file uuid.h.h
* @author MCD Application Team
* @brief Header containing the UUIDs of all the services and caharcteristics
******************************************************************************
* @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.
*
******************************************************************************
*/
#ifndef _UUID_H_
#define _UUID_H_
/* Descriptor UUIDs */
#define CHAR_EXTENDED_PROPERTIES_DESCRIPTOR_UUID (0x2900)
#define CHAR_USER_DESCRIPTION_DESCRIPTOR_UUID (0x2901)
#define CLIENT_CHAR_CONFIG_DESCRIPTOR_UUID (0x2902)
#define SERVER_CHAR_CONFIG_DESCRIPTOR_UUID (0x2903)
#define CHAR_PRESENTATION_FORMAT_DESCRIPTOR_UUID (0x2904)
#define CHAR_AGGREGATE_FORMAT_DESCRIPTOR_UUID (0x2905)
#define VALID_RANGE_DESCRIPTOR_UUID (0x2906)
#define EXTERNAL_REPORT_REFERENCE_DESCRIPTOR_UUID (0x2907)
#define REPORT_REFERENCE_DESCRIPTOR_UUID (0x2908)
#define NUMBER_OF_DIGITALS_DESCRIPTOR_UUID (0x2909)
#define VALUE_TRIGGER_SETTING_DESCRIPTOR_UUID (0x290A)
#define ES_CONFIGURATION_DESCRIPTOR_UUID (0x290B)
#define ES_MEASUREMENT_DESCRIPTOR_UUID (0x290C)
#define ES_TRIGGER_SETTING_DESCRIPTOR_UUID (0x290D)
#define TIME_TRIGGER_SETTING_DESCRIPTOR_UUID (0x290E)
/* UUIDs of Generic Attribute service */
#define GENERIC_ATTRIBUTE_SERVICE_UUID (0x1801)
#define SERVICE_CHANGED_CHARACTERISTIC_UUID (0x2A05)
/* UUIDs of immediate alert service */
#define IMMEDIATE_ALERT_SERVICE_UUID (0x1802)
#define ALERT_LEVEL_CHARACTERISTIC_UUID (0x2A06)
/* UUIDs for Link Loss service */
#define LINK_LOSS_SERVICE_UUID (0x1803)
#define LINK_LOSS_ALERT_LEVEL_CHARACTERISTIC_UUID (0x2A06)
/* UUIDs for TX Power service */
#define TX_POWER_SERVICE_UUID (0x1804)
#define TX_POWER_LEVEL_CHARACTERISTIC_UUID (0x2A07)
/* UUIDs for Time service */
#define CURRENT_TIME_SERVICE_UUID (0x1805)
#define CURRENT_TIME_CHAR_UUID (0x2A2B)
#define LOCAL_TIME_INFORMATION_CHAR_UUID (0x2A0F)
#define REFERENCE_TIME_INFORMATION_CHAR_UUID (0x2A14)
/* UUIDs for Reference Time Update service */
#define REFERENCE_UPDATE_TIME_SERVICE_UUID (0x1806)
#define TIME_UPDATE_CONTROL_POINT_CHAR_UUID (0x2A16)
#define TIME_UPDATE_STATE_CHAR_UUID (0x2A17)
/* UUIDs for Next DST Change service */
#define NEXT_DST_CHANGE_SERVICE_UUID (0x1807)
#define TIME_WITH_DST_CHAR_UUID (0x2A11)
/* UUIDs for glucose profile */
#define GLUCOSE_SERVICE_UUID (0x1808)
#define GLUCOSE_MEASUREMENT_CHAR_UUID (0x2A18)
#define GLUCOSE_MEASUREMENT_CONTEXT_CHAR_UUID (0x2A34)
#define GLUCOSE_FEATURE_CHAR_UUID (0x2A51)
/* Record Access Control Point (RACP) */
#define GLUCOSE_RACP_CHAR_UUID (0x2A52)
/* UUIDs for health thermometer profile */
#define HEALTH_THERMOMETER_SERVICE_UUID (0x1809)
#define TEMPERATURE_MEASUREMENT_CHAR_UUID (0x2A1C)
#define TEMPERATURE_TYPE_CHAR_UUID (0x2A1D)
#define INTERMEDIATE_TEMPERATURE_CHAR_UUID (0x2A1E)
#define MEASUREMENT_INTERVAL_CHAR_UUID (0x2A21)
/* UUIDs for Device Information Service */
#define DEVICE_INFORMATION_SERVICE_UUID (0x180A)
#define SYSTEM_ID_UUID (0x2A23)
#define MODEL_NUMBER_UUID (0x2A24)
#define SERIAL_NUMBER_UUID (0x2A25)
#define FIRMWARE_REVISION_UUID (0x2A26)
#define HARDWARE_REVISION_UUID (0x2A27)
#define SOFTWARE_REVISION_UUID (0x2A28)
#define MANUFACTURER_NAME_UUID (0x2A29)
#define IEEE_CERTIFICATION_UUID (0x2A2A)
#define PNP_ID_UUID (0x2A50)
/* UUIDs for Heart Rate Service */
#define HEART_RATE_SERVICE_UUID (0x180D)
#define CLIENT_CHARACTERISTIC_CONFIG_DESCRIPTOR_UUID (0x2902)
#define HEART_RATE_MEASURMENT_UUID (0x2A37)
#define SENSOR_LOCATION_UUID (0x2A38)
#define CONTROL_POINT_UUID (0x2A39)
/* UUIDs for Phone Alert status profile */
#define PHONE_ALERT_SERVICE_UUID (0x180E)
#define PHONE_ALERT_STATUS_CHARAC_UUID (0x2A3F)
#define RINGER_CNTRL_POINT_CHARAC_UUID (0x2A40)
#define RINGER_SETTING_CHARAC_UUID (0x2A41)
/* UUIDs for battery service */
#define BATTERY_SERVICE_UUID (0x180F)
#define BATTERY_LEVEL_CHAR_UUID (0x2A19)
/* UUIDs for Blood Pressure profile */
#define BLOOD_PRESSURE_SERVICE_UUID (0x1810)
#define BLOOD_PRESSURE_MEASUREMENT_CHAR_UUID (0x2A35)
#define INTERMEDIATE_CUFF_PRESSURE_CHAR_UUID (0x2A36)
#define BLOOD_PRESSURE_FEATURE_CHAR_UUID (0x2A49)
/* UUIDs for alert notification profile */
#define ALERT_NOTIFICATION_SERVICE_UUID (0x1811)
#define SUPPORTED_NEW_ALERT_CATEGORY_CHAR_UUID (0x2A47)
#define NEW_ALERT_CHAR_UUID (0x2A46)
#define SUPPORTED_UNREAD_ALERT_CATEGORY_CHAR_UUID (0x2A48)
#define UNREAD_ALERT_STATUS_CHAR_UUID (0x2A45)
#define ALERT_NOTIFICATION_CONTROL_POINT_CHAR_UUID (0x2A44)
/* UUIDs for human interface device */
#define HUMAN_INTERFACE_DEVICE_SERVICE_UUID (0x1812)
#define PROTOCOL_MODE_CHAR_UUID (0x2A4E)
#define REPORT_CHAR_UUID (0x2A4D)
#define REPORT_MAP_CHAR_UUID (0x2A4B)
#define BOOT_KEYBOARD_INPUT_REPORT_CHAR_UUID (0x2A22)
#define BOOT_KEYBOARD_OUTPUT_REPORT_CHAR_UUID (0x2A32)
#define BOOT_MOUSE_INPUT_REPORT_CHAR_UUID (0x2A33)
#define HID_INFORMATION_CHAR_UUID (0x2A4A)
#define HID_CONTROL_POINT_CHAR_UUID (0x2A4C)
/* UUIDs for scan parameter service */
#define SCAN_PARAMETER_SERVICE_UUID (0x1813)
#define SCAN_INTERVAL_WINDOW_CHAR_UUID (0x2A4F)
#define SCAN_REFRESH_CHAR_UUID (0x2A31)
/* UUIDs for running speed and cadence service */
#define RUNNING_SPEED_CADENCE_SERVICE_UUID (0x1814)
#define RUNNING_SPEED_CADENCE_MEASUREMENT_CHAR_UUID (0x2A53)
#define RUNNING_SPEED_CADENCE_FEATURE_CHAR_UUID (0x2A54)
/* UUIDs for automation IO service */
#define AUTOMATION_IO_SERVICE_UUID (0x1815)
#define AUTOMATION_IO_DIGITAL_CHAR_UUID (0x2A56)
#define AUTOMATION_IO_ANALOG_CHAR_UUID (0x2A58)
#define AUTOMATION_IO_AGGREGATE_CHAR_UUID (0x2A5A)
/* UUIDs for cycling speed and cadence service */
#define CYCLING_SPEED_CADENCE_SERVICE_UUID (0x1816)
#define CYCLING_SPEED_CADENCE_MEASUREMENT_CHAR_UUID (0x2A5B)
#define CYCLING_SPEED_CADENCE_FEATURE_CHAR_UUID (0x2A5C)
/* UUIDs for cycling power service */
#define CYCLING_POWER_SERVICE_UUID (0x1818)
#define CYCLING_POWER_MEASUREMENT_CHAR_UUID (0x2A63)
#define CYCLING_POWER_FEATURE_CHAR_UUID (0x2A65)
#define CYCLING_POWER_SENSOR_LOCATION_CHAR_UUID (0x2A5D)
/* UUIDs for location and navigation device */
#define LOCATION_NAVIGATION_SERVICE_UUID (0x1819)
#define LN_FEATURE_UUID (0x2A6A)
#define LOCATION_SPEED_UUID (0x2A67)
#define POSITION_QUALITY_UUID (0x2A69)
#define LN_CONTROL_POINT_UUID (0x2A6B)
#define NAVIGATION_UUID (0x2A68)
/* UUIDs for environmental sensing profile */
#define ENVIRONMENTAL_SENSING_SERVICE_UUID (0x181A)
#define DESCRIPTOR_VALUE_CHANGED_UUID (0x2A7D)
#define APPARENT_WIND_DIRECTION_UUID (0x2A73)
#define APPARENT_WIND_SPEED_UUID (0x2A72)
#define DEW_POINT_UUID (0x2A7B)
#define ELEVATION_UUID (0x2A6C)
#define GUST_FACTOR_UUID (0x2A74)
#define HEAT_INDEX_UUID (0x2A7A)
#define HUMIDITY_UUID (0x2A6F)
#define IRRADIANCE_UUID (0x2A77)
#define POLLEN_CONCENTRATION_UUID (0x2A75)
#define RAINFALL_UUID (0x2A78)
#define PRESSURE_UUID (0x2A6D)
#define TEMPERATURE_UUID (0x2A6E)
#define TRUE_WIND_DIRECTION_UUID (0x2A71)
#define TRUE_WIND_SPEED_UUID (0x2A70)
#define UV_INDEX_UUID (0x2A76)
#define WIND_CHILL_UUID (0x2A79)
#define BAROMETRIC_PRESSURE_TREND_UUID (0x2AA3)
#define MAGNETIC_DECLINATION_UUID (0x2A2C)
#define MAGNETIC_FLUX_DENSITY_2D_UUID (0x2AA0)
#define MAGNETIC_FLUX_DENSITY_3D_UUID (0x2AA1)
/* UUIDs for body composition service */
#define BODY_COMPOSITION_SERVICE_UUID (0x181B)
#define BODY_COMPOSITION_MEASUREMENT_CHAR_UUID (0x2A9C)
#define BODY_COMPOSITION_FEATURE_CHARAC (0x2A9B)
/* UUIDs for user data service */
#define USER_DATA_SERVICE_UUID (0x181C)
#define AERO_HR_LOWER_LIMIT_CHAR_UUID (0x2A7E)
#define AEROBIC_THRESHOLD_CHAR_UUID (0x2A7F)
#define AGE_CHAR_UUID (0x2A80)
#define ANAERO_HR_LOWER_LIMIT_CHAR_UUID (0x2A81)
#define ANAERO_HR_UPPER_LIMIT_CHAR_UUID (0x2A82)
#define ANAEROBIC_THRESHOLD_CHAR_UUID (0x2A83)
#define AERO_HR_UPPER_LIMIT_CHAR_UUID (0x2A84)
#define BIRTH_DATE_CHAR_UUID (0x2A85)
#define DATE_THRESHOLD_ASSESSMENT_CHAR_UUID (0x2A86)
#define EMAIL_ADDRESS_CHAR_UUID (0x2A87)
#define FAT_BURN_HR_LOWER_LIMIT_CHAR_UUID (0x2A88)
#define FAT_BURN_HR_UPPER_LIMIT_CHAR_UUID (0x2A89)
#define FIRST_NAME_CHAR_UUID (0x2A8A)
#define FIVE_ZONE_HR_LIMIT_CHAR_UUID (0x2A8B)
#define GENDER_CHAR_UUID (0x2A8C)
#define HEART_RATE_MAX_CHAR_UUID (0x2A8D)
#define HEIGHT_CHAR_UUID (0x2A8E)
#define HIP_CIRC_CHAR_UUID (0x2A8F)
#define LAST_NAME_CHAR_UUID (0x2A90)
#define MAX_RECO_HEART_RATE_CHAR_UUID (0x2A91)
#define RESTING_HEART_RATE_CHAR_UUID (0x2A92)
#define SPORT_TYPE_CHAR_UUID (0x2A93)
#define THREE_ZONE_HR_LIMIT_CHAR_UUID (0x2A94)
#define TWO_ZONE_HR_LIMIT_CHAR_UUID (0x2A95)
#define VO2_MAX_CHAR_UUID (0x2A96)
#define WAIST_CIRC_CHAR_UUID (0x2A97)
#define WEIGHT_CHAR_UUID (0x2A98)
#define DATABASE_CHANGE_INCREMENT_CHAR_UUID (0x2A99)
#define USER_INDEX_CHAR_UUID (0x2A9A)
#define USER_CONTROL_POINT_CHAR_UUID (0x2A9F)
#define LANGUAGE_CHAR_UUID (0x2AA2)
/* UUIDs for weight scale profile */
#define WEIGHT_SCALE_SERVICE_UUID (0x181D)
#define WEIGHT_SCALE_MEASUREMENT_CHAR_UUID (0x2A9D)
#define WEIGHT_SCALE_FEATURE_CHAR_UUID (0x2A9E)
/* UUIDs for weight scale profile */
#define BOND_MANAGEMENT_SERVICE_UUID (0x181E)
#define BM_CONTROL_POINT_CHAR_UUID (0x2AA4)
#define BM_FEATURE_CHAR_UUID (0x2AA5)
/* UUIDs for Internet Support Service */
#define INTERNET_SUPPORT_SERVICE_UUID (0x1820)
/* UUIDs for Indoor Positioning Service */
#define INDOOR_POSITIONING_SERVICE_UUID (0x1821)
#define IP_CONFIGURATION_CHAR_UUID (0x2AAD)
#define IP_LATITUDE_CHAR_UUID (0x2AAE)
#define IP_LONGITUDE_CHAR_UUID (0x2AAF)
/* UUIDs for HTTP proxy Service */
#define HTTP_PROXY_SERVICE_UUID (0x1823)
#define HTTP_URI_CHAR_UUID (0x2AB6)
#define HTTP_HEADERS_CHAR_UUID (0x2AB7)
#define HTTP_STATUS_CODE_CHAR_UUID (0x2AB8)
#define HTTP_ENTITY_BODY_CHAR_UUID (0x2AB9)
#define HTTP_CONTROL_POINT_CHAR_UUID (0x2ABA)
#define HTTP_SECURITY_CHAR_UUID (0x2ABB)
/* UUIDs for Object Transfer Service */
#define OBJECT_TRANSFER_SERVICE_UUID (0x1825)
#define OTS_FEATURE_CHAR_UUID (0x2ABD)
#define OBJECT_NAME_CHAR_UUID (0x2ABE)
#define OBJECT_TYPE_CHAR_UUID (0x2ABF)
#define OBJECT_SIZE_CHAR_UUID (0x2AC0)
#define OBJECT_PROPERTIES_CHAR_UUID (0x2AC4)
#define OBJECT_ACTION_CONTROL_POINT_CHAR_UUID (0x2AC5)
#define OBJECT_LIST_CONTROL_POINT_CHAR_UUID (0x2AC6)
/* UUIDs for Zigbee Direct Service */
#define ZIGBEE_DIRECT_COMM_SERVICE_UUID (0xFFF7)
/* Custom Services*/
/* UUIDs for data transfer service */
#define DT_SERVICE_UUID (0xFE80)
#define DT_TX_CHAR_UUID (0xFE81)
#define DT_RX_CHAR_UUID (0xFE82)
#define DT_THROUGHPUT_CHAR_UUID (0xFE83)
/* UUIDs for custom battery service */
#define CUSTOM_BATTERY_SERVICE_UUID (0xF2F0)
#define CUSTOM_BATTERY_LEVEL_CHAR_UUID (0xF2F1)
/* Custom Services*/
/* UUIDs for data transfer service */
#define LED_BUTTON_SERVICE_UUID (0x1A30)
#define LED_CHAR_UUID (0x2B50)
#define BUTTON_CHAR_UUID (0x2B51)
/*UUIDs for End Device Management Service*/
#define END_DEVICE_MGT_SERVICE_UUID (0x1A40)
#define END_DEVICE_STATUS_CHAR_UUID (0x2B60)
#define P2P_SERVICE_UUID (0xFE40)
#define P2P_WRITE_CHAR_UUID (0xFE41)
#define P2P_NOTIFY_CHAR_UUID (0xFE42)
#define HOME_SERVICE_UUID (0xFE90)
#define HOME_WRITE_CHAR_UUID (0xFE91)
#define HOME_NOTIFY_CHAR_UUID (0xFE92)
#define CAM_SERVICE_UUID (0xFEA0)
#define CAM_WRITE_CHAR_UUID (0xFEA1)
#define CAM_NOTIFY_CHAR_UUID (0xFEA2)
/* UUIDs for Cable Replacement Service */
#define CRS_SERVICE_UUID (0xFE60)
#define CRS_TX_CHAR_UUID (0xFE61)
#define CRS_RX_CHAR_UUID (0xFE62)
/* UUIDs for Apple Notification Center Service */
#define ANCS_SERVICE_UUID (0xF431)
#define ANCS_NOTIFICATION_SOURCE_CHAR_UUID (0x120D)
#define ANCS_CONTROL_POINT_CHAR_UUID (0xD8F3)
#define ANCS_DATA_SOURCE_CHAR_UUID (0xC6E9)
/* UUIDs for Apple Media Service start from iOS 8*/
#define AMS_SERVICE_UUID (0x502B)
#define AMS_REMOTE_COMMAND_CHAR_UUID (0x81D8)
#define AMS_ENTITY_UPDATE_CHAR_UUID (0xABCE)
#define AMS_ENTITY_ATTRIBUTE_CHAR_UUID (0xF38C)
#endif /* _UUID_H_ */
@@ -0,0 +1,100 @@
/**
******************************************************************************
* @file zdd_stm.h
* @author MCD Application Team
* @brief Header for zdd_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 __ZDD_STM_H
#define __ZDD_STM_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum
{
/* ZDD P2P Events */
ZDD_P2P_STM__NOTIFY_ENABLED_EVT,
ZDD_P2P_STM_NOTIFY_DISABLED_EVT,
ZDD_P2P_STM_READ_EVT,
ZDD_P2P_STM_WRITE_EVT,
ZDD_P2P_STM_BOOT_REQUEST_EVT,
/* ZDD Security Events */
ZDD_SEC_P_256_INDICATE_ENABLED_EVT,
ZDD_SEC_P_256_INDICATE_DISABLED_EVT,
ZDD_SEC_P_256_WRITE_EVT,
ZDD_SEC_CURVE25519_INDICATE_ENABLED_EVT,
ZDD_SEC_CURVE25519_INDICATE_DISABLED_EVT,
ZDD_SEC_CURVE25519_WRITE_EVT,
/* ZDD Commissioning Events */
ZDD_COMM_FORM_NWK_WRITE_EVT,
ZDD_COMM_JOIN_NWK_WRITE_EVT,
ZDD_COMM_PERMIT_JOIN_WRITE_EVT,
ZDD_COMM_LEAVE_NWK_WRITE_EVT,
ZDD_COMM_STATUS_NOTIFY_ENABLED_EVT,
ZDD_COMM_STATUS_NOTIFY_DISABLED_EVT,
ZDD_COMM_STATUS_READ_EVT,
/* ZDD Tunnelling Events */
ZDD_TUNN_ZDTS_NPDU_INDICATE_ENABLED_EVT,
ZDD_TUNN_ZDTS_NPDU_INDICATE_DISABLED_EVT,
ZDD_TUNN_ZDTS_NPDU_WRITE_EVT
} ZDD_STM_Opcode_evt_t;
typedef struct
{
uint8_t * pPayload;
uint8_t Length;
}ZDD_STM_Data_t;
typedef struct
{
ZDD_STM_Opcode_evt_t ZDD_Evt_Opcode;
ZDD_STM_Data_t DataTransfered;
uint16_t ConnectionHandle;
uint8_t ServiceInstance;
}ZDD_STM_App_Notification_evt_t;
/* Exported constants --------------------------------------------------------*/
#define ZDD_P2P_NOTIFY_CHAR_UUID P2P_NOTIFY_CHAR_UUID /* Temp */
#define ZDD_SEC_P_256_CHAR_UUID (0xAF42) /* P-256 */
#define ZDD_SEC_CURVE25519_CHAR_UUID (0xAF43) /* Curve25519 */
#define ZDD_COMM_STATUS_CHAR_UUID (0x377D) /* Commissioning Status */
#define ZDD_TUNN_ZDTS_NPDU_CHAR_UUID (0x78FD) /* ZDTS-NPDU */
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void ZDD_STM_Init( void );
void ZDD_STM_App_Notification(ZDD_STM_App_Notification_evt_t *pNotification);
tBleStatus ZDD_STM_App_Update_Char(uint16_t UUID, uint8_t payloadLen, uint8_t *pPayload);
#ifdef __cplusplus
}
#endif
#endif /*__ZDD_STM_H */