mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +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){
|
static void stdin_process(char c){
|
||||||
// passkey input
|
// passkey input
|
||||||
if (ui_digits_for_passkey){
|
if (ui_digits_for_passkey && c >= '0' && c <= '9'){
|
||||||
if (c < '0' || c > '9') return;
|
|
||||||
printf("%c", c);
|
printf("%c", c);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
ui_passkey = ui_passkey * 10 + c - '0';
|
ui_passkey = ui_passkey * 10 + c - '0';
|
||||||
@ -322,9 +321,6 @@ static void stdin_process(char c){
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
sm_keypress_notification(connection_handle, SM_KEYPRESS_PASSKEY_ENTRY_COMPLETED);
|
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);
|
sm_passkey_input(connection_handle, ui_passkey);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -205,7 +205,10 @@ def run(test_descriptor, nodes):
|
|||||||
else:
|
else:
|
||||||
test_descriptor['waiting_node'].write(test_descriptor['passkey'])
|
test_descriptor['waiting_node'].write(test_descriptor['passkey'])
|
||||||
elif line.startswith('PASSKEY_INPUT_NUMBER'):
|
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'])
|
node.write(test_descriptor['passkey'])
|
||||||
else:
|
else:
|
||||||
test_descriptor['waiting_node'] = node
|
test_descriptor['waiting_node'] = node
|
||||||
|
Loading…
x
Reference in New Issue
Block a user