Aplog downloading via mavlink in C++

Hi all,

Recently I have been working on downloading of ardupilot log stored in pixhawks sd card, the flow/ steps that i have followed in downloading the logs contained in pixhawk are as follows,

  1. list the logs (used “mavlink_log_request_list_t” message to request for list of logs)
  2. Get the total no. of logs
  3. Using that total no. in a loop till the end of all listed logs and sending the current iterator no. in loop to as the log id to download the specific log (used “mavlink_log_request_data_t” message to request for the log data)

Now, issue is that the program is able to download all the listed logs till 77 but not beyond that, even though it is sending a message to download the log, the pixhawk is not giving any response.

sample code:

void log_request_list()
{
mavlink_log_request_list_t request_list = { 0 };
request_list.target_system = system_id;
request_list.target_component = autopilot_id;
request_list.start = 0;
request_list.end = 0xffff;

mavlink_message_t message_request_list;
mavlink_msg_log_request_list_encode(system_id,autopilot_id,

&message_request_list,&request_list);
printf(“\nList all logs…\n\n”);
send_message(message_request_list);
}

void log_request_data(int log_number) //log number will be obtained from the iterator
{
mavlink_log_request_data_t request_data = { 0 };
request_data.target_system = system_id;
request_data.target_component = autopilot_id;
request_data.id = log_number;
request_data.ofs = 0;
request_data.count = 0xFFFFFFFF;

    mavlink_message_t message_request_data;
    mavlink_msg_log_request_data_encode(system_id, autopilot_id, &message_request_data, &request_data);

send_message(message_request_data);
}