mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-22 06:41:17 +00:00
pts/sm_test: trigger passkey entry failed by decline bonding
This commit is contained in:
parent
45a7413e73
commit
aeb1d7dba0
@ -311,8 +311,7 @@ static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *
|
||||
|
||||
static void stdin_process(char c){
|
||||
// passkey input
|
||||
if (ui_digits_for_passkey){
|
||||
if (c < '0' || c > '9') return;
|
||||
if (ui_digits_for_passkey && c >= '0' && c <= '9'){
|
||||
printf("%c", c);
|
||||
fflush(stdout);
|
||||
ui_passkey = ui_passkey * 10 + c - '0';
|
||||
@ -322,9 +321,6 @@ static void stdin_process(char c){
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
sm_keypress_notification(connection_handle, SM_KEYPRESS_PASSKEY_ENTRY_COMPLETED);
|
||||
if (sm_failure == SM_REASON_PASSKEY_ENTRY_FAILED){
|
||||
ui_passkey--;
|
||||
}
|
||||
sm_passkey_input(connection_handle, ui_passkey);
|
||||
}
|
||||
return;
|
||||
|
@ -205,7 +205,10 @@ def run(test_descriptor, nodes):
|
||||
else:
|
||||
test_descriptor['waiting_node'].write(test_descriptor['passkey'])
|
||||
elif line.startswith('PASSKEY_INPUT_NUMBER'):
|
||||
if state == 'W4_PASSKEY_INPUT':
|
||||
if node.get_name() == 'tester' and test_descriptor['tester_failure'] == '1':
|
||||
print('Decline bonding')
|
||||
node.write('d')
|
||||
elif state == 'W4_PASSKEY_INPUT':
|
||||
node.write(test_descriptor['passkey'])
|
||||
else:
|
||||
test_descriptor['waiting_node'] = node
|
||||
|
Loading…
x
Reference in New Issue
Block a user