DEFAULT_PASSKEY 매크로 통합 + advertising_start 조건 변경
- 본딩 삭제가 실행되지 않는 버그 개선
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include "nrf_delay.h"
|
#include "nrf_delay.h"
|
||||||
#include "dr_piezo.h"
|
#include "dr_piezo.h"
|
||||||
#include "dr_util.h"
|
#include "dr_util.h"
|
||||||
|
#include "main.h"
|
||||||
#include "dr_adc121s051.h"
|
#include "dr_adc121s051.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ extern void param_error(const char *cmd); /* 파라미터 오류 시 BLE로
|
|||||||
|
|
||||||
/* BLE 바이너리 전송 함수 */
|
/* BLE 바이너리 전송 함수 */
|
||||||
extern void single_format_data(uint8_t *buffer, const char *tag, uint16_t value); /* TAG(4바이트) + uint16 값(2바이트)을 buffer에 포맷팅 */
|
extern void single_format_data(uint8_t *buffer, const char *tag, uint16_t value); /* TAG(4바이트) + uint16 값(2바이트)을 buffer에 포맷팅 */
|
||||||
extern void ascii_format_data(uint8_t *buffer, const char *tag, const char *ascii, uint8_t len); /* TAG(4바이트) + ASCII 문자열을 buffer에 포맷팅 */
|
extern void ascii_format_data(uint8_t *buffer, const char *tag, const char *ascii, size_t len); /* TAG(4바이트) + ASCII 문자열을 buffer에 포맷팅 */
|
||||||
extern void dr_binary_tx_safe(const uint8_t *buffer, uint16_t length); /* BLE NUS를 통해 바이너리 데이터 전송 (length는 워드 단위) */
|
extern void dr_binary_tx_safe(const uint8_t *buffer, uint16_t length); /* BLE NUS를 통해 바이너리 데이터 전송 (length는 워드 단위) */
|
||||||
extern volatile bool data_tx_in_progress; /* BLE TX 진행 중 플래그 */
|
extern volatile bool data_tx_in_progress; /* BLE TX 진행 중 플래그 */
|
||||||
extern void dr_sd_delay_ms(uint32_t ms); /* SoftDevice 호환 딜레이 (BLE 스택 이벤트 처리 허용) */
|
extern void dr_sd_delay_ms(uint32_t ms); /* SoftDevice 호환 딜레이 (BLE 스택 이벤트 처리 허용) */
|
||||||
@@ -663,7 +664,7 @@ static int Cmd_mss(const ParsedCmd *cmd)
|
|||||||
static int Cmd_mfv(const ParsedCmd *cmd)
|
static int Cmd_mfv(const ParsedCmd *cmd)
|
||||||
{
|
{
|
||||||
(void)cmd;
|
(void)cmd;
|
||||||
ascii_format_data(ble_bin_buffer, "rfv:", DR_DEVICE_VERSION, 12);
|
ascii_format_data(ble_bin_buffer, "rfv:", FIRMWARE_VERSION, 12);
|
||||||
dr_binary_tx_safe(ble_bin_buffer, 8); /* 4(TAG) + 12(버전) = 16바이트 = 8워드 */
|
dr_binary_tx_safe(ble_bin_buffer, 8); /* 4(TAG) + 12(버전) = 16바이트 = 8워드 */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------
|
||||||
* 기본 버전 정보 (FDS 초기값 및 빈 필드 복구 시 사용)
|
* 기본 버전 정보 (FDS 기본값 및 빈 필드 복구 시 사용)
|
||||||
*
|
*
|
||||||
* 하드웨어 식별 코드
|
* 하드웨어 식별 코드
|
||||||
* - VBTHW0100 = 개발(시험)용 Ver 1.00
|
* - VBTHW0100 = 개발(시험)용 Ver 1.00
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ static void load_default_config(void)
|
|||||||
memcpy(SERIAL_NO, SERIAL_NUMBER, strlen(SERIAL_NUMBER));
|
memcpy(SERIAL_NO, SERIAL_NUMBER, strlen(SERIAL_NUMBER));
|
||||||
|
|
||||||
memset(m_static_passkey, 0, PASSKEY_LENGTH);
|
memset(m_static_passkey, 0, PASSKEY_LENGTH);
|
||||||
memcpy(m_static_passkey, "123456", PASSKEY_LENGTH);
|
memcpy(m_static_passkey, DEFAULT_PASSKEY, PASSKEY_LENGTH);
|
||||||
|
|
||||||
m_reset_status = 1;
|
m_reset_status = 1;
|
||||||
bond_data_delete = 1;
|
bond_data_delete = 1;
|
||||||
@@ -1597,7 +1597,7 @@ static void main_s(void * p_context)
|
|||||||
nrf_delay_ms(100);
|
nrf_delay_ms(100);
|
||||||
bond_data_delete = true;
|
bond_data_delete = true;
|
||||||
m_config.bond_data_delete = (uint8_t)bond_data_delete;
|
m_config.bond_data_delete = (uint8_t)bond_data_delete;
|
||||||
const char pass_init[PASSKEY_LENGTH] = "123456";
|
const char pass_init[PASSKEY_LENGTH] = DEFAULT_PASSKEY;
|
||||||
memcpy(m_config.static_passkey, pass_init, PASSKEY_LENGTH);
|
memcpy(m_config.static_passkey, pass_init, PASSKEY_LENGTH);
|
||||||
config_save();
|
config_save();
|
||||||
nrf_delay_ms(1000);
|
nrf_delay_ms(1000);
|
||||||
@@ -1613,7 +1613,7 @@ static void main_s(void * p_context)
|
|||||||
battery_timer_start();
|
battery_timer_start();
|
||||||
|
|
||||||
#if FEATURE_SECURE_CONNECTION
|
#if FEATURE_SECURE_CONNECTION
|
||||||
advertising_start(erase_bonds);
|
advertising_start(erase_bonds || bond_data_delete);
|
||||||
#else
|
#else
|
||||||
advertising_start();
|
advertising_start();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user