Ble: hide pin code if device is locked (#1008)
This commit is contained in:
parent
da6e31b2bf
commit
966b400f8b
6
firmware/targets/f6/ble_glue/gap.c
Executable file → Normal file
6
firmware/targets/f6/ble_glue/gap.c
Executable file → Normal file
@ -186,7 +186,11 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void* pckt) {
|
|||||||
// Generate random PIN code
|
// Generate random PIN code
|
||||||
uint32_t pin = rand() % 999999;
|
uint32_t pin = rand() % 999999;
|
||||||
aci_gap_pass_key_resp(gap->service.connection_handle, pin);
|
aci_gap_pass_key_resp(gap->service.connection_handle, pin);
|
||||||
FURI_LOG_I(TAG, "Pass key request event. Pin: %06d", pin);
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||||
|
FURI_LOG_I(TAG, "Pass key request event. Pin: ******");
|
||||||
|
} else {
|
||||||
|
FURI_LOG_I(TAG, "Pass key request event. Pin: %06d", pin);
|
||||||
|
}
|
||||||
GapEvent event = {.type = GapEventTypePinCodeShow, .data.pin_code = pin};
|
GapEvent event = {.type = GapEventTypePinCodeShow, .data.pin_code = pin};
|
||||||
gap->on_event_cb(event, gap->context);
|
gap->on_event_cb(event, gap->context);
|
||||||
} break;
|
} break;
|
||||||
|
6
firmware/targets/f7/ble_glue/gap.c
Executable file → Normal file
6
firmware/targets/f7/ble_glue/gap.c
Executable file → Normal file
@ -186,7 +186,11 @@ SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void* pckt) {
|
|||||||
// Generate random PIN code
|
// Generate random PIN code
|
||||||
uint32_t pin = rand() % 999999;
|
uint32_t pin = rand() % 999999;
|
||||||
aci_gap_pass_key_resp(gap->service.connection_handle, pin);
|
aci_gap_pass_key_resp(gap->service.connection_handle, pin);
|
||||||
FURI_LOG_I(TAG, "Pass key request event. Pin: %06d", pin);
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||||
|
FURI_LOG_I(TAG, "Pass key request event. Pin: ******");
|
||||||
|
} else {
|
||||||
|
FURI_LOG_I(TAG, "Pass key request event. Pin: %06d", pin);
|
||||||
|
}
|
||||||
GapEvent event = {.type = GapEventTypePinCodeShow, .data.pin_code = pin};
|
GapEvent event = {.type = GapEventTypePinCodeShow, .data.pin_code = pin};
|
||||||
gap->on_event_cb(event, gap->context);
|
gap->on_event_cb(event, gap->context);
|
||||||
} break;
|
} break;
|
||||||
|
Loading…
Reference in New Issue
Block a user