handle SDP query error

This commit is contained in:
Milanka Ringwald 2017-08-22 11:11:10 +02:00
parent 47b082e6f6
commit 6dbf1f9ab2
4 changed files with 22 additions and 2 deletions

View File

@ -257,7 +257,11 @@ static void handle_sdp_client_query_result(uint8_t packet_type, uint16_t channel
}
break;
case SDP_EVENT_QUERY_COMPLETE:
printf("General query done with status %d.\n\n", sdp_event_query_complete_get_status(packet));
if (sdp_event_query_complete_get_status(packet)){
printf("SDP query failed 0x%02x\n", sdp_event_query_complete_get_status(packet));
break;
}
printf("SDP query done.\n");
break;
}
/* LISTING_RESUME */

View File

@ -162,7 +162,11 @@ static void handle_sdp_client_query_result(uint8_t packet_type, uint16_t channel
}
break;
case SDP_EVENT_QUERY_COMPLETE:
printf("General query done with status %d.\n\n", sdp_event_query_complete_get_status(packet));
if (sdp_event_query_complete_get_status(packet)){
printf("SDP query failed 0x%02x\n", sdp_event_query_complete_get_status(packet));
break;
}
printf("SDP query done.\n");
break;
}
}

View File

@ -120,6 +120,11 @@ static void handle_query_rfcomm_event(uint8_t packet_type, uint16_t channel, uin
sdp_event_query_rfcomm_service_get_rfcomm_channel(packet));
break;
case SDP_EVENT_QUERY_COMPLETE:
if (sdp_event_query_complete_get_status(packet)){
printf("SDP query failed 0x%02x\n", sdp_event_query_complete_get_status(packet));
break;
}
printf("SDP query done.\n");
report_found_services();
break;
}

View File

@ -179,6 +179,13 @@ static void goep_client_handle_query_rfcomm_event(uint8_t packet_type, uint16_t
goep_client->bearer_port = sdp_event_query_rfcomm_service_get_rfcomm_channel(packet);
break;
case SDP_EVENT_QUERY_COMPLETE:
if (sdp_event_query_complete_get_status(packet)){
log_info("GOEP client, SDP query failed 0x%02x", sdp_event_query_complete_get_status(packet));
goep_client->state = GOEP_INIT;
goep_client_emit_connected_event(goep_client, sdp_event_query_complete_get_status(packet));
break;
}
if (goep_client->bearer_port == 0){
log_info("Remote GOEP RFCOMM Server Channel not found");
goep_client->state = GOEP_INIT;