posix-h4 variants: exit on power on failure

This commit is contained in:
Matthias Ringwald 2025-04-08 14:54:56 +02:00
parent e2b82ad20f
commit 2a12b8fc42
9 changed files with 36 additions and 0 deletions

View File

@ -150,6 +150,10 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
bd_addr_t addr;
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)){
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case HCI_EVENT_COMMAND_COMPLETE:
switch (hci_event_command_complete_get_command_opcode(packet)) {
case HCI_OPCODE_HCI_READ_LOCAL_VERSION_INFORMATION:

View File

@ -100,6 +100,10 @@ static btstack_packet_callback_registration_t hci_event_callback_registration;
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)){
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case BTSTACK_EVENT_STATE:
switch(btstack_event_state_get_state(packet)){
case HCI_STATE_WORKING:

View File

@ -96,6 +96,10 @@ static btstack_packet_callback_registration_t hci_event_callback_registration;
static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) {
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)) {
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case BTSTACK_EVENT_STATE:
switch (btstack_event_state_get_state(packet)) {
case HCI_STATE_WORKING:

View File

@ -96,6 +96,10 @@ static hci_transport_config_uart_t transport_config = {
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)){
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case BTSTACK_EVENT_STATE:
switch(btstack_event_state_get_state(packet)){
case HCI_STATE_WORKING:

View File

@ -96,6 +96,10 @@ static btstack_packet_callback_registration_t hci_event_callback_registration;
static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) {
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)) {
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case BTSTACK_EVENT_STATE:
switch (btstack_event_state_get_state(packet)) {
case HCI_STATE_WORKING:

View File

@ -102,6 +102,10 @@ static btstack_packet_callback_registration_t hci_event_callback_registration;
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)){
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case BTSTACK_EVENT_STATE:
switch(btstack_event_state_get_state(packet)){
case HCI_STATE_WORKING:

View File

@ -93,6 +93,10 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
const uint8_t *params;
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)){
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case BTSTACK_EVENT_STATE:
switch(btstack_event_state_get_state(packet)){
case HCI_STATE_WORKING:

View File

@ -109,6 +109,10 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
const uint8_t *params;
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)){
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case BTSTACK_EVENT_STATE:
switch(btstack_event_state_get_state(packet)){
case HCI_STATE_WORKING:

View File

@ -152,6 +152,10 @@ static void local_version_information_handler(uint8_t * packet){
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
if (packet_type != HCI_EVENT_PACKET) return;
switch (hci_event_packet_get_type(packet)){
case BTSTACK_EVENT_POWERON_FAILED:
printf("Terminating.\n");
exit(EXIT_FAILURE);
break;
case BTSTACK_EVENT_STATE:
switch(btstack_event_state_get_state(packet)){
case HCI_STATE_WORKING: