minor update
This commit is contained in:
parent
56e0b1540b
commit
18ac578373
|
@ -17,6 +17,7 @@
|
|||
#include "cmox_low_level.h"
|
||||
#include "stm32wlxx_hal.h"
|
||||
#include "sts_cmox_hmac_sha.h"
|
||||
#include "yunhorn_sts_prd_conf.h"
|
||||
#include "sys_app.h"
|
||||
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
|
@ -27,8 +28,8 @@ const uint8_t mKey[] =
|
|||
0x59,0x75,0x33,0x6e,0x31,0x48,0x34,0x4f,0x31,0x52,0x35,0x4e,0x39,0x53,0x32,0x54,0x36,0x53
|
||||
};
|
||||
|
||||
uint8_t Computed_Tag_SHA1[20]={0x0};
|
||||
extern volatile uint8_t sts_ac_code[20];
|
||||
uint8_t Computed_Tag_SHA1[YUNHORN_STS_AC_CODE_SIZE]={0x0};
|
||||
extern volatile uint8_t sts_ac_code[YUNHORN_STS_AC_CODE_SIZE];
|
||||
hmac_result_t hmac_result;
|
||||
|
||||
uint32_t sts_hmac_verify(void)
|
||||
|
@ -39,7 +40,7 @@ uint32_t sts_hmac_verify(void)
|
|||
hmac_result.ac_pass = 60;
|
||||
hmac_result.hmac_tag_size = 0;
|
||||
GetUniqueId(uid);
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "\r\nUID=%02x %02x %02x %02x\r\n",uid[4],uid[5],uid[6],uid[7]);
|
||||
|
||||
ret = sts_hmac_sha1((const uint8_t *) mKey, sizeof(mKey), (const uint8_t*)(uid+4), 4, &hmac_result);
|
||||
for (i=0;i<sizeof(Computed_Tag_SHA1); i++) {
|
||||
APP_LOG(TS_OFF,VLEVEL_H,"0x%02x ", hmac_result.hmac_tag[i]);
|
||||
|
|
|
@ -45,12 +45,13 @@
|
|||
|
||||
/* External variables ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EV */
|
||||
extern volatile uint8_t sts_service_mask;
|
||||
extern volatile uint32_t rfac_timer;
|
||||
volatile uint8_t sts_ac_code[YUNHORN_STS_AC_CODE_SIZE]={0x0};
|
||||
extern hmac_result_t hmac_result;
|
||||
extern volatile uint8_t sts_reed_hall_ext_int;
|
||||
extern volatile uint8_t sts_work_mode, sts_cloud_netcolor, sts_lamp_bar_color, sts_status_color;
|
||||
extern volatile uint8_t sts_service_mask;
|
||||
|
||||
volatile uint8_t sts_fall_detection_acc_threshold = 10, sts_fall_detection_depth_threshold=30, sts_occupancy_overtime_threshold=20;
|
||||
extern volatile uint32_t event_start_time, event_stop_time;
|
||||
volatile uint8_t sts_occupancy_overtime_state = 0;
|
||||
|
|
Reference in New Issue