Welcome to mirror list, hosted at ThFree Co, Russian Federation.

appli_sensor.h « app « STM32_WPAN « BLE_MeshLightingPRFNode « BLE « Applications « P-NUCLEO-WB55.USBDongle « Projects - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d608f35e6e93a7ecd79dfd7def8bc473e1cd20a6 (plain)
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
/**
  ******************************************************************************
  * @file    appli_sensor.h
  * @author  BLE Mesh Team
  * @brief   Application interface for Light Mesh Model
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under Ultimate Liberty license
  * SLA0044, the "License"; You may not use this file except in compliance with
  * the License. You may obtain a copy of the License at:
  *                             www.st.com/SLA0044
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __APPLI_SENSOR_H
#define __APPLI_SENSOR_H

/* Includes ------------------------------------------------------------------*/
#include "types.h"

/* Exported macro ------------------------------------------------------------*/

#define CONTROLLER_WAIT_TIME            1000

/* Exported variables  -------------------------------------------------------*/
/* Exported Functions Prototypes ---------------------------------------------*/
/* Application variables------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/

/* Sensor Cadence set */
#pragma pack(1)
typedef struct
{
  MOBLEUINT16 Prop_ID;
  MOBLEUINT16 PositiveTolerance;
  MOBLEUINT16 NegativeTolerance;
  MOBLEUINT8 SamplingFunction;
  MOBLEUINT8 MeasurementPeriod;
  MOBLEUINT8 UpdateInterval; 
}Appli_Sensor_DescriptorStatus_t;

/* Sensor Setting set */
typedef struct 
{
  MOBLEUINT16 Property_ID; 
  MOBLEUINT16 Sensor_Setting_ID; 
  MOBLEUINT8 Sensor_Setting_Access;
  MOBLEUINT16 Sensor_Setting_Value;
}Appli_Sensor_SettingSet_t;


/* structure of flags used for publishing data */
typedef struct 
{
  MOBLEBOOL CadenceDurationFlag ;
  MOBLEBOOL DeltaDataFlag ;
}PublishingDataFlag_t;

/* structure for the cadence set */
typedef struct 
{
  MOBLEUINT16 Property_ID; 
  MOBLEUINT8 FastCadenceDevisor;
  MOBLEUINT8 StatusTriggerType; 
  MOBLEUINT8 triggerDeltaDown;
  MOBLEUINT8 triggerDeltaUp;
  MOBLEUINT8 StatusMinInterval; 
  float FastCadenceLow;
  float FastCadenceHigh;
}Sensor_CadenceSet_t;
#pragma pack(4)

MOBLE_RESULT Appli_Sensor_Cadence_Set(Sensor_CadenceParam_t* pCadence_param, MOBLEUINT16 property_ID,
                                                                           MOBLEUINT32 length); 
MOBLE_RESULT Appli_Sensor_Data_Status(MOBLEUINT8* sensor_Data , MOBLEUINT32* pLength, 
                                              MOBLEUINT16 prop_ID , MOBLEUINT32 length);
MOBLE_RESULT Appli_Sensor_Descriptor_Status(MOBLEUINT8* sensor_Discriptor , 
                                                           MOBLEUINT32* pLength);
MOBLE_RESULT Appli_Sensor_Setting_Set(Sensor_SettingParam_t* pSensor_SettingParam,
                                                           MOBLEUINT8 OptionalValid);                                      

void Sensor_Publication_Process(float* , MODEL_Property_IDTableParam_t*);
void SensorDataPublish(MOBLEUINT32 * , MOBLEUINT16*);
void Read_Sensor_Data(float *);
MOBLE_RESULT Check_Property_ID(const MODEL_Property_IDTableParam_t prop_ID_Table[] 
                                                         , MOBLEUINT16 prop_ID);

MOBLE_RESULT Appli_Sensor_GetSettingStatus(MOBLEUINT8* pSetting_Status);
MOBLE_RESULT Appli_Sensor_GetSetting_IDStatus(MOBLEUINT8* pSetting_Status);
MOBLE_RESULT Appli_Sensor_Init(void); 
void Sensor_Process(void);
void Sensor_LC_Light_Publish(void);

#endif /* __APPLI_SENSOR_H */

/******************* (C) COPYRIGHT 2019 STMicroelectronics *****END OF FILE****/