mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
pbap_client: fix get vcard list if SRM is not used, fix null dereference in log_info
This commit is contained in:
parent
cabf004e5f
commit
7c27908812
@ -409,9 +409,9 @@ static void pbap_handle_can_send_now(void){
|
||||
if (i){
|
||||
goep_client_add_header_application_parameters(pbap_client->goep_cid, i, &application_parameters[0]);
|
||||
}
|
||||
pbap_client->state = PBAP_W4_GET_CARD_LIST_COMPLETE;
|
||||
}
|
||||
// send packet
|
||||
pbap_client->state = PBAP_W4_GET_CARD_LIST_COMPLETE;
|
||||
pbap_client->request_number++;
|
||||
goep_client_execute(pbap_client->goep_cid);
|
||||
break;
|
||||
@ -460,12 +460,11 @@ static void pbap_handle_can_send_now(void){
|
||||
pbap_client->set_path_offset++;
|
||||
}
|
||||
|
||||
// detect end of path (after setting path_element)
|
||||
if (pbap_client->current_folder[pbap_client->set_path_offset] == '\0'){
|
||||
pbap_client->current_folder = NULL;
|
||||
}
|
||||
// done?
|
||||
int done = pbap_client->current_folder[pbap_client->set_path_offset] == '\0';
|
||||
|
||||
log_info("Path element '%s', done %u", path_element, pbap_client->current_folder == NULL);
|
||||
// status
|
||||
log_info("Path element '%s', done %u", path_element, done);
|
||||
|
||||
goep_client_create_set_path_request(pbap_client->goep_cid, 1 << 1); // Don’t create directory
|
||||
goep_client_add_header_name(pbap_client->goep_cid, (const char *) path_element); // next element
|
||||
@ -656,12 +655,13 @@ static void pbap_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *
|
||||
break;
|
||||
case PBAP_W4_SET_PATH_ROOT_COMPLETE:
|
||||
case PBAP_W4_SET_PATH_ELEMENT_COMPLETE:
|
||||
log_info("set path root/path element complete, current folder %s, path offset %u", pbap_client->current_folder, pbap_client->set_path_offset);
|
||||
if (packet[0] == OBEX_RESP_SUCCESS){
|
||||
if (pbap_client->current_folder){
|
||||
// more path?
|
||||
if (pbap_client->current_folder[pbap_client->set_path_offset]){
|
||||
pbap_client->state = PBAP_W2_SET_PATH_ELEMENT;
|
||||
goep_client_request_can_send_now(pbap_client->goep_cid);
|
||||
} else {
|
||||
pbap_client->current_folder = NULL;
|
||||
pbap_client->state = PBAP_CONNECTED;
|
||||
pbap_client_emit_operation_complete_event(pbap_client, 0);
|
||||
}
|
||||
@ -814,10 +814,10 @@ static void pbap_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
pbap_client->state = PBAP_CONNECTED;
|
||||
pbap_client_emit_operation_complete_event(pbap_client, 0);
|
||||
}
|
||||
//
|
||||
pbap_client->state = PBAP_CONNECTED;
|
||||
pbap_client_emit_operation_complete_event(pbap_client, 0);
|
||||
break;
|
||||
case OBEX_RESP_NOT_ACCEPTABLE:
|
||||
pbap_client->state = PBAP_CONNECTED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user