~thomas-voss/location-service/fix-rtd-docs-next

« back to all changes in this revision

Viewing changes to src/location/providers/gps/android_hardware_abstraction_layer.cpp

  • Committer: Thomas Voß
  • Date: 2016-08-26 11:57:39 UTC
  • mfrom: (261.1.5 refactor-public-structs)
  • Revision ID: thomas.voss@canonical.com-20160826115739-uibmrkoarr24dr6i
Merge lp:~thomas-voss/location-service/ramp-up-abi-stability.

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
    std::set<location::SpaceVehicle> svs;
224
224
 
225
225
    for (int i = 0; i < sv_info->num_svs; i++)
226
 
    {
227
 
        location::SpaceVehicle sv;
228
 
 
 
226
    {        
229
227
        // PRN is in the range of [1, 32], adjusting it to make sure we
230
228
        // can use it for bitfield flag testing operations.
231
229
        int prn = sv_info->sv_list[i].prn - 1;
234
232
 
235
233
        auto shift = (1 << prn);
236
234
 
237
 
        sv.key.type = location::SpaceVehicle::Type::gps;
238
 
        sv.key.id = sv_info->sv_list[i].prn;
239
 
        sv.snr = sv_info->sv_list[i].snr;
240
 
        sv.has_almanac_data = sv_info->almanac_mask & shift;
241
 
        sv.has_ephimeris_data = sv_info->ephemeris_mask & shift;
242
 
        sv.used_in_fix = sv_info->used_in_fix_mask & shift;
243
 
        sv.azimuth = sv_info->sv_list[i].elevation * location::units::degrees;
244
 
        sv.elevation = sv_info->sv_list[i].azimuth * location::units::degrees;
245
 
 
246
 
        svs.insert(sv);
 
235
        svs.insert(location::SpaceVehicle{location::SpaceVehicle::Key{location::SpaceVehicle::Type::gps, sv_info->sv_list[i].prn}}
 
236
                   .snr(sv_info->sv_list[i].snr)
 
237
                   .has_almanac_data(sv_info->almanac_mask & shift)
 
238
                   .has_ephimeris_data(sv_info->ephemeris_mask & shift)
 
239
                   .used_in_fix(sv_info->used_in_fix_mask & shift)
 
240
                   .azimuth(sv_info->sv_list[i].azimuth * location::units::degrees)
 
241
                   .elevation(sv_info->sv_list[i].elevation * location::units::degrees));
247
242
    }
248
243
 
249
244
    thiz->space_vehicle_updates()(svs);