Exemplo n.º 1
0
void mip_gps_dgps_channel_status_byteswap(mip_gps_dgps_channel_status *dgps_channel_status)
{
 byteswap_inplace(&dgps_channel_status->age,                         sizeof(float));
 byteswap_inplace(&dgps_channel_status->pseudorange_correction,      sizeof(float));
 byteswap_inplace(&dgps_channel_status->pseudorange_rate_correction, sizeof(float));
 byteswap_inplace(&dgps_channel_status->valid_flags,                 sizeof(u16));
}
Exemplo n.º 2
0
void mip_gps_clock_info_byteswap(mip_gps_clock_info *clock_info)
{
 byteswap_inplace(&clock_info->bias,              sizeof(double));
 byteswap_inplace(&clock_info->drift,             sizeof(double));
 byteswap_inplace(&clock_info->accuracy_estimate, sizeof(double));
 byteswap_inplace(&clock_info->valid_flags,       sizeof(u16));
}
Exemplo n.º 3
0
void mip_ahrs_signal_settings_byteswap(mip_ahrs_signal_settings *signal_settings)
{
 byteswap_inplace(&signal_settings->orientation_decimation,  sizeof(u16));
 byteswap_inplace(&signal_settings->data_conditioning_flags, sizeof(u16));
 byteswap_inplace(&signal_settings->up_compensation,         sizeof(u16));
 byteswap_inplace(&signal_settings->north_compensation,      sizeof(u16));
 byteswap_inplace(&signal_settings->reserved,                sizeof(u16));
}
Exemplo n.º 4
0
void mip_gps_sv_info_byteswap(mip_gps_sv_info *sv_info)
{
 byteswap_inplace(&sv_info->carrier_noise_ratio, sizeof(u16));
 byteswap_inplace(&sv_info->azimuth,             sizeof(s16));
 byteswap_inplace(&sv_info->elevation,           sizeof(s16));
 byteswap_inplace(&sv_info->sv_flags,            sizeof(u16));
 byteswap_inplace(&sv_info->valid_flags,         sizeof(u16));
}
Exemplo n.º 5
0
void mip_gps_dgps_info_byteswap(mip_gps_dgps_info *dgps_info)
{
 byteswap_inplace(&dgps_info->age,                 sizeof(float));
 byteswap_inplace(&dgps_info->base_station_id,     sizeof(s16));
 byteswap_inplace(&dgps_info->base_station_status, sizeof(s16));
 byteswap_inplace(&dgps_info->num_dgps_channels,   sizeof(u16));
 byteswap_inplace(&dgps_info->valid_flags,         sizeof(u16));
}
Exemplo n.º 6
0
void mip_gps_ecef_pos_byteswap(mip_gps_ecef_pos *ecef_pos)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&ecef_pos->x[i],       sizeof(double));
 
 byteswap_inplace(&ecef_pos->x_accuracy,  sizeof(float));
 byteswap_inplace(&ecef_pos->valid_flags, sizeof(u16));
}
Exemplo n.º 7
0
void mip_gps_ecef_vel_byteswap(mip_gps_ecef_vel *ecef_vel)
{ 
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&ecef_vel->v[i],       sizeof(float));
 
 byteswap_inplace(&ecef_vel->v_accuracy,  sizeof(float));
 byteswap_inplace(&ecef_vel->valid_flags, sizeof(u16));
}
Exemplo n.º 8
0
void mip_ahrs_quaternion_byteswap(mip_ahrs_quaternion *quaternion)
{
 u8 i;

 for(i=0; i<4; i++)
  byteswap_inplace(&quaternion->q[i], sizeof(float));
}
Exemplo n.º 9
0
void mip_ahrs_delta_velocity_byteswap(mip_ahrs_delta_velocity *delta_velocity)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&delta_velocity->delta_velocity[i], sizeof(float));
}
Exemplo n.º 10
0
void mip_ahrs_delta_theta_byteswap(mip_ahrs_delta_theta *delta_theta)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&delta_theta->delta_theta[i], sizeof(float));
}
Exemplo n.º 11
0
void mip_ahrs_raw_temp_byteswap(mip_ahrs_raw_temp *raw_temp)
{
 u8 i;

 for(i=0; i<4; i++)
  byteswap_inplace(&raw_temp->raw_temp, sizeof(u16));
}
Exemplo n.º 12
0
void mip_ahrs_raw_gyro_byteswap(mip_ahrs_raw_gyro *raw_gyro)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&raw_gyro->raw_gyro[i], sizeof(float));
}
Exemplo n.º 13
0
void mip_ahrs_north_vector_byteswap(mip_ahrs_north_vector *north_vector)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&north_vector->north, sizeof(float));
}
u16 mip_base_cmd_get_device_info(mip_interface *device_interface, base_device_info_field *device_info)
{
 u8 *response_data;
 u16 response_data_size;
 u16 return_code;
 mip_field_header *field_header_ptr;

 memset(device_info, 0, sizeof(base_device_info_field));

 return_code = mip_interface_send_command_with_response(device_interface, MIP_BASE_COMMAND_DESC_SET, MIP_CMD_DESC_BASE_GET_DEVICE_INFO, NULL, 
                                                        0, &response_data, &response_data_size, MIP_INTERFACE_DEFAULT_COMMAND_RESPONSE_TIMEOUT_MS);
 
 //Copy the data to the provided buffer on success
 if(return_code == MIP_INTERFACE_OK)
 {
  field_header_ptr = (mip_field_header*) response_data;
  
  if((field_header_ptr->descriptor == MIP_REPLY_DESC_BASE_DEVICE_INFO) &&
     (field_header_ptr->size >= sizeof(mip_field_header) + sizeof(base_device_info_field)))
  {
   memcpy(device_info, response_data + sizeof(mip_field_header), response_data_size - sizeof(mip_field_header));
   
   //Byteswap if enabled
   if(MIP_SDK_CONFIG_BYTESWAP)
   {
    byteswap_inplace(&device_info->firmware_version, 2);
   }
  }
  else 
   return_code = MIP_INTERFACE_ERROR;
 }
 
 return return_code;
}
Exemplo n.º 15
0
void mip_ahrs_scaled_mag_byteswap(mip_ahrs_scaled_mag *scaled_mag)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&scaled_mag->scaled_mag[i], sizeof(float));
}
Exemplo n.º 16
0
void mip_ahrs_up_vector_byteswap(mip_ahrs_up_vector *up_vector)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&up_vector->up, sizeof(float));
}
Exemplo n.º 17
0
void mip_ahrs_raw_accel_byteswap(mip_ahrs_raw_accel *raw_accel)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&raw_accel->raw_accel[i], sizeof(float));
}
Exemplo n.º 18
0
void mip_ahrs_raw_mag_byteswap(mip_ahrs_raw_mag *raw_mag)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&raw_mag->raw_mag[i], sizeof(float));
}
Exemplo n.º 19
0
void mip_ahrs_scaled_accel_byteswap(mip_ahrs_scaled_accel *scaled_accel)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&scaled_accel->scaled_accel[i], sizeof(float));
}
Exemplo n.º 20
0
void mip_ahrs_scaled_gyro_byteswap(mip_ahrs_scaled_gyro *scaled_gyro)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&scaled_gyro->scaled_gyro[i], sizeof(float));
}
Exemplo n.º 21
0
void mip_gps_dop_byteswap(mip_gps_dop *dop)
{
 byteswap_inplace(&dop->gdop,        sizeof(float));
 byteswap_inplace(&dop->pdop,        sizeof(float));
 byteswap_inplace(&dop->hdop,        sizeof(float));
 byteswap_inplace(&dop->vdop,        sizeof(float));
 byteswap_inplace(&dop->tdop,        sizeof(float));
 byteswap_inplace(&dop->ndop,        sizeof(float));
 byteswap_inplace(&dop->edop,        sizeof(float));
 byteswap_inplace(&dop->valid_flags, sizeof(u16));
}
Exemplo n.º 22
0
void mip_ahrs_orientation_update_matrix_byteswap(mip_ahrs_orientation_update_matrix *orientation_update_matrix)
{
 u8 i, j;

 for(i=0; i<3; i++)
 {
  for(j=0; j<3; j++)
   byteswap_inplace(&orientation_update_matrix->m[i][j], sizeof(float));
 }
}
Exemplo n.º 23
0
void mip_gps_llh_pos_byteswap(mip_gps_llh_pos *llh_pos)
{
 byteswap_inplace(&llh_pos->latitude,            sizeof(double));
 byteswap_inplace(&llh_pos->longitude,           sizeof(double));
 byteswap_inplace(&llh_pos->ellipsoid_height,    sizeof(double));
 byteswap_inplace(&llh_pos->msl_height,          sizeof(double));
 byteswap_inplace(&llh_pos->horizontal_accuracy, sizeof(float));
 byteswap_inplace(&llh_pos->vertical_accuracy,   sizeof(float));
 byteswap_inplace(&llh_pos->valid_flags,         sizeof(u16));
}
Exemplo n.º 24
0
void mip_gps_ned_vel_byteswap(mip_gps_ned_vel *ned_vel)
{
 u8 i;

 for(i=0; i<3; i++)
  byteswap_inplace(&ned_vel->v[i],            sizeof(float));
 
 byteswap_inplace(&ned_vel->speed,            sizeof(float));
 byteswap_inplace(&ned_vel->ground_speed,     sizeof(float));
 byteswap_inplace(&ned_vel->heading,          sizeof(float));
 byteswap_inplace(&ned_vel->speed_accuracy,   sizeof(float));
 byteswap_inplace(&ned_vel->heading_accuracy, sizeof(float));
 byteswap_inplace(&ned_vel->valid_flags,      sizeof(u16));
}
u16 mip_base_cmd_get_device_supported_descriptors(mip_interface *device_interface, u8 *response_buffer, u16 *response_size)
{
 u8 *response_data;
 u16 response_data_size;
 u16 return_code;
 mip_field_header *field_header_ptr;
 u16 *short_ptr;
 u16 user_buffer_size = *response_size;
 u16 i;
 
 //Initialize the response size
 *response_size = 0;
 
 return_code = mip_interface_send_command_with_response(device_interface, MIP_BASE_COMMAND_DESC_SET, MIP_CMD_DESC_BASE_GET_DEVICE_DESCRIPTORS, NULL, 
                                                        0, &response_data, &response_data_size, MIP_INTERFACE_DEFAULT_COMMAND_RESPONSE_TIMEOUT_MS);
 
 //Copy the data to the provided buffer on success if present
 if((return_code == MIP_INTERFACE_OK) && (response_data != NULL))
 {
  field_header_ptr = (mip_field_header*) response_data;
  
  if((field_header_ptr->size - sizeof(mip_field_header)) <= user_buffer_size)
  {
   memcpy(response_buffer, response_data + sizeof(mip_field_header), field_header_ptr->size - sizeof(mip_field_header));
   *response_size = field_header_ptr->size - sizeof(mip_field_header);
  
   //Byteswap the descriptors if enabled
   if(MIP_SDK_CONFIG_BYTESWAP)
   {
    short_ptr = (u16*)response_buffer;
    
    for(i=0; i<*response_size/2; i++)
     byteswap_inplace(&short_ptr[i],  sizeof(u16));
   }   
  }
  else 
  {
   *response_size = 0;
   return_code = MIP_INTERFACE_ERROR;
  }
 }
 
 return return_code;
}
Exemplo n.º 26
0
void mip_gps_hw_status_byteswap(mip_gps_hw_status *hw_status)
{
 byteswap_inplace(&hw_status->valid_flags, sizeof(u16));
}
Exemplo n.º 27
0
void mip_gps_time_byteswap(mip_gps_time *gps_time)
{
 byteswap_inplace(&gps_time->tow,         sizeof(double));
 byteswap_inplace(&gps_time->week_number, sizeof(u16));
 byteswap_inplace(&gps_time->valid_flags, sizeof(u16));
}
Exemplo n.º 28
0
void mip_gps_utc_time_byteswap(mip_gps_utc_time *utc_time)
{
 byteswap_inplace(&utc_time->year,        sizeof(u16));
 byteswap_inplace(&utc_time->msec,        sizeof(u32));
 byteswap_inplace(&utc_time->valid_flags, sizeof(u16));
}
Exemplo n.º 29
0
void mip_gps_fix_info_byteswap(mip_gps_fix_info *fix_info)
{
 byteswap_inplace(&fix_info->fix_flags,   sizeof(u16));
 byteswap_inplace(&fix_info->valid_flags, sizeof(u16));
}
Exemplo n.º 30
0
void mip_ahrs_gps_timestamp_byteswap(mip_ahrs_gps_timestamp *gps_timestamp)
{
 byteswap_inplace(&gps_timestamp->tow,         sizeof(double));
 byteswap_inplace(&gps_timestamp->week_number, sizeof(u16));
 byteswap_inplace(&gps_timestamp->valid_flags, sizeof(u16));
}