test/le_audio: stop sending on exit

This commit is contained in:
Matthias Ringwald 2022-07-04 14:28:30 +02:00
parent 5ade665741
commit b9b9e477fc
2 changed files with 10 additions and 2 deletions

View File

@ -271,7 +271,8 @@ static enum {
APP_IDLE,
APP_W4_PERIODIC_ENABLED,
APP_W4_CREATE_BIG_COMPLETE,
APP_STREAMING
APP_STREAMING,
APP_W4_POWER_OFF,
} app_state = APP_IDLE;
// enumerate default codec configs
@ -457,6 +458,8 @@ static void encode_and_send(uint8_t bis_index){
}
static void try_send(void){
if (app_state != APP_STREAMING) return;
bool all_can_send = true;
uint8_t i;
for (i=0; i<num_bis;i++) {
@ -707,6 +710,7 @@ static void stdin_process(char c){
}
#endif
printf("Shutdown...\n");
app_state = APP_W4_POWER_OFF;
hci_power_control(HCI_POWER_OFF);
break;
case 's':

View File

@ -187,7 +187,8 @@ static enum {
APP_IDLE,
APP_W4_CIS_COMPLETE,
APP_SET_ISO_PATH,
APP_STREAMING
APP_STREAMING,
APP_W4_POWER_OFF,
} app_state = APP_W4_WORKING;
// enumerate default codec configs
@ -378,6 +379,8 @@ static void encode_and_send(uint8_t cis_index){
}
static void try_send(void){
if (app_state != APP_STREAMING) return;
bool all_can_send = true;
uint8_t i;
for (i=0; i < num_cis; i++) {
@ -653,6 +656,7 @@ static void stdin_process(char c){
}
#endif
printf("Shutdown...\n");
app_state = APP_W4_POWER_OFF;
hci_power_control(HCI_POWER_OFF);
break;
case 's':