mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-07 09:55:45 +00:00
spp_streamer: disable page/inquiry scan during test
This commit is contained in:
parent
e2b367a767
commit
5aed585b77
@ -213,6 +213,11 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
||||||
|
// re-enable page/inquiry scan again
|
||||||
|
gap_discoverable_control(1);
|
||||||
|
gap_connectable_control(1);
|
||||||
|
// re-enable advertisements
|
||||||
|
gap_advertisements_enable(1);
|
||||||
le_notification_enabled = 0;
|
le_notification_enabled = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -261,6 +266,12 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
|||||||
spp_test_data_len = sizeof(test_data);
|
spp_test_data_len = sizeof(test_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable page/inquiry scan to get max performance
|
||||||
|
gap_discoverable_control(0);
|
||||||
|
gap_connectable_control(0);
|
||||||
|
// disable advertisements
|
||||||
|
gap_advertisements_enable(0);
|
||||||
|
|
||||||
test_reset();
|
test_reset();
|
||||||
rfcomm_request_can_send_now_event(rfcomm_cid);
|
rfcomm_request_can_send_now_event(rfcomm_cid);
|
||||||
}
|
}
|
||||||
@ -324,6 +335,11 @@ static int att_write_callback(hci_con_handle_t con_handle, uint16_t att_handle,
|
|||||||
if (le_notification_enabled){
|
if (le_notification_enabled){
|
||||||
att_server_request_can_send_now_event(le_connection_handle);
|
att_server_request_can_send_now_event(le_connection_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable page/inquiry scan to get max performance
|
||||||
|
gap_discoverable_control(0);
|
||||||
|
gap_connectable_control(0);
|
||||||
|
|
||||||
test_reset();
|
test_reset();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -185,6 +185,10 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
|||||||
spp_test_data_len = sizeof(test_data);
|
spp_test_data_len = sizeof(test_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable page/inquiry scan to get max performance
|
||||||
|
gap_discoverable_control(0);
|
||||||
|
gap_connectable_control(0);
|
||||||
|
|
||||||
test_reset();
|
test_reset();
|
||||||
rfcomm_request_can_send_now_event(rfcomm_cid);
|
rfcomm_request_can_send_now_event(rfcomm_cid);
|
||||||
}
|
}
|
||||||
@ -197,6 +201,10 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
|||||||
case RFCOMM_EVENT_CHANNEL_CLOSED:
|
case RFCOMM_EVENT_CHANNEL_CLOSED:
|
||||||
printf("RFCOMM channel closed\n");
|
printf("RFCOMM channel closed\n");
|
||||||
rfcomm_cid = 0;
|
rfcomm_cid = 0;
|
||||||
|
|
||||||
|
// re-enable page/inquiry scan again
|
||||||
|
gap_discoverable_control(1);
|
||||||
|
gap_connectable_control(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -172,14 +172,19 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
|||||||
rfcomm_mtu = rfcomm_event_channel_opened_get_max_frame_size(packet);
|
rfcomm_mtu = rfcomm_event_channel_opened_get_max_frame_size(packet);
|
||||||
printf("RFCOMM channel open succeeded. New RFCOMM Channel ID %u, max frame size %u\n", rfcomm_cid, rfcomm_mtu);
|
printf("RFCOMM channel open succeeded. New RFCOMM Channel ID %u, max frame size %u\n", rfcomm_cid, rfcomm_mtu);
|
||||||
test_reset();
|
test_reset();
|
||||||
// disable page and inquiry scan
|
|
||||||
|
// disable page/inquiry scan to get max performance
|
||||||
|
gap_discoverable_control(0);
|
||||||
gap_connectable_control(0);
|
gap_connectable_control(0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RFCOMM_EVENT_CHANNEL_CLOSED:
|
case RFCOMM_EVENT_CHANNEL_CLOSED:
|
||||||
printf("RFCOMM channel closed\n");
|
printf("RFCOMM channel closed\n");
|
||||||
rfcomm_cid = 0; // re-enable page scan
|
rfcomm_cid = 0;
|
||||||
|
|
||||||
|
// re-enable page/inquiry scan again
|
||||||
|
gap_discoverable_control(1);
|
||||||
gap_connectable_control(1);
|
gap_connectable_control(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user