Ble: hide pin code if device is locked (#1008)
This commit is contained in:
parent
da6e31b2bf
commit
966b400f8b
4
firmware/targets/f6/ble_glue/gap.c
Executable file → Normal file
4
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
|
||||
uint32_t pin = rand() % 999999;
|
||||
aci_gap_pass_key_resp(gap->service.connection_handle, 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};
|
||||
gap->on_event_cb(event, gap->context);
|
||||
} break;
|
||||
|
4
firmware/targets/f7/ble_glue/gap.c
Executable file → Normal file
4
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
|
||||
uint32_t pin = rand() % 999999;
|
||||
aci_gap_pass_key_resp(gap->service.connection_handle, 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};
|
||||
gap->on_event_cb(event, gap->context);
|
||||
} break;
|
||||
|
Loading…
Reference in New Issue
Block a user