wip no good for bring up test
This commit is contained in:
parent
89000483ec
commit
00e47ea0ce
|
@ -722,7 +722,7 @@ uint32_t STS_Get_Date_Time_Stamp(void);//uint32_t *time_stamp, uint8_t *datetime
|
|||
void STS_SENSOR_MEMS_Reset(uint8_t cnt);
|
||||
|
||||
void STS_PRESENCE_SENSOR_NVM_CFG(void);
|
||||
void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void);
|
||||
//void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void);
|
||||
void STS_PRESENCE_SENSOR_Read(STS_OO_SensorStatusDataTypeDef *o6_data);
|
||||
void STS_PRESENCE_SENSOR_Prepare_Send_Data(STS_OO_SensorStatusDataTypeDef *sensor_data);
|
||||
|
||||
|
@ -748,11 +748,13 @@ uint8_t STS_SENSOR_MEMS_Get_ID(uint8_t *devID);
|
|||
int sts_presence_rss_detection_init(void);
|
||||
int sts_presence_rss_detection_process(void);
|
||||
int sts_presence_rss_detection_deinit(void);
|
||||
|
||||
int sts_presence_rss_presence_detection(void);
|
||||
int sts_presence_rss_fall_rise_detection(void);
|
||||
int sts_distance_rss_detector_distance(void);
|
||||
int acc_example_detector_distance(int argc, char *argv[]);
|
||||
//int sts_distance_rss_detector_distance(void);
|
||||
int sts_distance_rss_detector_distance(uint16_t *rss_distance);
|
||||
//int acc_example_detector_distance(int argc, char *argv[]);
|
||||
//int acc_example_detector_distance(void);
|
||||
int acc_example_detector_distance(uint16_t *rss_distance);
|
||||
int acc_example_service_sparse(int argc, char *argv[]);
|
||||
int acc_example_detector_distance_recorded(int argc, char *argv[]);
|
||||
int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result);
|
||||
|
@ -774,8 +776,9 @@ void STS_MOTION_SENSOR_Initialization(void);
|
|||
void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size);
|
||||
void STS_SENSOR_Function_Test_Process(void);
|
||||
void STS_SENSOR_Distance_Test_Process(void);
|
||||
void STS_PRESENCE_SENSOR_Function_Test_Process(uint8_t *self_test_result, uint8_t count);
|
||||
void STS_PRESENCE_SENSOR_Distance_Measure_Process(void);
|
||||
void STS_PRESENCE_SENSOR_Function_Test_Process(uint8_t *self_test_result, uint8_t *count);
|
||||
//void STS_PRESENCE_SENSOR_Distance_Measure_Process(void);
|
||||
void STS_PRESENCE_SENSOR_Distance_Measure_Process(uint16_t *rss_distance);
|
||||
void STS_PRESENCE_SENSOR_Background_Measure_Process(uint16_t *bg_distance, uint16_t *bg_motion_noise);
|
||||
int sts_presence_rss_background_evaluation_process(uint16_t *evaluated_distance, uint16_t *evaluated_score);
|
||||
void STS_Sensor_Init(void);
|
||||
|
|
|
@ -34,31 +34,33 @@
|
|||
#define EXAMPLE_PROFILE ACC_SERVICE_PROFILE_2 //2
|
||||
#define EXAMPLE_HWAAS (63) //63
|
||||
|
||||
volatile distance_measure_cfg_t distance_cfg={1.0, 2.0, 5, 63, 2, 10, 0.5, 1.3, 0.2};
|
||||
extern volatile distance_measure_cfg_t distance_cfg; //={1.0, 3.0, 4, 63, 1, 10, 0.5, 1.3, 0.5};
|
||||
extern float sts_distance_rss_distance;
|
||||
|
||||
static void update_configuration(acc_detector_distance_configuration_t distance_configuration);
|
||||
|
||||
static void print_configuration(acc_detector_distance_configuration_t distance_configuration);
|
||||
|
||||
static void print_distances(acc_detector_distance_result_t *result, uint16_t reflection_count);
|
||||
|
||||
|
||||
int acc_example_detector_distance(int argc, char *argv[]);
|
||||
int acc_example_detector_distance(uint16_t *rss_distance);
|
||||
|
||||
|
||||
int acc_example_detector_distance(int argc, char *argv[])
|
||||
int acc_example_detector_distance(uint16_t *rss_distance)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
//(void)argc;
|
||||
//(void)argv;
|
||||
//APP_LOG(TS_OFF, VLEVEL_M, "Acconeer software version %s\n", acc_version_get());
|
||||
|
||||
const acc_hal_t *hal = acc_hal_integration_get_implementation();
|
||||
|
||||
#if 1
|
||||
if (!acc_rss_activate(hal))
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "acc_rss_activate() failed\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
acc_rss_override_sensor_id_check_at_creation(true);
|
||||
|
||||
acc_detector_distance_configuration_t distance_configuration = acc_detector_distance_configuration_create();
|
||||
|
@ -81,8 +83,12 @@ int acc_example_detector_distance(int argc, char *argv[])
|
|||
}
|
||||
*/
|
||||
///
|
||||
print_configuration(distance_configuration);
|
||||
|
||||
update_configuration(distance_configuration);
|
||||
|
||||
acc_detector_distance_handle_t distance_handle = acc_detector_distance_create(distance_configuration);
|
||||
print_configuration(distance_configuration);
|
||||
|
||||
if (distance_handle == NULL)
|
||||
{
|
||||
|
@ -107,7 +113,7 @@ int acc_example_detector_distance(int argc, char *argv[])
|
|||
uint16_t number_of_peaks = 5;
|
||||
acc_detector_distance_result_t result[number_of_peaks];
|
||||
acc_detector_distance_result_info_t result_info;
|
||||
sts_distance_rss_distance = 0.0;
|
||||
float sts_distance = 0.0f;
|
||||
|
||||
for (int i = 0; i < iterations; i++)
|
||||
{
|
||||
|
@ -118,11 +124,12 @@ int acc_example_detector_distance(int argc, char *argv[])
|
|||
APP_LOG(TS_OFF, VLEVEL_M, "acc_detector_distance_get_next() failed\n");
|
||||
break;
|
||||
}
|
||||
sts_distance_rss_distance += result->distance_m;
|
||||
sts_distance += result->distance_m;
|
||||
print_distances(result, result_info.number_of_peaks);
|
||||
HAL_Delay(20);
|
||||
}
|
||||
|
||||
sts_distance_rss_distance = 1000.0f*sts_distance_rss_distance/iterations;
|
||||
*rss_distance = (sts_distance*1000.0f)/iterations;
|
||||
|
||||
bool deactivated = acc_detector_distance_deactivate(distance_handle);
|
||||
|
||||
|
@ -132,7 +139,7 @@ int acc_example_detector_distance(int argc, char *argv[])
|
|||
|
||||
if (deactivated && success)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "Application finished OK\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "Application finished OK\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -142,11 +149,15 @@ int acc_example_detector_distance(int argc, char *argv[])
|
|||
|
||||
static void update_configuration(acc_detector_distance_configuration_t distance_configuration)
|
||||
{
|
||||
acc_detector_distance_configuration_requested_start_set(distance_configuration, distance_cfg.start_m); //EXAMPLE_START_M);
|
||||
acc_detector_distance_configuration_requested_length_set(distance_configuration, distance_cfg.length_m); //EXAMPLE_LENGTH_M);
|
||||
acc_detector_distance_configuration_service_profile_set(distance_configuration, distance_cfg.acc_profile); //EXAMPLE_PROFILE);
|
||||
acc_detector_distance_configuration_hw_accelerated_average_samples_set(distance_configuration, distance_cfg.hwaas);//EXAMPLE_HWAAS);
|
||||
acc_detector_distance_configuration_requested_start_set(distance_configuration, EXAMPLE_START_M);// distance_cfg.start_m); //EXAMPLE_START_M);
|
||||
acc_detector_distance_configuration_requested_length_set(distance_configuration, 3.0); //distance_cfg.length_m); //EXAMPLE_LENGTH_M);
|
||||
acc_detector_distance_configuration_service_profile_set(distance_configuration, 2); //distance_cfg.acc_profile); //EXAMPLE_PROFILE);
|
||||
acc_detector_distance_configuration_hw_accelerated_average_samples_set(distance_configuration, EXAMPLE_HWAAS); //distance_cfg.hwaas);//EXAMPLE_HWAAS);
|
||||
//acc_detector_distance_configuration_record_background_sweeps_set(distance_configuration, 16);
|
||||
//acc_detector_distance_configuration_downsampling_factor_set(distance_configuration, 1);
|
||||
//acc_detector_distance_configuration_threshold_sensitivity_set(distance_configuration, 0.2);
|
||||
|
||||
#if 1
|
||||
acc_detector_distance_configuration_threshold_sensitivity_set(distance_configuration, distance_cfg.threshold);
|
||||
acc_detector_distance_configuration_sweep_averaging_set(distance_configuration,distance_cfg.sweep_average);
|
||||
acc_detector_distance_configuration_receiver_gain_set(distance_configuration,distance_cfg.gain);
|
||||
|
@ -154,17 +165,42 @@ static void update_configuration(acc_detector_distance_configuration_t distance_
|
|||
|
||||
acc_detector_distance_configuration_threshold_type_set(distance_configuration, ACC_DETECTOR_DISTANCE_THRESHOLD_TYPE_CFAR);
|
||||
acc_detector_distance_configuration_record_background_sweeps_set(distance_configuration, 16);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void print_configuration(acc_detector_distance_configuration_t distance_configuration)
|
||||
{
|
||||
float sts_start = acc_detector_distance_configuration_requested_start_get(distance_configuration);
|
||||
float sts_length = acc_detector_distance_configuration_requested_length_get(distance_configuration);
|
||||
float sts_profile = acc_detector_distance_configuration_service_profile_get(distance_configuration);
|
||||
float sts_hwaas = acc_detector_distance_configuration_hw_accelerated_average_samples_get(distance_configuration);
|
||||
float sts_gain = acc_detector_distance_configuration_receiver_gain_get(distance_configuration);
|
||||
float sts_threshold = acc_detector_distance_configuration_threshold_sensitivity_get(distance_configuration);
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nDistance CFG: start:%4d length:%4d profile:%2d HWAAS:%2d gain:%3d threshold:%6d \r\n",
|
||||
(int)(sts_start*1000.0f), (int)(sts_length*1000.0f), (int)(sts_profile), (int)(sts_hwaas), (int)(sts_gain*100.0f), (int)(sts_threshold*1000.0f));
|
||||
|
||||
#if 0
|
||||
acc_detector_distance_configuration_threshold_sensitivity_set(distance_configuration, distance_cfg.threshold);
|
||||
acc_detector_distance_configuration_sweep_averaging_set(distance_configuration,distance_cfg.sweep_average);
|
||||
acc_detector_distance_configuration_receiver_gain_set(distance_configuration,distance_cfg.gain);
|
||||
acc_detector_distance_configuration_downsampling_factor_set(distance_configuration, distance_cfg.downsampling);
|
||||
|
||||
acc_detector_distance_configuration_threshold_type_set(distance_configuration, ACC_DETECTOR_DISTANCE_THRESHOLD_TYPE_CFAR);
|
||||
acc_detector_distance_configuration_record_background_sweeps_set(distance_configuration, 16);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void print_distances(acc_detector_distance_result_t *result, uint16_t reflection_count)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "Found %u peaks:\n", (unsigned int)reflection_count);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "Found %u peaks:\n", (unsigned int)reflection_count);
|
||||
|
||||
for (uint16_t i = 0; i < reflection_count; i++)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "Amplitude %u at %u mm\n", (unsigned int)result[i].amplitude,
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "Amplitude %u at %u mm\n", (unsigned int)result[i].amplitude,
|
||||
(unsigned int)(result[i].distance_m * 1000));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,48 +55,52 @@
|
|||
//volatile distance_measure_cfg_t distance_cfg={1.5, 2.0, 1, 63, 2, 10, 0.5, 1.3, 0.2};
|
||||
// SPARK FUN EXAMPLE
|
||||
// GOOD --- volatile distance_measure_cfg_t distance_cfg={0.4, 3.5, 4, 63, 0, 10, 0.5, 1.3, 0.2};
|
||||
volatile distance_measure_cfg_t distance_cfg={1.6, 3.2, 2, 63, 1, 10, 0.5, 1.3, 0.5};
|
||||
//volatile distance_measure_cfg_t distance_cfg={1.2, 3.2, 2, 63, 1, 10, 0.5, 1.3, 0.5};
|
||||
//extern volatile distance_measure_cfg_t distance_cfg;
|
||||
// 2024-08-15 volatile distance_measure_cfg_t distance_cfg={0.8, 3.5, 2, 63, 2, 10, 0.5, 1.3, 0.2};
|
||||
//volatile distance_measure_cfg_t distance_cfg={0.8, 3.5, 4, 63, 2, 10, 0.5, 1.3, 0.2};
|
||||
volatile distance_measure_cfg_t distance_cfg={0.8, 3.5, 4, 63, 2, 10, 0.4, 1.2, 0.2};
|
||||
//volatile distance_measure_cfg_t distance_cfg={0.8, 3.5, 4, 63, 2, 10, 0.4, 1.2, 0.2};
|
||||
//volatile distance_measure_cfg_t distance_cfg={1.5, 3.3, 2, 63, 4, 10, 0.8182f, 0.4, 0.2};
|
||||
extern volatile uint16_t sts_distance_rss_distance, sts_sensor_install_height;
|
||||
|
||||
static void sts_distance_rss_update_configuration(acc_detector_distance_configuration_t distance_configuration);
|
||||
|
||||
|
||||
static void print_configuration(acc_detector_distance_configuration_t distance_configuration);
|
||||
static void print_distances(acc_detector_distance_result_t *result, uint16_t reflection_count);
|
||||
|
||||
|
||||
int sts_distance_rss_detector_distance(void);
|
||||
int sts_distance_rss_detector_distance(uint16_t *rss_distance);
|
||||
|
||||
int sts_distance_rss_detector_distance(void)
|
||||
int sts_distance_rss_detector_distance(uint16_t *rss_distance)
|
||||
{
|
||||
const acc_hal_t *hal = acc_hal_integration_get_implementation();
|
||||
|
||||
if (!acc_rss_activate(hal))
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "Failed to activate RSS\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "Failed to activate RSS\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
//acc_rss_override_sensor_id_check_at_creation(true);
|
||||
acc_rss_override_sensor_id_check_at_creation(true);
|
||||
|
||||
acc_detector_distance_configuration_t distance_configuration = acc_detector_distance_configuration_create();
|
||||
|
||||
if (distance_configuration == NULL)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "acc_detector_distance_configuration_create() failed\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "acc_detector_distance_configuration_create() failed\n");
|
||||
acc_rss_deactivate();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
print_configuration(distance_configuration);
|
||||
sts_distance_rss_update_configuration(distance_configuration);
|
||||
|
||||
acc_detector_distance_handle_t distance_handle = acc_detector_distance_create(distance_configuration);
|
||||
print_configuration(distance_configuration);
|
||||
|
||||
if (distance_handle == NULL)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "acc_detector_distance_create() failed\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "acc_detector_distance_create() failed\n");
|
||||
acc_detector_distance_configuration_destroy(&distance_configuration);
|
||||
acc_rss_deactivate();
|
||||
return EXIT_FAILURE;
|
||||
|
@ -106,14 +110,14 @@ int sts_distance_rss_detector_distance(void)
|
|||
|
||||
if (!acc_detector_distance_activate(distance_handle))
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "acc_detector_distance_activate() failed\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "acc_detector_distance_activate() failed\n");
|
||||
acc_detector_distance_destroy(&distance_handle);
|
||||
acc_rss_deactivate();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
const int iterations = 1; //5;
|
||||
const int iterations = 3; //5;
|
||||
uint16_t number_of_peaks = 1; // FSB first significant Bin
|
||||
acc_detector_distance_result_t result[number_of_peaks];
|
||||
acc_detector_distance_result_info_t result_info;
|
||||
|
@ -125,17 +129,23 @@ int sts_distance_rss_detector_distance(void)
|
|||
|
||||
if (!success)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "acc_detector_distance_get_next() failed\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "acc_detector_distance_get_next() failed\n");
|
||||
break;
|
||||
}
|
||||
for(uint8_t j=0; j< result_info.number_of_peaks; j++)
|
||||
{
|
||||
tmp_distance = tmp_distance + (result[j].distance_m); //KalmanFilter(result[j].distance_m);
|
||||
}
|
||||
|
||||
print_distances(result, result_info.number_of_peaks);
|
||||
}
|
||||
|
||||
sts_distance_rss_distance = (uint16_t)(1000*tmp_distance)/(number_of_peaks*iterations);
|
||||
|
||||
|
||||
sts_distance_rss_distance = (uint16_t)(tmp_distance*1000.0f)/(number_of_peaks*iterations);
|
||||
// ensure it's a valid installation height
|
||||
//sts_sensor_install_height = (uint16_t)MAX(sts_distance_rss_distance,2000);
|
||||
*rss_distance = (uint16_t)sts_distance_rss_distance;
|
||||
sts_sensor_install_height = (uint16_t)sts_distance_rss_distance;
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nAverage Distance =%u mm --- Assume Sensor Install Height = %u mm\r\n", (uint16_t)sts_distance_rss_distance, (uint16_t)sts_sensor_install_height);
|
||||
|
||||
|
@ -147,13 +157,13 @@ int sts_distance_rss_detector_distance(void)
|
|||
|
||||
if (deactivated && success)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "Application finished OK\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "Application finished OK\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void sts_distance_rss_update_configuration(acc_detector_distance_configuration_t distance_configuration)
|
||||
{
|
||||
acc_detector_distance_configuration_mur_set(distance_configuration, DEFAULT_FAR_RANGE_MUR); // NEW ADD
|
||||
|
@ -161,7 +171,7 @@ static void sts_distance_rss_update_configuration(acc_detector_distance_configur
|
|||
acc_detector_distance_configuration_requested_length_set(distance_configuration, distance_cfg.length_m);
|
||||
acc_detector_distance_configuration_receiver_gain_set(distance_configuration,distance_cfg.gain);
|
||||
acc_detector_distance_configuration_maximize_signal_attenuation_set(distance_configuration, DEFAULT_FAR_MAXIMIZE_SIGNAL_ATTENUATION); // NEW ADD
|
||||
acc_detector_distance_configuration_service_profile_set(distance_configuration, distance_cfg.acc_profile);
|
||||
acc_detector_distance_configuration_service_profile_set(distance_configuration, DEFAULT_FAR_RANGE_SERVICE_PROFILE); //distance_cfg.acc_profile);
|
||||
acc_detector_distance_configuration_downsampling_factor_set(distance_configuration, distance_cfg.downsampling);
|
||||
acc_detector_distance_configuration_sweep_averaging_set(distance_configuration,distance_cfg.sweep_average);
|
||||
acc_detector_distance_configuration_threshold_type_set(distance_configuration, ACC_DETECTOR_DISTANCE_THRESHOLD_TYPE_CFAR);
|
||||
|
@ -172,9 +182,9 @@ static void sts_distance_rss_update_configuration(acc_detector_distance_configur
|
|||
acc_detector_distance_configuration_cfar_threshold_window_set(distance_configuration,DEFAULT_FAR_RANGE_CFAR_THRESHOLD_WINDOW);
|
||||
acc_detector_distance_configuration_record_background_sweeps_set(distance_configuration, 16);
|
||||
}
|
||||
|
||||
#endif
|
||||
//backup. ... previous setting ----don't delete
|
||||
/*
|
||||
|
||||
static void sts_distance_rss_update_configuration(acc_detector_distance_configuration_t distance_configuration)
|
||||
{
|
||||
acc_detector_distance_configuration_requested_start_set(distance_configuration, distance_cfg.start_m);
|
||||
|
@ -182,16 +192,16 @@ static void sts_distance_rss_update_configuration(acc_detector_distance_configur
|
|||
acc_detector_distance_configuration_service_profile_set(distance_configuration, distance_cfg.acc_profile);
|
||||
acc_detector_distance_configuration_hw_accelerated_average_samples_set(distance_configuration, distance_cfg.hwaas);
|
||||
|
||||
acc_detector_distance_configuration_threshold_sensitivity_set(distance_configuration, distance_cfg.threshold);
|
||||
acc_detector_distance_configuration_downsampling_factor_set(distance_configuration, distance_cfg.downsampling);
|
||||
acc_detector_distance_configuration_sweep_averaging_set(distance_configuration,distance_cfg.sweep_average);
|
||||
acc_detector_distance_configuration_receiver_gain_set(distance_configuration,distance_cfg.gain);
|
||||
acc_detector_distance_configuration_downsampling_factor_set(distance_configuration, distance_cfg.downsampling);
|
||||
acc_detector_distance_configuration_threshold_sensitivity_set(distance_configuration, distance_cfg.threshold);
|
||||
|
||||
acc_detector_distance_configuration_threshold_type_set(distance_configuration, ACC_DETECTOR_DISTANCE_THRESHOLD_TYPE_CFAR);
|
||||
acc_detector_distance_configuration_record_background_sweeps_set(distance_configuration, 16);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
static void print_distances(acc_detector_distance_result_t *result, uint16_t reflection_count)
|
||||
{
|
||||
|
@ -203,3 +213,18 @@ static void print_distances(acc_detector_distance_result_t *result, uint16_t ref
|
|||
(unsigned int)(result[i].distance_m * 1000));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void print_configuration(acc_detector_distance_configuration_t distance_configuration)
|
||||
{
|
||||
float sts_start = acc_detector_distance_configuration_requested_start_get(distance_configuration);
|
||||
float sts_length = acc_detector_distance_configuration_requested_length_get(distance_configuration);
|
||||
float sts_profile = acc_detector_distance_configuration_service_profile_get(distance_configuration);
|
||||
float sts_hwaas = acc_detector_distance_configuration_hw_accelerated_average_samples_get(distance_configuration);
|
||||
float sts_gain = acc_detector_distance_configuration_receiver_gain_get(distance_configuration);
|
||||
float sts_threshold = acc_detector_distance_configuration_threshold_sensitivity_get(distance_configuration);
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nDistance CFG: start:%4d length:%4d profile:%2d HWAAS:%2d gain:%3d threshold:%6d \r\n",
|
||||
(int)(sts_start*1000.0f), (int)(sts_length*1000.0f), (int)(sts_profile), (int)(sts_hwaas), (int)(sts_gain*100.0f), (int)(sts_threshold*1000.0f));
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,8 @@ volatile uint8_t sts_presence_singularity=0;
|
|||
extern uint8_t sts_lamp_bar_color;
|
||||
acc_detector_presence_handle_t rss_handle=NULL;
|
||||
acc_detector_presence_result_t rss_result;
|
||||
volatile float sts_rss_threshold=1.6f;
|
||||
volatile float sts_rss_threshold=1.6f, sts_run_start, sts_run_length, sts_run_threshold, sts_run_gain, sts_run_profile, sts_run_f_inter_fast_cutoff,sts_run_f_inter_slow_cutoff;
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* External variables ---------------------------------------------------------*/
|
||||
|
@ -201,12 +202,12 @@ volatile float sts_rss_threshold=1.6f;
|
|||
|
||||
|
||||
uint16_t start_t = 500;
|
||||
uint16_t end_t = 2000;
|
||||
uint16_t end_t = 3000;
|
||||
uint16_t update_t = 200;
|
||||
uint8_t gain_t = 50;
|
||||
uint8_t gain_t = 80;
|
||||
uint16_t threshold = 1500;
|
||||
uint16_t frame_fast_t = 200;
|
||||
uint16_t frame_slow_t = 20;
|
||||
uint16_t frame_slow_t = 17;
|
||||
uint8_t profile = 4;
|
||||
uint16_t Sweeps_per_frame = 16;
|
||||
uint8_t downsampling = 1;
|
||||
|
@ -251,7 +252,7 @@ void update_configuration_with_type(acc_detector_presence_configuration_t presen
|
|||
|
||||
break;
|
||||
case STS_RSS_CONFIG_FULL:
|
||||
//filter = acc_detector_presence_configuration_filter_parameters_get(presence_configuration);
|
||||
filter = acc_detector_presence_configuration_filter_parameters_get(presence_configuration);
|
||||
filter.inter_frame_deviation_time_const = sts_presence_rss_config.default_inter_frame_deviation_time_const;
|
||||
filter.inter_frame_fast_cutoff = sts_presence_rss_config.default_inter_frame_fast_cutoff;
|
||||
filter.inter_frame_slow_cutoff = sts_presence_rss_config.default_inter_frame_slow_cutoff;
|
||||
|
@ -260,8 +261,14 @@ void update_configuration_with_type(acc_detector_presence_configuration_t presen
|
|||
filter.output_time_const = sts_presence_rss_config.default_output_time_const; //0.0f;
|
||||
acc_detector_presence_configuration_filter_parameters_set(presence_configuration, &filter);
|
||||
break;
|
||||
case STS_RSS_CONFIG_BGN_SCAN:
|
||||
acc_detector_presence_configuration_start_set(presence_configuration, 1.5f);
|
||||
acc_detector_presence_configuration_length_set(presence_configuration, 3.5f);
|
||||
acc_detector_presence_configuration_detection_threshold_set(presence_configuration, 1.0f);
|
||||
break;
|
||||
case STS_RSS_CONFIG_FALL_DETECTION:
|
||||
//filter = acc_detector_presence_configuration_filter_parameters_get(presence_configuration);
|
||||
//acc_detector_presence_configuration_update_rate_set(presence_configuration, 0.1f);
|
||||
filter = acc_detector_presence_configuration_filter_parameters_get(presence_configuration);
|
||||
// if intra-frame-weight set to 1.0, then the following inter-frame parameters have no effect
|
||||
filter.inter_frame_deviation_time_const = DEFAULT_INTER_FRAME_DEVIATION_TIME_CONST;
|
||||
filter.inter_frame_fast_cutoff = 10.0f; //DEFAULT_INTER_FRAME_FAST_CUTOFF;
|
||||
|
@ -284,7 +291,7 @@ void update_configuration_with_type(acc_detector_presence_configuration_t presen
|
|||
}
|
||||
void update_configuration(acc_detector_presence_configuration_t presence_configuration)
|
||||
{
|
||||
float start_m_t = 0.0f;
|
||||
//float start_m_t = 0.0f;
|
||||
start_m = (float)start_t / 1000;
|
||||
length_m = (float)(end_t - start_t) / 1000 + 0.0f;
|
||||
threshold_m = (float)threshold / 1000;
|
||||
|
@ -398,6 +405,7 @@ static void set_default_configuration(acc_detector_presence_configuration_t pres
|
|||
*
|
||||
* @param[in] fall_rise_configuration The fall rise configuration to set default values in
|
||||
*/
|
||||
#if 0
|
||||
static void set_default_fall_rise_configuration(acc_detector_presence_configuration_t presence_configuration)
|
||||
{
|
||||
acc_detector_presence_configuration_sensor_set(presence_configuration, DEFAULT_SENSOR_ID);
|
||||
|
@ -436,8 +444,9 @@ static void set_default_fall_rise_configuration(acc_detector_presence_configurat
|
|||
acc_detector_presence_configuration_nbr_removed_pc_set(presence_configuration, DEFAULT_NBR_REMOVED_PC);
|
||||
acc_detector_presence_configuration_power_save_mode_set(presence_configuration, ACC_POWER_SAVE_MODE_ACTIVE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
static void sts_rss_set_current_configuration_full(acc_detector_presence_configuration_t presence_configuration)
|
||||
{
|
||||
acc_detector_presence_configuration_sensor_set(presence_configuration, DEFAULT_SENSOR_ID);
|
||||
|
@ -472,7 +481,7 @@ static void sts_rss_set_current_configuration_full(acc_detector_presence_configu
|
|||
acc_detector_presence_configuration_hw_accelerated_average_samples_set(presence_configuration, sts_presence_rss_config.default_hwaas);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
static void sts_rss_set_configuration_background_evalution(acc_detector_presence_configuration_t presence_configuration)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "\r\nsts_rss_cfg-start: %4d ,length: %4d ,threshold: %4d ,gain: %2d ,rate: %2d ,profile: %1d \r\n",
|
||||
|
@ -525,21 +534,21 @@ static void sts_rss_set_current_configuration_simple(acc_detector_presence_confi
|
|||
|
||||
static void print_current_configuration(acc_detector_presence_configuration_t presence_configuration)
|
||||
{
|
||||
static uint32_t cnt_0=0;
|
||||
if (cnt_0++%200 !=0) return;
|
||||
float sts_run_start = acc_detector_presence_configuration_start_get(presence_configuration);
|
||||
float sts_run_length = acc_detector_presence_configuration_length_get(presence_configuration);
|
||||
float sts_run_threshold = acc_detector_presence_configuration_detection_threshold_get(presence_configuration);
|
||||
float sts_run_gain = acc_detector_presence_configuration_receiver_gain_get(presence_configuration);
|
||||
//static uint32_t cnt_0=0;
|
||||
//if (cnt_0++%200 !=0) return;
|
||||
sts_run_start = acc_detector_presence_configuration_start_get(presence_configuration);
|
||||
sts_run_length = acc_detector_presence_configuration_length_get(presence_configuration);
|
||||
sts_run_threshold = acc_detector_presence_configuration_detection_threshold_get(presence_configuration);
|
||||
sts_run_gain = acc_detector_presence_configuration_receiver_gain_get(presence_configuration);
|
||||
float sts_run_update_rate = acc_detector_presence_configuration_update_rate_get(presence_configuration);
|
||||
float sts_run_profile = acc_detector_presence_configuration_service_profile_get(presence_configuration);
|
||||
sts_run_profile = acc_detector_presence_configuration_service_profile_get(presence_configuration);
|
||||
float Sweeps_per_frame = acc_detector_presence_configuration_sweeps_per_frame_get(presence_configuration);
|
||||
|
||||
sts_rss_threshold = sts_run_threshold;
|
||||
acc_detector_presence_configuration_filter_parameters_t sts_run_filter = acc_detector_presence_configuration_filter_parameters_get(presence_configuration);
|
||||
|
||||
float sts_run_f_inter_fast_cutoff = sts_run_filter.inter_frame_fast_cutoff;
|
||||
float sts_run_f_inter_slow_cutoff = sts_run_filter.inter_frame_slow_cutoff;
|
||||
sts_run_f_inter_fast_cutoff = sts_run_filter.inter_frame_fast_cutoff;
|
||||
sts_run_f_inter_slow_cutoff = sts_run_filter.inter_frame_slow_cutoff;
|
||||
#if 0
|
||||
float sts_run_f_inter_frame_dev_time_const = sts_run_filter.inter_frame_deviation_time_const;
|
||||
|
||||
|
@ -547,7 +556,7 @@ static void print_current_configuration(acc_detector_presence_configuration_t pr
|
|||
float sts_run_f_intra_frame_weight = sts_run_filter.intra_frame_weight;
|
||||
float sts_run_f_output_time_const = sts_run_filter.output_time_const;
|
||||
#endif
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nWork_mode:%2d Start: %4d (mm) Length: %4d (mm) Threshold: %4d (*) Gain= %2d (%) UpdateRate=%4d Profile= %d \r\n",
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nWork_mode:%2d Start: %4d (mm) Length: %4d (mm) Threshold: %d (*) Gain= %2d (%) UpdateRate=%4d Profile= %d \r\n",
|
||||
sts_work_mode, (int)(1000.0*sts_run_start), (int)(1000.0*sts_run_length), (int)(1000.0*sts_run_threshold),
|
||||
(int)(100.0*sts_run_gain),(int)sts_run_update_rate, (int)sts_run_profile);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n(1)FastCut:%4u (2)SlowCut:%4u (3)Sweeps_per_frame:%4u \r\n",
|
||||
|
@ -571,13 +580,13 @@ static void sts_print_result(acc_detector_presence_result_t result)
|
|||
{
|
||||
uint16_t signal=0;
|
||||
uint16_t dist=0;
|
||||
uint8_t i=0;
|
||||
//uint8_t i=0;
|
||||
uint16_t threshold = sts_rss_threshold*1000.0f;
|
||||
|
||||
signal=(int)(result.presence_score * 1000.0f);
|
||||
dist =(int)(result.presence_distance * 1000.0f);
|
||||
|
||||
uint8_t flag=0;
|
||||
//uint8_t flag=0;
|
||||
if (signal>threshold)
|
||||
{
|
||||
if(dist<500)
|
||||
|
@ -642,14 +651,16 @@ static void sts_print_result(acc_detector_presence_result_t result)
|
|||
//Out1_ON
|
||||
//Out2_OFF
|
||||
sts_rss_result=1;
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"Motion (%5d), Distance: %4dmm Threshold:%6d Yes:%d No:%d \r\n", signal,dist,threshold, yes_count, no_count);
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"Motion (%5d), Distance: %4dmm [start: %4d length: %4d gain: %3d Threshold:%6d Yes:%d No:%d \r\n",
|
||||
signal,dist,(int)(sts_run_start*1000.0f), (int)(sts_run_length*1000.0f), (int)(sts_run_gain*100.0f), (int)(sts_run_threshold*1000.0f), yes_count, no_count);
|
||||
}
|
||||
else if(no_count>(TIME_C-1))
|
||||
{
|
||||
//Out1_OFF
|
||||
//Out2_ON
|
||||
sts_rss_result=0;
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"NO motion(%5d), Distance: %4dmm Threshold:%6d Yes:%d No:%d \r\n", signal,dist,threshold, yes_count, no_count);
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"No Motion(%5d), Distance: %4dmm [start: %4d length: %4d gain: %3d Threshold:%6d Yes:%d No:%d \r\n",
|
||||
signal,dist,(int)(sts_run_start*1000.0f), (int)(sts_run_length*1000.0f), (int)(sts_run_gain*100.0f), (int)(sts_run_threshold*1000.0f), yes_count, no_count);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -682,10 +693,16 @@ int sts_presence_rss_background_evaluation_process(uint16_t *evaluated_distance,
|
|||
sts_rss_config_updated_flag = STS_RSS_CONFIG_BGN_SCAN;
|
||||
|
||||
if (rss_handle == NULL) {
|
||||
sts_presence_rss_detection_init();
|
||||
int ret=sts_presence_rss_detection_init();
|
||||
if (ret==EXIT_FAILURE) return EXIT_FAILURE;
|
||||
} else {
|
||||
sts_presence_rss_detection_deinit();
|
||||
int ret2=sts_presence_rss_detection_init();
|
||||
if (ret2==EXIT_FAILURE) return EXIT_FAILURE;
|
||||
|
||||
}
|
||||
|
||||
const int iterations = 1000;
|
||||
const int iterations = 100;
|
||||
//acc_detector_presence_result_t result;
|
||||
uint16_t motioncount = 0;
|
||||
float average_distance =0.0f;
|
||||
|
@ -751,12 +768,10 @@ int sts_presence_rss_detection_init(void)
|
|||
|
||||
//sts_rss_set_current_configuration_simple(presence_configuration);
|
||||
//update_configuration(presence_configuration);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n STS CFG Configuration \r\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nWork_mode:%2d Start: %4d (mm) Length: %4d (mm) Threshold: %4d (*) Gain= %2d (%) UpdateRate=%4d Profile= %d \r\n",
|
||||
sts_work_mode, (int)(1000.0*sts_presence_rss_config.default_start_m), (int)(1000.0*sts_presence_rss_config.default_length_m), (int)(1000.0*sts_presence_rss_config.default_threshold),
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nBefore Update: Work_mode:%2d CFG: %2d Start: %4d (mm) Length: %4d (mm) Threshold: %4d (*) Gain= %2d (%) UpdateRate=%4d Profile= %d \r\n",
|
||||
sts_work_mode, sts_rss_config_updated_flag, (int)(1000.0*sts_presence_rss_config.default_start_m), (int)(1000.0*sts_presence_rss_config.default_length_m), (int)(1000.0*sts_presence_rss_config.default_threshold),
|
||||
(int)(100.0*sts_presence_rss_config.default_receiver_gain),(int)sts_presence_rss_config.default_update_rate_presence, (int)sts_presence_rss_config.default_profile);
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n STS CFG update flag =%d \r\n", sts_rss_config_updated_flag);
|
||||
update_configuration_with_type(presence_configuration, sts_rss_config_updated_flag);
|
||||
//set_default_configuration(presence_configuration);
|
||||
print_current_configuration(presence_configuration);
|
||||
|
@ -796,10 +811,11 @@ int sts_presence_rss_detection_process(void)
|
|||
if (!success)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"acc_detector_presence_get_next() failed\n");
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
sts_print_result(rss_result);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int sts_presence_rss_detection_deinit(void)
|
||||
|
@ -810,7 +826,7 @@ int sts_presence_rss_detection_deinit(void)
|
|||
|
||||
if (deactivated)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"Application finished OK\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"\r\n rss presence detector De-inited \r\n");
|
||||
return EXIT_SUCCESS;
|
||||
} else return EXIT_FAILURE;
|
||||
}
|
||||
|
@ -860,6 +876,8 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
}
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "\r\n Update flag=%02x, workmode=%2d \r\n", sts_rss_config_updated_flag, sts_work_mode);
|
||||
update_configuration_with_type(presence_configuration, sts_rss_config_updated_flag);
|
||||
#if 0
|
||||
switch (sts_rss_config_updated_flag)
|
||||
{
|
||||
#if 0
|
||||
|
@ -887,7 +905,7 @@ int sts_presence_rss_fall_rise_detection(void)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
// sts_rss_config_updated_flag = STS_RSS_CONFIG_NON; //update finished, set to 0
|
||||
}
|
||||
|
||||
|
@ -1246,10 +1264,12 @@ void STS_YunhornCheckStandardDeviation(void)
|
|||
uint32_t sum_presence_distance = 0, sum_presence_score=0; //presence score act as magnetic or amplitude of motion
|
||||
uint32_t average_presence_distance = 0, average_presence_score=0;
|
||||
uint32_t variance_presence_distance = 0, variance_presence_score=0;
|
||||
//uint32_t variance_presence_distance = 0;
|
||||
uint32_t standard_variance_presence_distance = 0, standard_variance_presence_score=0;
|
||||
// ROC -- rate of change
|
||||
uint32_t roc_distance[DEFAULT_MOTION_DATASET_LEN]={0}, sum_roc_distance=0, average_roc_distance=0, variance_roc_distance=0, standard_variance_roc_distance=0;
|
||||
uint32_t roc_acc[DEFAULT_MOTION_DATASET_LEN]={0}, sum_roc_acc=0, average_roc_acc=0, variance_roc_acc=0, standard_variance_roc_acc=0;
|
||||
//uint32_t roc_acc[DEFAULT_MOTION_DATASET_LEN]={0}, sum_roc_acc=0, average_roc_acc=0, standard_variance_roc_acc=0;
|
||||
//act as speed of change at given time slot acc_integration_sleep_ms(1000 / DEFAULT_UPDATE_RATE_PRESENCE);
|
||||
uint8_t SAMPLE_DATASET_NUM = MIN(motion_count,DEFAULT_MOTION_DATASET_LEN );
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n Sample dataset for deviation process =%u \r\n",SAMPLE_DATASET_NUM);
|
||||
|
|
|
@ -43,17 +43,26 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result);
|
|||
int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
||||
{
|
||||
uint8_t t=0;
|
||||
uint8_t test_result[20]={0x0};
|
||||
uint8_t test_result[10]={0x0};
|
||||
|
||||
// APP_LOG(TS_OFF, VLEVEL_L,"-- 0 -- Acconeer software version %s\n", acc_version_get());
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"-- 0 -- Acconeer software version %s\n", acc_version_get());
|
||||
|
||||
const acc_hal_t *hal = acc_hal_integration_get_implementation();
|
||||
|
||||
test_result[t++] = (uint8_t) acc_rss_activate(hal); //(1)
|
||||
if (!acc_rss_activate(hal))
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "Failed to activate RSS\n");
|
||||
test_result[t++] = 0;
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
test_result[t++] = 1; //(1)
|
||||
}
|
||||
|
||||
acc_rss_override_sensor_id_check_at_creation(true);
|
||||
|
||||
acc_rss_assembly_test_configuration_t configuration = acc_rss_assembly_test_configuration_create();
|
||||
|
||||
test_result[t++] = (uint8_t)((configuration != NULL)? 1:0); //(2)
|
||||
test_result[t++] = (uint8_t)((configuration != NULL)? 2:0); //(2)
|
||||
|
||||
acc_rss_assembly_test_configuration_sensor_set(configuration, DEFAULT_SENSOR_ID);
|
||||
|
||||
|
@ -69,7 +78,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
acc_rss_deactivate();
|
||||
//return EXIT_FAILURE;
|
||||
} else {
|
||||
test_result[t++] = 1;
|
||||
test_result[t++] = 3;
|
||||
}
|
||||
|
||||
acc_rss_assembly_test_configuration_communication_read_test_disable(configuration);
|
||||
|
@ -83,9 +92,8 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
acc_rss_deactivate();
|
||||
//return EXIT_FAILURE;
|
||||
} else {
|
||||
test_result[t++] = 1;
|
||||
test_result[t++] = 4;
|
||||
}
|
||||
|
||||
acc_rss_assembly_test_configuration_communication_write_read_test_disable(configuration);
|
||||
|
||||
// Enable and run: Interrupt Test
|
||||
|
@ -100,14 +108,16 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
//return EXIT_FAILURE;
|
||||
} else {
|
||||
|
||||
test_result[t++] = 1;
|
||||
test_result[t++] = 5;
|
||||
}
|
||||
|
||||
acc_rss_assembly_test_configuration_communication_interrupt_test_disable(configuration);
|
||||
// APP_LOG(TS_OFF, VLEVEL_L,"-- Interrupt Test --- End ********************\r\n");
|
||||
|
||||
|
||||
// APP_LOG(TS_OFF, VLEVEL_L,"-- Interrupt Test --- End ********************\r\n");
|
||||
#if 0
|
||||
// Enable and run: Clock Test
|
||||
// APP_LOG(TS_OFF, VLEVEL_L,"-- Clock Test --- Start ********************\r\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_L,"-- Clock Test --- Start ********************\r\n");
|
||||
acc_rss_assembly_test_configuration_clock_test_enable(configuration);
|
||||
if (!run_test(configuration))
|
||||
{
|
||||
|
@ -125,7 +135,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
|
||||
|
||||
// Enable and run: Power cycle test
|
||||
// APP_LOG(TS_OFF, VLEVEL_L,"-- Power cycle test --- Start ********************\r\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_L,"-- Power cycle test --- Start ********************\r\n");
|
||||
acc_rss_assembly_test_configuration_power_cycle_test_enable(configuration);
|
||||
if (!run_test(configuration))
|
||||
{
|
||||
|
@ -140,7 +150,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
|
||||
acc_rss_assembly_test_configuration_power_cycle_test_disable(configuration);
|
||||
// APP_LOG(TS_OFF, VLEVEL_L,"-- Power cycle test --- end ********************\r\n");
|
||||
|
||||
#endif
|
||||
|
||||
// Enable and run: Hibernate Test
|
||||
//APP_LOG(TS_OFF, VLEVEL_L,"-- Hibernate Test --- Start ********************\r\n");
|
||||
|
@ -153,7 +163,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
//return EXIT_FAILURE;
|
||||
} else {
|
||||
|
||||
test_result[t++] = 1;
|
||||
test_result[t++] = 6;
|
||||
}
|
||||
|
||||
acc_rss_assembly_test_configuration_communication_hibernate_test_disable(configuration);
|
||||
|
@ -170,7 +180,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
//return EXIT_FAILURE;
|
||||
} else {
|
||||
|
||||
test_result[t++] = 1;
|
||||
test_result[t++] = 7;
|
||||
}
|
||||
|
||||
acc_rss_assembly_test_configuration_supply_test_disable(configuration);
|
||||
|
@ -187,7 +197,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
//return EXIT_FAILURE;
|
||||
} else {
|
||||
|
||||
test_result[t++] = 1;
|
||||
test_result[t++] = 8;
|
||||
}
|
||||
|
||||
acc_rss_assembly_test_configuration_clock_test_disable(configuration);
|
||||
|
@ -204,7 +214,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
//return EXIT_FAILURE;
|
||||
} else {
|
||||
|
||||
test_result[t++] = 1;
|
||||
test_result[t++] = 9;
|
||||
}
|
||||
|
||||
acc_rss_assembly_test_configuration_power_cycle_test_disable(configuration);
|
||||
|
@ -212,10 +222,14 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
|
|||
|
||||
|
||||
//APP_LOG(TS_OFF, VLEVEL_L,"-- 10 -- Bring up test: All tests passed\n");
|
||||
test_result[t++] = 1; //(10)
|
||||
test_result[t++] = 10; //(10)
|
||||
for (uint8_t j=0; j<10; j++) {
|
||||
//APP_LOG(TS_OFF, VLEVEL_M, "|%02x ", test_result[j]);
|
||||
*(rss_self_test_result+j) = (void*)test_result[j];
|
||||
//APP_LOG(TS_OFF, VLEVEL_M, "=%02x ", rss_self_test_result[j]);
|
||||
}
|
||||
|
||||
memcpy(rss_self_test_result, test_result, 12);
|
||||
// APP_LOG(TS_OFF, VLEVEL_L,"--Bring up test result #=%d \r\n", t);
|
||||
//UTIL_MEM_cpy_8((void*)rss_self_test_result, (void*)test_result, 10);
|
||||
acc_rss_assembly_test_configuration_destroy(&configuration);
|
||||
acc_rss_deactivate();
|
||||
|
||||
|
@ -231,7 +245,7 @@ static bool run_test(acc_rss_assembly_test_configuration_t configuration)
|
|||
|
||||
if (!acc_rss_assembly_test(configuration, test_results, &nr_of_test_results))
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_L,"Bring up test: Failed to complete\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"Bring up test: Failed to complete\n");
|
||||
return false;
|
||||
} else {
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"Bring up test: SUCCESS to complete\n");
|
||||
|
@ -241,7 +255,7 @@ static bool run_test(acc_rss_assembly_test_configuration_t configuration)
|
|||
for (uint16_t i = 0; i < nr_of_test_results; i++)
|
||||
{
|
||||
const bool passed = test_results[i].test_passed;
|
||||
APP_LOG(TS_OFF, VLEVEL_L,"Name: %s, result: %s\n", test_results[i].test_name, passed ? "Pass" : "Fail");
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"Name: %s, result: %s\n", test_results[i].test_name, passed ? "Pass" : "Fail");
|
||||
|
||||
if (!passed)
|
||||
{
|
||||
|
|
|
@ -333,9 +333,17 @@ void STS_YunhornSTSEventP2_Process(void)
|
|||
}
|
||||
#endif
|
||||
//int res = sts_presence_rss_fall_rise_detection();
|
||||
if (rss_handle == NULL) {
|
||||
sts_presence_rss_detection_init();
|
||||
if ((rss_handle == NULL)) {
|
||||
sts_rss_config_updated_flag &= 0x7F;
|
||||
int ret=sts_presence_rss_detection_init();
|
||||
if (ret==EXIT_FAILURE) return;
|
||||
} else if ((sts_rss_config_updated_flag&0x80) !=0 ) {
|
||||
sts_rss_config_updated_flag &= 0x7F;
|
||||
sts_presence_rss_detection_deinit();
|
||||
int ret2=sts_presence_rss_detection_init();
|
||||
if (ret2==EXIT_FAILURE) return;
|
||||
}
|
||||
|
||||
int res = sts_presence_rss_detection_process();
|
||||
if (res == 0)
|
||||
{
|
||||
|
@ -771,8 +779,9 @@ void STS_PRESENCE_SENSOR_NVM_CFG(void)
|
|||
sts_rss_cfg_slid_win_size = (uint8_t)(sts_cfg_nvm.p[RSS_CFG_SLID_WIN])&0x0F;
|
||||
|
||||
APP_LOG(TS_ON, VLEVEL_H, "\r\n##### Reboot --- with NVM CFG'ED RSS flag =%02x \r\n", sts_rss_config_updated_flag);
|
||||
}
|
||||
|
||||
}
|
||||
#if 0
|
||||
void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void)
|
||||
{
|
||||
sts_presence_rss_config.default_start_m = (float)(sts_cfg_nvm.p[RSS_CFG_START_M]*0.1f);
|
||||
|
@ -798,7 +807,7 @@ void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void)
|
|||
sts_rss_cfg_slid_win_threshold = (uint8_t)(sts_cfg_nvm.p[RSS_CFG_SLID_WIN])>>4;
|
||||
sts_rss_cfg_slid_win_size = (uint8_t)(sts_cfg_nvm.p[RSS_CFG_SLID_WIN])&0x0F;
|
||||
}
|
||||
|
||||
#endif
|
||||
void STS_PRESENCE_SENSOR_Init_Send_Data(void)
|
||||
{
|
||||
//sts_o7_sensorData.lamp_bar_color = STS_GREEN;
|
||||
|
@ -1060,9 +1069,13 @@ void STS_PRESENCE_SENSOR_RSS_Init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
void STS_PRESENCE_SENSOR_Distance_Measure_Process(void)
|
||||
void STS_PRESENCE_SENSOR_Distance_Measure_Process(uint16_t *rss_distance)
|
||||
{
|
||||
uint8_t exit_status = EXIT_SUCCESS, i=0;
|
||||
int exit_status = EXIT_SUCCESS, i=0;
|
||||
uint16_t tmp_distance=0;
|
||||
|
||||
|
||||
sts_presence_rss_detection_deinit();
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n ****start_m=%u length_m=%u profile=%u hwaas=%u \r\n",
|
||||
(unsigned int)(distance_cfg.start_m*1000),(unsigned int)(distance_cfg.length_m*1000),
|
||||
|
@ -1070,11 +1083,15 @@ void STS_PRESENCE_SENSOR_Distance_Measure_Process(void)
|
|||
do
|
||||
{
|
||||
LED1_TOGGLE;
|
||||
exit_status = sts_distance_rss_detector_distance();
|
||||
HAL_Delay(10);
|
||||
i++;
|
||||
} while ((exit_status == EXIT_FAILURE) && (i < 1));
|
||||
|
||||
// exit_status = sts_distance_rss_detector_distance();
|
||||
exit_status = sts_distance_rss_detector_distance(&tmp_distance);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n round: %d exit_status= %d Measured dist= %d \r\n", i, exit_status, tmp_distance);
|
||||
//HAL_Delay(250);
|
||||
i++;
|
||||
} while ((exit_status == EXIT_FAILURE) && (i < 3) && (tmp_distance !=0));
|
||||
|
||||
*rss_distance = tmp_distance;
|
||||
LED1_ON;
|
||||
|
||||
}
|
||||
|
@ -1082,7 +1099,7 @@ void STS_PRESENCE_SENSOR_Distance_Measure_Process(void)
|
|||
void STS_PRESENCE_SENSOR_Background_Measure_Process(uint16_t *bg_distance, uint16_t *bg_motion_noise)
|
||||
{
|
||||
|
||||
uint8_t previous_sts_work_mode = sts_work_mode, previous_sts_lamp_bar_color = sts_lamp_bar_color;
|
||||
uint8_t previous_sts_work_mode = sts_work_mode, previous_sts_lamp_bar_color = sts_lamp_bar_color, previous_sts_rss_config_updated_flag = sts_rss_config_updated_flag;
|
||||
uint16_t distance_center=0, motion_noise=0;
|
||||
|
||||
sts_work_mode = STS_RSS_BACKGROUND_MODE;
|
||||
|
@ -1090,7 +1107,8 @@ void STS_PRESENCE_SENSOR_Background_Measure_Process(uint16_t *bg_distance, uint1
|
|||
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n SCAN Background Noise ... \r\n");
|
||||
|
||||
sts_presence_rss_background_evaluation_process(&distance_center, &motion_noise);
|
||||
int ret=sts_presence_rss_background_evaluation_process(&distance_center, &motion_noise);
|
||||
if (ret== EXIT_FAILURE) return;
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "\r\n Background Distance center at %d mm, and Motion Noise =%d \r\n", distance_center, motion_noise);
|
||||
|
||||
|
@ -1099,48 +1117,56 @@ void STS_PRESENCE_SENSOR_Background_Measure_Process(uint16_t *bg_distance, uint1
|
|||
|
||||
sts_work_mode = previous_sts_work_mode;
|
||||
sts_lamp_bar_color = previous_sts_lamp_bar_color;
|
||||
sts_rss_config_updated_flag = previous_sts_rss_config_updated_flag|0x80;
|
||||
}
|
||||
|
||||
|
||||
void STS_PRESENCE_SENSOR_Function_Test_Process(uint8_t *self_test_result, uint8_t count)
|
||||
void STS_PRESENCE_SENSOR_Function_Test_Process(uint8_t *self_test_result, uint8_t *count)
|
||||
{
|
||||
uint8_t bring_up_result[18]={0};
|
||||
uint8_t previous_lamp_bar_color=sts_lamp_bar_color;
|
||||
uint16_t bg_range=0, bg_noise=0;
|
||||
int test_res=0;
|
||||
PME_ON;
|
||||
HAL_Init();
|
||||
MX_GPIO_Init();
|
||||
HAL_Delay(150); //wait for sensor ready
|
||||
|
||||
for (uint8_t i=0;i < count; i++) //while(1)
|
||||
for (uint8_t i=0;i < 1; i++) //while(1)
|
||||
{
|
||||
STS_Lamp_Bar_Self_Test_Simple();
|
||||
|
||||
STS_Lamp_Bar_Refresh();
|
||||
HAL_Delay(200);
|
||||
sts_lamp_bar_color = STS_PINK;
|
||||
sts_presence_rss_bring_up_test(bring_up_result);
|
||||
sts_presence_rss_detection_deinit();
|
||||
test_res = sts_presence_rss_bring_up_test(bring_up_result);
|
||||
if (test_res != EXIT_SUCCESS) {
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n Bring up test failed \r\n");
|
||||
} else {
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n Bring up test success \r\n");
|
||||
}
|
||||
|
||||
HAL_Delay(200);
|
||||
sts_lamp_bar_color = STS_CYAN;
|
||||
STS_PRESENCE_SENSOR_Distance_Measure_Process();
|
||||
uint16_t tmp_dist=0;
|
||||
STS_PRESENCE_SENSOR_Distance_Measure_Process(&tmp_dist);
|
||||
sts_sensor_install_height = tmp_dist;
|
||||
bring_up_result[12]=sts_sensor_install_height>>8&0xff;
|
||||
bring_up_result[13]=sts_sensor_install_height&0xff;
|
||||
|
||||
HAL_Delay(200);
|
||||
|
||||
HAL_Delay(50);
|
||||
sts_lamp_bar_color = STS_BLUE;
|
||||
STS_PRESENCE_SENSOR_Background_Measure_Process(&bg_range, &bg_noise);
|
||||
bring_up_result[14]=bg_range>>8&0xff;
|
||||
bring_up_result[15]=bg_range&0xff;
|
||||
bring_up_result[16]=bg_noise>>8&0xff;
|
||||
bring_up_result[17]=bg_noise&0xff;
|
||||
|
||||
|
||||
}
|
||||
HAL_Delay(200);
|
||||
HAL_Delay(50);
|
||||
sts_lamp_bar_color = previous_lamp_bar_color;
|
||||
|
||||
UTIL_MEM_cpy_8(self_test_result, bring_up_result, sizeof(bring_up_result));
|
||||
*count = sizeof(bring_up_result);
|
||||
UTIL_MEM_cpy_8((void*)self_test_result, (void*)bring_up_result, sizeof(bring_up_result));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -2041,8 +2041,9 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size)
|
|||
//STS_SENSOR_Upload_Message(LORAWAN_USER_APP_CTRL_REPLY_PORT, i, (uint8_t *)outbuf);
|
||||
|
||||
i=0;
|
||||
|
||||
UTIL_TIMER_Stop(&YunhornSTSRSSWakeUpTimer);
|
||||
STS_SENSOR_Function_Test_Process();
|
||||
UTIL_TIMER_Start(&YunhornSTSRSSWakeUpTimer);
|
||||
#if 0
|
||||
HAL_Delay(5000);
|
||||
i=21;
|
||||
|
@ -2065,10 +2066,10 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size)
|
|||
//outbuf[i++] = (uint8_t) 'Z';
|
||||
//outbuf[i++] = (uint8_t) 'D';
|
||||
//STS_SENSOR_Upload_Message(LORAWAN_USER_APP_CTRL_REPLY_PORT, i, (uint8_t *)outbuf);
|
||||
uint16_t rss_distance=0;
|
||||
STS_PRESENCE_SENSOR_Distance_Measure_Process(&rss_distance);
|
||||
|
||||
STS_SENSOR_Distance_Test_Process();
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "\r\nRSS Measured Distance=[%u] mm \r\n", (uint16_t)sts_distance_rss_distance);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nRSS Measured Distance=[%u] mm \r\n", (uint16_t)sts_distance_rss_distance);
|
||||
|
||||
// Store valid installation height value
|
||||
sts_cfg_nvm.mtmcode1 = (uint8_t)sts_mtmcode1;
|
||||
|
@ -2082,7 +2083,7 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size)
|
|||
|
||||
|
||||
i=0;
|
||||
//memset((void*)outbuf,0x0, sizeof(outbuf));
|
||||
memset((void*)outbuf,0x0, sizeof(outbuf));
|
||||
outbuf[i++] = (uint8_t)'D';
|
||||
outbuf[i++] = (uint8_t)sts_mtmcode1;
|
||||
outbuf[i++] = (uint8_t)sts_mtmcode2;
|
||||
|
@ -2612,21 +2613,22 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size)
|
|||
|
||||
case STS_REEDSWITCH_MODE:
|
||||
sts_cfg_nvm.sts_ioc_mask = STS_IOC_MODE_2_MASK;
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_NON;
|
||||
break;
|
||||
|
||||
case STS_RSS_MODE:
|
||||
sts_cfg_nvm.sts_ioc_mask = STS_IOC_MODE_3_MASK;
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_DEFAULT;
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_SIMPLE|0x80;
|
||||
break;
|
||||
|
||||
case STS_DUAL_MODE:
|
||||
sts_cfg_nvm.sts_ioc_mask = STS_IOC_MODE_4_MASK;
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_DEFAULT;
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_SIMPLE|0x80;
|
||||
break;
|
||||
|
||||
case STS_UNI_MODE:
|
||||
sts_cfg_nvm.sts_ioc_mask = STS_IOC_MODE_5_MASK;
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_FALL_DETECTION;
|
||||
sts_rss_config_updated_flag = STS_RSS_CONFIG_FALL_DETECTION|0x80;
|
||||
sts_presence_fall_detection=TRUE;
|
||||
break;
|
||||
|
||||
|
@ -2692,7 +2694,7 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size)
|
|||
|
||||
if (invalid_flag == 0)
|
||||
{
|
||||
sts_cfg_nvm.p[RSS_CFG_UPDATE_FLAG] = STS_RSS_CONFIG_FULL;
|
||||
sts_cfg_nvm.p[RSS_CFG_UPDATE_FLAG] = STS_RSS_CONFIG_FULL|0x80;
|
||||
|
||||
STS_PRESENCE_SENSOR_NVM_CFG();
|
||||
|
||||
|
@ -2737,8 +2739,9 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size)
|
|||
APP_LOG(TS_OFF, VLEVEL_M,"\r\nStart,Lenght,threshold,gain=%02x %02x %02x %02x \r\n",
|
||||
sts_cfg_nvm.p[RSS_CFG_START_M],sts_cfg_nvm.p[RSS_CFG_LENGTH_M],sts_cfg_nvm.p[RSS_CFG_THRESHOLD],sts_cfg_nvm.p[RSS_CFG_RECEIVER_GAIN]);
|
||||
|
||||
sts_cfg_nvm.p[RSS_CFG_UPDATE_FLAG] = STS_RSS_CONFIG_SIMPLE;
|
||||
STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE();
|
||||
sts_cfg_nvm.p[RSS_CFG_UPDATE_FLAG] = STS_RSS_CONFIG_SIMPLE|0x80;
|
||||
//STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE();
|
||||
STS_PRESENCE_SENSOR_NVM_CFG(); // update 2025 05 06
|
||||
|
||||
i=0; // Step 1: Prepare status update message
|
||||
UTIL_MEM_set_8((void*)outbuf, 0x0, sizeof(outbuf));
|
||||
|
@ -2859,9 +2862,9 @@ void STS_SENSOR_Upload_Message(uint8_t appDataPort, uint8_t appBufferSize, uint8
|
|||
//UTIL_MEM_cpy_8(AppData.Buffer, appDataBuffer, appBufferSize);
|
||||
|
||||
AppData.Port = appDataPort;
|
||||
AppData.BufferSize = (sts_service_mask >1 ?0:appBufferSize);
|
||||
AppData.BufferSize = ((sts_service_mask >1)? 0 :appBufferSize);
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "###########Service Mask = %d Buffer Size =%d \r\n", sts_service_mask, AppData.BufferSize);
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "###########Service Mask = %d Buffer Size =%d \r\n", sts_service_mask, AppData.BufferSize);
|
||||
|
||||
if ((JoinLedTimer.IsRunning) && (LmHandlerJoinStatus() == LORAMAC_HANDLER_SET))
|
||||
{
|
||||
|
@ -2874,25 +2877,26 @@ void STS_SENSOR_Upload_Message(uint8_t appDataPort, uint8_t appBufferSize, uint8
|
|||
status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
||||
if (LORAMAC_HANDLER_SUCCESS == status)
|
||||
{
|
||||
APP_LOG(TS_ON, VLEVEL_H, "SEND REQUEST\r\n");
|
||||
APP_LOG(TS_ON, VLEVEL_M, "SEND REQUEST\r\n");
|
||||
}
|
||||
else if (LORAMAC_HANDLER_DUTYCYCLE_RESTRICTED == status)
|
||||
{
|
||||
nextTxIn = LmHandlerGetDutyCycleWaitTime();
|
||||
if (nextTxIn > 0)
|
||||
{
|
||||
APP_LOG(TS_ON, VLEVEL_H, "Next Tx in : ~%d second(s)\r\n", (nextTxIn / 1000));
|
||||
APP_LOG(TS_ON, VLEVEL_M, "Next Tx in : ~%d second(s)\r\n", (nextTxIn / 1000));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (EventType == TX_ON_TIMER)
|
||||
{
|
||||
UTIL_TIMER_Stop(&TxTimer);
|
||||
UTIL_TIMER_SetPeriod(&TxTimer, MAX(nextTxIn, TxPeriodicity));
|
||||
UTIL_TIMER_Start(&TxTimer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OnStoreSTSCFGContextRequest(void)
|
||||
|
@ -3132,7 +3136,7 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
void STS_SENSOR_Distance_Test_Process(void)
|
||||
{
|
||||
#if defined(STS_O6)||defined(STS_O7)
|
||||
STS_PRESENCE_SENSOR_Distance_Measure_Process();
|
||||
//STS_PRESENCE_SENSOR_Distance_Measure_Process();
|
||||
#endif
|
||||
|
||||
#if defined(YUNHORN_STS_R0_ENABLED)||defined(YUNHORN_STS_R5_ENABLED)
|
||||
|
@ -3142,7 +3146,7 @@ void STS_SENSOR_Distance_Test_Process(void)
|
|||
|
||||
void STS_SENSOR_Function_Test_Process(void)
|
||||
{
|
||||
uint8_t tstbuf[128] ={0x0}; uint8_t i=0, count = 1;
|
||||
uint8_t tstbuf[128] ={0x0}; uint8_t i=0, count = 0;
|
||||
uint8_t mems_Dev_ID[2] = {0x0};
|
||||
|
||||
tstbuf[i++] = (uint8_t) 'S';
|
||||
|
@ -3164,10 +3168,10 @@ void STS_SENSOR_Function_Test_Process(void)
|
|||
#if defined(STS_O7)||defined(STS_O6)
|
||||
uint8_t self_test_result[18]={0x0};
|
||||
|
||||
STS_PRESENCE_SENSOR_Function_Test_Process(self_test_result, count);
|
||||
STS_PRESENCE_SENSOR_Function_Test_Process(self_test_result, &count);
|
||||
|
||||
for (uint8_t j=0; j < 18; j++)
|
||||
tstbuf[i++] = (uint8_t) (self_test_result[j])&0xff;
|
||||
for (uint8_t j=0; j < count; j++)
|
||||
tstbuf[i++] = (uint8_t) (self_test_result[j]&0xff);
|
||||
|
||||
//STS_PRESENCE_SENSOR_Distance_Measure_Process();
|
||||
#if 0
|
||||
|
@ -3199,7 +3203,7 @@ void STS_SENSOR_Function_Test_Process(void)
|
|||
}
|
||||
|
||||
//memset((void*)outbuf,0x0, sizeof(outbuf));
|
||||
UTIL_MEM_cpy_8((void*)outbuf, (void*)tstbuf, sizeof(tstbuf));
|
||||
UTIL_MEM_cpy_8((void*)outbuf, (void*)tstbuf, i);
|
||||
STS_SENSOR_Upload_Message(LORAWAN_USER_APP_CTRL_REPLY_PORT, i, (uint8_t*)outbuf);
|
||||
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue