mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-13 11:40:33 +00:00
Merge branch 'next' of https://github.com/carlesfernandez/gnss-sdr into glonass
This commit is contained in:
commit
c474ea31d5
@ -1452,6 +1452,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
else(CLANG_VERSION VERSION_LESS "600")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
|
||||
endif(CLANG_VERSION VERSION_LESS "600")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-deprecated-declarations")
|
||||
endif(OS_IS_MACOSX)
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
|
@ -584,11 +584,10 @@ We use a [DBSRX2](https://www.ettus.com/product/details/DBSRX2) to do the task,
|
||||
1. The default configuration file resides at [/usr/local/share/gnss-sdr/conf/default.conf](./conf/gnss-sdr.conf).
|
||||
2. You need to review/modify at least the following settings:
|
||||
* ```SignalSource.filename=``` (absolute or relative route to your GNSS signal captured file)
|
||||
* ```GNSS-SDR.internal_fs_hz=``` (captured file sampling rate in Hz)
|
||||
* ```SignalSource.sampling_frequency=``` (captured file sampling rate in Hz)
|
||||
* ```SignalConditioner.sample_freq_in=``` (captured file sampling rate in Hz)
|
||||
* ```SignalConditioner.sample_freq_out=``` (captured file sampling rate in Hz)
|
||||
* ```TelemetryDecoder.fs_in=``` (captured file sampling rate in Hz)
|
||||
* ```GNSS-SDR.internal_fs_sps=``` (captured file sampling rate in samples per second)
|
||||
* ```SignalSource.sampling_frequency=``` (captured file sampling rate in samples per second)
|
||||
* ```SignalConditioner.sample_freq_in=``` (captured file sampling rate in samples per second)
|
||||
* ```SignalConditioner.sample_freq_out=``` (captured file sampling rate in samples per second)
|
||||
3. The configuration file has in-line documentation, you can try to tune the number of channels and several receiver parameters. Store your .conf file in some working directory of your choice.
|
||||
4. Run the receiver invoking the configuration by
|
||||
```$ gnss-sdr --config_file=/path/to/my_receiver.conf```
|
||||
|
@ -23,8 +23,8 @@ GNSS-SDR.init_altitude_m=10
|
||||
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2000000
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
; Check http://www.mcc-mnc.com/
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2727933.33 ; 8183800/3
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2727933.33 ; 8183800/3
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
@ -14,7 +14,7 @@ GNSS-SDR.internal_fs_hz=2727933.33 ; 8183800/3
|
||||
;#Notes for GN3S source:
|
||||
; - The front-end sampling frequency is fixed to 8.1838 MSPS (8183800 Hz).
|
||||
; - The baseband signal is shifted to an IF of 38400 Hz. It should be corrected with the signal conditioner block
|
||||
GNSS-SDR.internal_fs_hz=2727933.33 ; 8183800/3
|
||||
GNSS-SDR.internal_fs_sps=2727933.33 ; 8183800/3
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource.implementation=GN3S_Signal_Source
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
@ -226,7 +226,7 @@ Acquisition_1C.max_dwells=5
|
||||
;Acquisition3.repeat_satellite = true
|
||||
|
||||
;#cboc: Only for [Galileo_E1_PCPS_Ambiguous_Acquisition]. This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false].
|
||||
;#Use only if GNSS-SDR.internal_fs_hz is greater than or equal to 6138000
|
||||
;#Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000
|
||||
Acquisition0.cboc=false
|
||||
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
@ -177,71 +177,19 @@ Resampler.sample_freq_out=2000000
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_GPS.count=6
|
||||
Channels_1C.count=6
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_Galileo.count=0
|
||||
Channels_1B.count=0
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
|
||||
;#if the option is disabled by default is assigned GPS
|
||||
Channel.system=GPS
|
||||
|
||||
|
||||
;#signal:
|
||||
;# "1C" GPS L1 C/A
|
||||
;# "1P" GPS L1 P
|
||||
;# "1W" GPS L1 Z-tracking and similar (AS on)
|
||||
;# "1Y" GPS L1 Y
|
||||
;# "1M" GPS L1 M
|
||||
;# "1N" GPS L1 codeless
|
||||
;# "2C" GPS L2 C/A
|
||||
;# "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless
|
||||
;# "2S" GPS L2 L2C (M)
|
||||
;# "2L" GPS L2 L2C (L)
|
||||
;# "2X" GPS L2 L2C (M+L)
|
||||
;# "2P" GPS L2 P
|
||||
;# "2W" GPS L2 Z-tracking and similar (AS on)
|
||||
;# "2Y" GPS L2 Y
|
||||
;# "2M" GPS GPS L2 M
|
||||
;# "2N" GPS L2 codeless
|
||||
;# "5I" GPS L5 I
|
||||
;# "5Q" GPS L5 Q
|
||||
;# "5X" GPS L5 I+Q
|
||||
;# "1C" GLONASS G1 C/A
|
||||
;# "1P" GLONASS G1 P
|
||||
;# "2C" GLONASS G2 C/A (Glonass M)
|
||||
;# "2P" GLONASS G2 P
|
||||
;# "1A" GALILEO E1 A (PRS)
|
||||
;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL)
|
||||
;# "1C" GALILEO E1 C (no data)
|
||||
;# "1X" GALILEO E1 B+C
|
||||
;# "1Z" GALILEO E1 A+B+C
|
||||
;# "5I" GALILEO E5a I (F/NAV OS)
|
||||
;# "5Q" GALILEO E5a Q (no data)
|
||||
;# "5X" GALILEO E5a I+Q
|
||||
;# "7I" GALILEO E5b I
|
||||
;# "7Q" GALILEO E5b Q
|
||||
;# "7X" GALILEO E5b I+Q
|
||||
;# "8I" GALILEO E5 I
|
||||
;# "8Q" GALILEO E5 Q
|
||||
;# "8X" GALILEO E5 I+Q
|
||||
;# "6A" GALILEO E6 A
|
||||
;# "6B" GALILEO E6 B
|
||||
;# "6C" GALILEO E6 C
|
||||
;# "6X" GALILEO E6 B+C
|
||||
;# "6Z" GALILEO E6 A+B+C
|
||||
;# "1C" SBAS L1 C/A
|
||||
;# "5I" SBAS L5 I
|
||||
;# "5Q" SBAS L5 Q
|
||||
;# "5X" SBAS L5 I+Q
|
||||
;# "2I" COMPASS E2 I
|
||||
;# "2Q" COMPASS E2 Q
|
||||
;# "2X" COMPASS E2 IQ
|
||||
;# "7I" COMPASS E5b I
|
||||
;# "7Q" COMPASS E5b Q
|
||||
;# "7X" COMPASS E5b IQ
|
||||
;# "6I" COMPASS E6 I
|
||||
;# "6Q" COMPASS E6 Q
|
||||
;# "6X" COMPASS E6 IQ
|
||||
|
||||
;#if the option is disabled by default is assigned "1C" GPS L1 C/A
|
||||
Channel.signal=1C
|
||||
|
||||
@ -250,46 +198,45 @@ Channel.signal=1C
|
||||
|
||||
;######### CHANNEL 0 CONFIG ############
|
||||
|
||||
Channel0.system=GPS
|
||||
Channel0.signal=1C
|
||||
;Channel0.system=GPS
|
||||
;Channel0.signal=1C
|
||||
|
||||
;#satellite: Satellite PRN ID for this channel. Disable this option to random search
|
||||
Channel0.satellite=11
|
||||
;Channel0.satellite=11
|
||||
|
||||
;######### CHANNEL 1 CONFIG ############
|
||||
|
||||
Channel1.system=GPS
|
||||
Channel1.signal=1C
|
||||
Channel1.satellite=18
|
||||
;Channel1.system=GPS
|
||||
;Channel1.signal=1C
|
||||
;Channel1.satellite=18
|
||||
|
||||
|
||||
;######### ACQUISITION GLOBAL CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_GPS.dump=false
|
||||
Acquisition_1C.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_GPS.dump_filename=./acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_GPS.item_type=gr_complex
|
||||
Acquisition_1C.dump_filename=./acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples.
|
||||
Acquisition_1C.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_GPS.if=0
|
||||
Acquisition_1C.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_GPS.coherent_integration_time_ms=1
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_GPS.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
Acquisition_1C.coherent_integration_time_ms=1
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
;#threshold: Acquisition threshold. It will be ignored if pfa is defined.
|
||||
Acquisition_GPS.threshold=0.01
|
||||
Acquisition_1C.threshold=0.01
|
||||
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
;Acquisition_GPS.pfa=0.0001
|
||||
;Acquisition_1C.pfa=0.0001
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_GPS.doppler_max=10000
|
||||
Acquisition_1C.doppler_max=10000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_GPS.doppler_step=500
|
||||
Acquisition_1C.doppler_step=500
|
||||
;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take
|
||||
maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] (should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition])
|
||||
Acquisition_GPS.bit_transition_flag=false
|
||||
Acquisition_1C.bit_transition_flag=false
|
||||
;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true
|
||||
Acquisition_GPS.max_dwells=1
|
||||
Acquisition_1C.max_dwells=1
|
||||
|
||||
|
||||
;######### ACQUISITION CHANNELS CONFIG ######
|
||||
@ -299,37 +246,37 @@ Acquisition_GPS.max_dwells=1
|
||||
;######### TRACKING GLOBAL CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking]
|
||||
Tracking_GPS.implementation=GPS_L1_CA_DLL_PLL_Tracking
|
||||
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
|
||||
;#item_type: Type and resolution for each of the signal samples.
|
||||
Tracking_GPS.item_type=gr_complex
|
||||
Tracking_1C.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_GPS.if=0
|
||||
Tracking_1C.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_GPS.dump=false
|
||||
Tracking_1C.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_GPS.dump_filename=./tracking_ch_
|
||||
Tracking_1C.dump_filename=./tracking_ch_
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_GPS.pll_bw_hz=50.0;
|
||||
Tracking_1C.pll_bw_hz=30.0;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_GPS.dll_bw_hz=2.0;
|
||||
Tracking_1C.dll_bw_hz=4.0;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_GPS.order=3;
|
||||
Tracking_1C.order=3;
|
||||
|
||||
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5]
|
||||
Tracking_GPS.early_late_space_chips=0.5;
|
||||
;#early_late_space_chips: correlator early-late space [chips]
|
||||
Tracking_1C.early_late_space_chips=0.5;
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
|
||||
TelemetryDecoder_GPS.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_GPS.dump=false
|
||||
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_1C.dump=false
|
||||
;#decimation factor
|
||||
TelemetryDecoder_GPS.decimation_factor=1;
|
||||
TelemetryDecoder_1C.decimation_factor=1;
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
;#implementation:
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2600000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2600000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2000000
|
||||
|
||||
;######### CONTROL_THREAD CONFIG ############
|
||||
ControlThread.wait_for_flowgraph=false
|
||||
|
@ -8,8 +8,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2560000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2560000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -8,8 +8,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2560000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2560000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2000000
|
||||
|
||||
;######### CONTROL_THREAD CONFIG ############
|
||||
ControlThread.wait_for_flowgraph=false
|
||||
|
@ -6,10 +6,10 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
|
||||
; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/
|
||||
GNSS-SDR.internal_fs_hz=1200000
|
||||
GNSS-SDR.internal_fs_sps=1200000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -5,10 +5,10 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
|
||||
; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/
|
||||
GNSS-SDR.internal_fs_hz=1999898
|
||||
GNSS-SDR.internal_fs_sps=1999898
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=3200000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=3200000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -7,8 +7,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
; Check http://www.mcc-mnc.com/
|
||||
|
@ -7,8 +7,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
|
@ -5,8 +5,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
@ -193,7 +193,7 @@ Acquisition_1B.doppler_step=125
|
||||
;Acquisition_1B3.repeat_satellite = true
|
||||
|
||||
;#cboc: Only for [Galileo_E1_PCPS_Ambiguous_Acquisition]. This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false].
|
||||
;#Use only if GNSS-SDR.internal_fs_hz is greater than or equal to 6138000
|
||||
;#Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000
|
||||
Acquisition_1B.cboc=false
|
||||
|
||||
|
||||
|
@ -5,11 +5,11 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
;GNSS-SDR.internal_fs_hz=6826700
|
||||
GNSS-SDR.internal_fs_hz=2560000
|
||||
;GNSS-SDR.internal_fs_hz=4096000
|
||||
;GNSS-SDR.internal_fs_hz=5120000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
;GNSS-SDR.internal_fs_sps=6826700
|
||||
GNSS-SDR.internal_fs_sps=2560000
|
||||
;GNSS-SDR.internal_fs_sps=4096000
|
||||
;GNSS-SDR.internal_fs_sps=5120000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
@ -87,7 +87,7 @@ Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
|
||||
Acquisition_1B.pfa=0.0000008
|
||||
Acquisition_1B.doppler_max=15000
|
||||
Acquisition_1B.doppler_step=125
|
||||
Acquisition_1B.cboc=false ; This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false]. Use only if GNSS-SDR.internal_fs_hz is greater than or equal to 6138000
|
||||
Acquisition_1B.cboc=false ; This option allows you to choose between acquiring with CBOC signal [true] or sinboc(1,1) signal [false]. Use only if GNSS-SDR.internal_fs_sps is greater than or equal to 6138000
|
||||
|
||||
;######### TRACKING GLOBAL CONFIG ############
|
||||
Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=32000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=32000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=50000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=50000000
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
; Check http://www.mcc-mnc.com/
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=20000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=20000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
|
@ -6,9 +6,9 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
;#GNSS-SDR.internal_fs_hz=2048000
|
||||
GNSS-SDR.internal_fs_hz=2600000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
;GNSS-SDR.internal_fs_sps=2048000
|
||||
GNSS-SDR.internal_fs_sps=2600000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4092000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4092000
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,11 +6,11 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
;GNSS-SDR.internal_fs_hz=6826700
|
||||
GNSS-SDR.internal_fs_hz=2560000
|
||||
;GNSS-SDR.internal_fs_hz=4096000
|
||||
;GNSS-SDR.internal_fs_hz=5120000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
;GNSS-SDR.internal_fs_sps=6826700
|
||||
GNSS-SDR.internal_fs_sps=2560000
|
||||
;GNSS-SDR.internal_fs_sps=4096000
|
||||
;GNSS-SDR.internal_fs_sps=5120000
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2500000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2500000
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
; Check http://www.mcc-mnc.com/
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2500000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2500000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2500000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2500000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2500000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2500000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=5000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=5000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2500000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2500000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=2500000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=2500000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=5000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=5000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=5000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=5000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,8 +6,8 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=5000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=5000000
|
||||
|
||||
|
||||
;######### SUPL RRLP GPS assistance configuration #####
|
||||
|
@ -6,9 +6,11 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
GNSS-SDR.internal_fs_hz=4000000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
GNSS-SDR.internal_fs_sps=4000000
|
||||
|
||||
Receiver.sources_count=2
|
||||
|
||||
;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
|
||||
; it helps to not overload the CPU, but the processing time will be longer.
|
||||
SignalSource.enable_throttle_control=false
|
||||
@ -283,14 +285,12 @@ Resampler1.sample_freq_out=4000000
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_GPS.count=2
|
||||
Channels_1C.count=2
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_Galileo.count=2
|
||||
Channels_1B.count=2
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
;#system: GPS, GLONASS, GALILEO, SBAS or COMPASS
|
||||
;#if the option is disabled by default is assigned GPS
|
||||
Channel.system=GPS, Galileo
|
||||
|
||||
|
||||
;# CHANNEL CONNECTION
|
||||
Channel0.RF_channel_ID=0
|
||||
@ -305,118 +305,118 @@ Channel.signal=1B
|
||||
;######### GPS ACQUISITION CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_GPS.dump=false
|
||||
Acquisition_1C.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_GPS.dump_filename=./acq_dump.dat
|
||||
Acquisition_1C.dump_filename=./acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_GPS.item_type=gr_complex
|
||||
Acquisition_1C.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_GPS.if=0
|
||||
Acquisition_1C.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_GPS.sampled_ms=1
|
||||
Acquisition_1C.sampled_ms=1
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_GPS.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition_GPS.threshold=0.0075
|
||||
Acquisition_1C.threshold=0.0075
|
||||
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
;Acquisition_GPS.pfa=0.01
|
||||
;Acquisition_1C.pfa=0.01
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_GPS.doppler_max=10000
|
||||
Acquisition_1C.doppler_max=10000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_GPS.doppler_step=500
|
||||
Acquisition_1C.doppler_step=500
|
||||
|
||||
|
||||
;######### GALILEO ACQUISITION CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_Galileo.dump=false
|
||||
Acquisition_1B.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_Galileo.dump_filename=./acq_dump.dat
|
||||
Acquisition_1B.dump_filename=./acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_Galileo.item_type=gr_complex
|
||||
Acquisition_1B.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_Galileo.if=0
|
||||
Acquisition_1B.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_Galileo.sampled_ms=4
|
||||
Acquisition_1B.sampled_ms=4
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_Galileo.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
|
||||
Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
|
||||
;#threshold: Acquisition threshold
|
||||
;Acquisition_Galileo.threshold=0
|
||||
;Acquisition_1B.threshold=0
|
||||
;#pfa: Acquisition false alarm probability. This option overrides the threshold option. Only use with implementations: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_Galileo.pfa=0.0000008
|
||||
Acquisition_1B.pfa=0.0000008
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_Galileo.doppler_max=15000
|
||||
Acquisition_1B.doppler_max=15000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_Galileo.doppler_step=125
|
||||
Acquisition_1B.doppler_step=125
|
||||
|
||||
;######### TRACKING GPS CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
|
||||
Tracking_GPS.implementation=GPS_L1_CA_DLL_PLL_Tracking
|
||||
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
|
||||
Tracking_GPS.item_type=gr_complex
|
||||
Tracking_1C.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_GPS.if=0
|
||||
Tracking_1C.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_GPS.dump=false
|
||||
Tracking_1C.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_GPS.dump_filename=../data/epl_tracking_ch_
|
||||
Tracking_1C.dump_filename=../data/epl_tracking_ch_
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_GPS.pll_bw_hz=45.0;
|
||||
Tracking_1C.pll_bw_hz=45.0;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_GPS.dll_bw_hz=4.0;
|
||||
Tracking_1C.dll_bw_hz=4.0;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_GPS.order=3;
|
||||
Tracking_1C.order=3;
|
||||
|
||||
;######### TRACKING GALILEO CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [Galileo_E1_DLL_PLL_VEML_Tracking]
|
||||
Tracking_Galileo.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
|
||||
Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
|
||||
Tracking_Galileo.item_type=gr_complex
|
||||
Tracking_1B.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_Galileo.if=0
|
||||
Tracking_1B.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_Galileo.dump=false
|
||||
Tracking_1B.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_Galileo.dump_filename=../data/veml_tracking_ch_
|
||||
Tracking_1B.dump_filename=../data/veml_tracking_ch_
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_Galileo.pll_bw_hz=15.0;
|
||||
Tracking_1B.pll_bw_hz=15.0;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_Galileo.dll_bw_hz=2.0;
|
||||
Tracking_1B.dll_bw_hz=2.0;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_Galileo.order=3;
|
||||
Tracking_1B.order=3;
|
||||
|
||||
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo
|
||||
Tracking_Galileo.early_late_space_chips=0.15;
|
||||
Tracking_1B.early_late_space_chips=0.15;
|
||||
|
||||
;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6]
|
||||
Tracking_Galileo.very_early_late_space_chips=0.6;
|
||||
Tracking_1B.very_early_late_space_chips=0.6;
|
||||
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
|
||||
TelemetryDecoder_GPS.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_GPS.dump=false
|
||||
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_1C.dump=false
|
||||
;#decimation factor
|
||||
TelemetryDecoder_GPS.decimation_factor=4;
|
||||
TelemetryDecoder_1C.decimation_factor=4;
|
||||
|
||||
;######### TELEMETRY DECODER GALILEO CONFIG ############
|
||||
;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B
|
||||
TelemetryDecoder_Galileo.implementation=Galileo_E1B_Telemetry_Decoder
|
||||
TelemetryDecoder_Galileo.dump=false
|
||||
TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder
|
||||
TelemetryDecoder_1B.dump=false
|
||||
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
|
@ -8,11 +8,11 @@
|
||||
Receiver.sources_count=2
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz].
|
||||
;GNSS-SDR.internal_fs_hz=6826700
|
||||
GNSS-SDR.internal_fs_hz=2560000
|
||||
;GNSS-SDR.internal_fs_hz=4096000
|
||||
;GNSS-SDR.internal_fs_hz=5120000
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second].
|
||||
;GNSS-SDR.internal_fs_sps=6826700
|
||||
GNSS-SDR.internal_fs_sps=2560000
|
||||
;GNSS-SDR.internal_fs_sps=4096000
|
||||
;GNSS-SDR.internal_fs_sps=5120000
|
||||
|
||||
;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
|
||||
; it helps to not overload the CPU, but the processing time will be longer.
|
||||
|
@ -236,9 +236,10 @@ std::string Nmea_Printer::latitude_to_hm(double lat)
|
||||
out_string.fill('0');
|
||||
out_string.width(2);
|
||||
out_string << deg;
|
||||
out_string.width(6);
|
||||
out_string.precision(4);
|
||||
out_string << mins;
|
||||
out_string.width(2);
|
||||
out_string << static_cast<int>(mins) << ".";
|
||||
out_string.width(4);
|
||||
out_string << static_cast<int>((mins - static_cast<double>(static_cast<int>(mins))) * 1e4);
|
||||
|
||||
if (north == true)
|
||||
{
|
||||
@ -273,9 +274,10 @@ std::string Nmea_Printer::longitude_to_hm(double longitude)
|
||||
out_string.width(3);
|
||||
out_string.fill('0');
|
||||
out_string << deg;
|
||||
out_string.width(6);
|
||||
out_string.precision(4);
|
||||
out_string << mins;
|
||||
out_string.width(2);
|
||||
out_string << static_cast<int>(mins) << ".";
|
||||
out_string.width(4);
|
||||
out_string << static_cast<int>((mins - static_cast<double>(static_cast<int>(mins))) * 1e4);
|
||||
|
||||
if (east == true)
|
||||
{
|
||||
|
@ -619,6 +619,9 @@ void Pvt_Solution::set_valid_position(bool is_valid)
|
||||
void Pvt_Solution::set_rx_pos(const arma::vec & pos)
|
||||
{
|
||||
d_rx_pos = pos;
|
||||
d_latitude_d = d_rx_pos(0);
|
||||
d_longitude_d = d_rx_pos(1);
|
||||
d_height_m = d_rx_pos(2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ private:
|
||||
double d_VDOP;
|
||||
double d_TDOP;
|
||||
|
||||
int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites
|
||||
int d_visible_satellites_IDs[PVT_MAX_CHANNELS] = {}; // Array with the IDs of the valid satellites
|
||||
double d_visible_satellites_El[PVT_MAX_CHANNELS] = {}; // Array with the LOS Elevation of the valid satellites
|
||||
double d_visible_satellites_Az[PVT_MAX_CHANNELS] = {}; // Array with the LOS Azimuth of the valid satellites
|
||||
double d_visible_satellites_Distance[PVT_MAX_CHANNELS] = {}; // Array with the LOS Distance of the valid satellites
|
||||
@ -86,18 +86,18 @@ private:
|
||||
public:
|
||||
Pvt_Solution();
|
||||
|
||||
double get_time_offset_s() const; //!< Get RX time offset [s]
|
||||
void set_time_offset_s(double offset); //!< Set RX time offset [s]
|
||||
double get_time_offset_s() const; //!< Get RX time offset [s]
|
||||
void set_time_offset_s(double offset); //!< Set RX time offset [s]
|
||||
|
||||
double get_latitude() const; //!< Get RX position Latitude WGS84 [deg]
|
||||
double get_longitude() const; //!< Get RX position Longitude WGS84 [deg]
|
||||
double get_height() const; //!< Get RX position height WGS84 [m]
|
||||
double get_latitude() const; //!< Get RX position Latitude WGS84 [deg]
|
||||
double get_longitude() const; //!< Get RX position Longitude WGS84 [deg]
|
||||
double get_height() const; //!< Get RX position height WGS84 [m]
|
||||
|
||||
double get_avg_latitude() const; //!< Get RX position averaged Latitude WGS84 [deg]
|
||||
double get_avg_longitude() const; //!< Get RX position averaged Longitude WGS84 [deg]
|
||||
double get_avg_height() const; //!< Get RX position averaged height WGS84 [m]
|
||||
double get_avg_latitude() const; //!< Get RX position averaged Latitude WGS84 [deg]
|
||||
double get_avg_longitude() const; //!< Get RX position averaged Longitude WGS84 [deg]
|
||||
double get_avg_height() const; //!< Get RX position averaged height WGS84 [m]
|
||||
|
||||
void set_rx_pos(const arma::vec & pos);
|
||||
void set_rx_pos(const arma::vec & pos); //!< Set position: Latitude [deg], longitude [deg], height [m]
|
||||
arma::vec get_rx_pos() const;
|
||||
|
||||
bool is_valid_position() const;
|
||||
|
@ -53,7 +53,8 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
|
||||
item_type_ = configuration_->property(role + ".item_type",
|
||||
default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
|
@ -52,7 +52,8 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
|
@ -52,7 +52,8 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
|
@ -53,7 +53,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
|
||||
item_type_ = configuration_->property(role + ".item_type",
|
||||
default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
|
@ -53,7 +53,8 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
|
||||
item_type_ = configuration_->property(role + ".item_type",
|
||||
default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
|
@ -58,7 +58,8 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 32000000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
|
@ -55,8 +55,8 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
@ -88,7 +88,6 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -51,7 +51,8 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration->property(role + ".if", 0);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
|
@ -32,6 +32,7 @@
|
||||
*/
|
||||
|
||||
#include "gps_l1_ca_pcps_acquisition_fpga.h"
|
||||
#include <stdexcept>
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
#include <glog/logging.h>
|
||||
#include "GPS_L1_CA.h"
|
||||
@ -63,29 +64,25 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type",
|
||||
default_item_type);
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
|
||||
fs_in = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
ifreq = configuration_->property(role + ".if", 0);
|
||||
dump = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
sampled_ms = configuration_->property(
|
||||
role + ".coherent_integration_time_ms", 1);
|
||||
sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
|
||||
// note : the FPGA is implemented according to bit transition flag = 0. Setting bit transition flag to 1 has no effect.
|
||||
bit_transition_flag = configuration_->property(
|
||||
role + ".bit_transition_flag", false);
|
||||
bit_transition_flag = configuration_->property(role + ".bit_transition_flag", false);
|
||||
|
||||
// note : the FPGA is implemented according to use_CFAR_algorithm = 0. Setting use_CFAR_algorithm to 1 has no effect.
|
||||
use_CFAR_algorithm_flag = configuration_->property(
|
||||
role + ".use_CFAR_algorithm", false);
|
||||
use_CFAR_algorithm_flag = configuration_->property(role + ".use_CFAR_algorithm", false);
|
||||
|
||||
// note : the FPGA does not use the max_dwells variable.
|
||||
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
|
||||
|
||||
dump_filename = configuration_->property(role + ".dump_filename",
|
||||
default_dump_filename);
|
||||
dump_filename = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length = round(
|
||||
@ -104,12 +101,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
// vector_length_ *= 2;
|
||||
// }
|
||||
|
||||
select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga",
|
||||
0);
|
||||
select_queue_Fpga = configuration_->property(role + ".select_queue_Fpga", 0);
|
||||
|
||||
std::string default_device_name = "/dev/uio0";
|
||||
device_name = configuration_->property(role + ".devicename",
|
||||
default_device_name);
|
||||
device_name = configuration_->property(role + ".devicename", default_device_name);
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
@ -124,7 +119,8 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(FATAL) << item_type_ << " FPGA only accepts chsort";
|
||||
LOG(WARNING) << "item_type configured to " << item_type_ << "but FPGA implementation only accepts cshort";
|
||||
throw std::invalid_argument( "Wrong input_type configuration. Should be cshort" );
|
||||
}
|
||||
|
||||
channel_ = 0;
|
||||
|
@ -51,7 +51,8 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
long fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration->property(role + ".if", 0);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
@ -72,7 +73,6 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
|
||||
acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_, sampled_ms_,
|
||||
doppler_max_, doppler_min_, if_, fs_in_, vector_length_,
|
||||
dump_, dump_filename_);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -53,7 +53,8 @@ GpsL1CaPcpsMultithreadAcquisition::GpsL1CaPcpsMultithreadAcquisition(
|
||||
item_type_ = configuration_->property(role + ".item_type",
|
||||
default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
|
@ -52,7 +52,8 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
|
||||
item_type_ = configuration_->property(role + ".item_type",
|
||||
default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
|
@ -53,7 +53,8 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 4000000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
|
@ -52,7 +52,8 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
|
@ -55,7 +55,8 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
//float pfa = configuration_->property(role + ".pfa", 0.0);
|
||||
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
doppler_max_ = configuration->property(role + ".doppler_max", 5000);
|
||||
|
@ -1544,49 +1544,46 @@ int ddmat(rtk_t *rtk, double *D)
|
||||
|
||||
for (f = 0, k = na;f<nf;f++, k+=MAXSAT)
|
||||
{
|
||||
for (i = k;i<k+MAXSAT;i++)
|
||||
if(i < k + MAXSAT)
|
||||
{
|
||||
#if 0
|
||||
if (rtk->x[i] == 0.0||!test_sys(rtk->ssat[i-k].sys,m)||
|
||||
!rtk->ssat[i-k].vsat[f])
|
||||
for (i = k;i<k+MAXSAT;i++)
|
||||
{
|
||||
#else
|
||||
if (rtk->x[i] == 0.0 || !test_sys(rtk->ssat[i-k].sys, m) ||
|
||||
if (rtk->x[i] == 0.0 || !test_sys(rtk->ssat[i-k].sys, m) ||
|
||||
!rtk->ssat[i-k].vsat[f] || !rtk->ssat[i-k].half[f])
|
||||
{
|
||||
#endif
|
||||
continue;
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (rtk->ssat[i-k].lock[f]>0 && !(rtk->ssat[i-k].slip[f]&2) &&
|
||||
rtk->ssat[i-k].azel[1] >= rtk->opt.elmaskar && !nofix)
|
||||
{
|
||||
rtk->ssat[i-k].fix[f] = 2; /* fix */
|
||||
break;
|
||||
}
|
||||
else rtk->ssat[i-k].fix[f] = 1;
|
||||
}
|
||||
if (rtk->ssat[i-k].lock[f]>0 && !(rtk->ssat[i-k].slip[f]&2) &&
|
||||
rtk->ssat[i-k].azel[1] >= rtk->opt.elmaskar && !nofix)
|
||||
for (j = k;j<k+MAXSAT;j++)
|
||||
{
|
||||
rtk->ssat[i-k].fix[f] = 2; /* fix */
|
||||
break;
|
||||
if (i == j || rtk->x[j] == 0.0 || !test_sys(rtk->ssat[j-k].sys, m) ||
|
||||
!rtk->ssat[j-k].vsat[f])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (rtk->ssat[j-k].lock[f]>0 && !(rtk->ssat[j-k].slip[f]&2) &&
|
||||
rtk->ssat[i-k].vsat[f] &&
|
||||
rtk->ssat[j-k].azel[1] >= rtk->opt.elmaskar && !nofix)
|
||||
{
|
||||
D[i+(na+nb)*nx] = 1.0;
|
||||
D[j+(na+nb)*nx] = -1.0;
|
||||
nb++;
|
||||
rtk->ssat[j-k].fix[f] = 2; /* fix */
|
||||
}
|
||||
else rtk->ssat[j-k].fix[f] = 1;
|
||||
}
|
||||
else rtk->ssat[i-k].fix[f] = 1;
|
||||
}
|
||||
for (j = k;j<k+MAXSAT;j++)
|
||||
{
|
||||
if (i == j || rtk->x[j] == 0.0 || !test_sys(rtk->ssat[j-k].sys, m) ||
|
||||
!rtk->ssat[j-k].vsat[f])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (rtk->ssat[j-k].lock[f]>0 && !(rtk->ssat[j-k].slip[f]&2) &&
|
||||
rtk->ssat[i-k].vsat[f] &&
|
||||
rtk->ssat[j-k].azel[1] >= rtk->opt.elmaskar && !nofix)
|
||||
{
|
||||
D[i+(na+nb)*nx] = 1.0;
|
||||
D[j+(na+nb)*nx] = -1.0;
|
||||
nb++;
|
||||
rtk->ssat[j-k].fix[f] = 2; /* fix */
|
||||
}
|
||||
else rtk->ssat[j-k].fix[f] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
trace(5, "D=\n"); tracemat(5, D, nx, na+nb, 2, 0);
|
||||
return nb;
|
||||
trace(5, "D=\n"); tracemat(5, D, nx, na+nb, 2, 0);
|
||||
return nb;
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,13 +49,14 @@ DirectResamplerConditioner::DirectResamplerConditioner(
|
||||
{
|
||||
std::string default_item_type = "short";
|
||||
std::string default_dump_file = "./data/signal_conditioner.dat";
|
||||
double fs_in;
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
|
||||
double fs_in_deprecated, fs_in;
|
||||
fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);
|
||||
sample_freq_out_ = configuration->property(role_ + ".sample_freq_out", fs_in);
|
||||
if(std::fabs(fs_in - sample_freq_out_) > std::numeric_limits<double>::epsilon())
|
||||
{
|
||||
std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_hz and "
|
||||
std::string aux_warn = "CONFIGURATION WARNING: Parameters GNSS-SDR.internal_fs_sps and "
|
||||
+ role_ + ".sample_freq_out are not set to the same value!" ;
|
||||
LOG(WARNING) << aux_warn;
|
||||
std::cout << aux_warn << std::endl;
|
||||
|
@ -75,19 +75,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
// 1. Make the driver instance
|
||||
try
|
||||
{
|
||||
if (!osmosdr_args_.empty())
|
||||
{
|
||||
std::cout << "OsmoSdr arguments: " << osmosdr_args_ << std::endl;
|
||||
LOG(INFO) << "OsmoSdr arguments: " << osmosdr_args_;
|
||||
}
|
||||
osmosdr_source_ = osmosdr::source::make(osmosdr_args_);
|
||||
}
|
||||
catch( const boost::exception & e )
|
||||
{
|
||||
DLOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
}
|
||||
OsmosdrSignalSource::driver_instance();
|
||||
|
||||
// 2 set sampling rate
|
||||
osmosdr_source_->set_sample_rate(sample_rate_);
|
||||
@ -147,6 +135,24 @@ OsmosdrSignalSource::~OsmosdrSignalSource()
|
||||
{}
|
||||
|
||||
|
||||
void OsmosdrSignalSource::driver_instance()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!osmosdr_args_.empty())
|
||||
{
|
||||
std::cout << "OsmoSdr arguments: " << osmosdr_args_ << std::endl;
|
||||
LOG(INFO) << "OsmoSdr arguments: " << osmosdr_args_;
|
||||
}
|
||||
osmosdr_source_ = osmosdr::source::make(osmosdr_args_);
|
||||
}
|
||||
catch( const boost::exception & e )
|
||||
{
|
||||
LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
throw std::invalid_argument( "Wrong OsmoSdr arguments" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void OsmosdrSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
|
@ -33,6 +33,7 @@
|
||||
#ifndef GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_
|
||||
#define GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
@ -80,6 +81,7 @@ public:
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
private:
|
||||
void driver_instance();
|
||||
std::string role_;
|
||||
|
||||
// Front-end settings
|
||||
|
@ -78,16 +78,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
// 1. Make the gr block
|
||||
try
|
||||
{
|
||||
std::cout << "Connecting to " << address_ << ":" << port_ << std::endl;
|
||||
LOG (INFO) << "Connecting to " << address_ << ":" << port_;
|
||||
signal_source_ = rtl_tcp_make_signal_source_c (address_, port_, flip_iq_);
|
||||
}
|
||||
catch( const boost::exception & e )
|
||||
{
|
||||
DLOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
}
|
||||
MakeBlock();
|
||||
|
||||
// 2 set sampling rate
|
||||
signal_source_->set_sample_rate(sample_rate_);
|
||||
@ -145,6 +136,22 @@ RtlTcpSignalSource::~RtlTcpSignalSource()
|
||||
{}
|
||||
|
||||
|
||||
void RtlTcpSignalSource::MakeBlock()
|
||||
{
|
||||
try
|
||||
{
|
||||
std::cout << "Connecting to " << address_ << ":" << port_ << std::endl;
|
||||
LOG (INFO) << "Connecting to " << address_ << ":" << port_;
|
||||
signal_source_ = rtl_tcp_make_signal_source_c (address_, port_, flip_iq_);
|
||||
}
|
||||
catch( const boost::exception & e )
|
||||
{
|
||||
LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
throw std::runtime_error( "Failure connecting to the device" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RtlTcpSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if ( samples_ )
|
||||
|
@ -32,6 +32,7 @@
|
||||
#ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
@ -81,6 +82,7 @@ public:
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
private:
|
||||
void MakeBlock();
|
||||
std::string role_;
|
||||
|
||||
// rtl_tcp settings
|
||||
|
@ -62,7 +62,8 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
float very_early_late_space_chips;
|
||||
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
|
@ -63,7 +63,8 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking(
|
||||
float very_early_late_space_chips;
|
||||
size_t port_ch0;
|
||||
item_type = configuration->property(role + ".item_type",default_item_type);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
|
@ -66,7 +66,8 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
|
||||
float early_late_space_chips;
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
//vector_length = configuration->property(role + ".vector_length", 2048);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 12000000);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 12000000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0);
|
||||
|
@ -64,7 +64,8 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking(
|
||||
float early_late_space_chips;
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
//vector_length = configuration->property(role + ".vector_length", 2048);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
|
@ -64,31 +64,25 @@ GpsL1CaDllPllCAidTrackingFpga::GpsL1CaDllPllCAidTrackingFpga(
|
||||
std::string device_name;
|
||||
unsigned int device_base;
|
||||
|
||||
item_type_ = configuration->property(role + ".item_type",
|
||||
default_item_type);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
|
||||
pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz",
|
||||
20.0);
|
||||
pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0);
|
||||
dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0);
|
||||
int extend_correlation_ms;
|
||||
extend_correlation_ms = configuration->property(
|
||||
role + ".extend_correlation_ms", 1);
|
||||
extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1);
|
||||
|
||||
early_late_space_chips = configuration->property(
|
||||
role + ".early_late_space_chips", 0.5);
|
||||
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
|
||||
std::string default_dump_filename = "./track_ch";
|
||||
dump_filename = configuration->property(role + ".dump_filename",
|
||||
default_dump_filename);
|
||||
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
std::string default_device_name = "/dev/uio";
|
||||
device_name = configuration->property(role + ".devicename",
|
||||
default_device_name);
|
||||
device_name = configuration->property(role + ".devicename", default_device_name);
|
||||
device_base = configuration->property(role + ".device_base", 1);
|
||||
vector_length = std::round(
|
||||
fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
|
||||
@ -100,8 +94,7 @@ GpsL1CaDllPllCAidTrackingFpga::GpsL1CaDllPllCAidTrackingFpga(
|
||||
dll_bw_hz, pll_bw_narrow_hz, dll_bw_narrow_hz,
|
||||
extend_correlation_ms, early_late_space_chips, device_name,
|
||||
device_base);
|
||||
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id()
|
||||
<< ")";
|
||||
DLOG(INFO) << "tracking(" << tracking_fpga_sc->unique_id() << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -115,14 +108,15 @@ GpsL1CaDllPllCAidTrackingFpga::GpsL1CaDllPllCAidTrackingFpga(
|
||||
channel_ = 0;
|
||||
}
|
||||
|
||||
|
||||
GpsL1CaDllPllCAidTrackingFpga::~GpsL1CaDllPllCAidTrackingFpga()
|
||||
{
|
||||
LOG(INFO) << "gspl1cadllpllcaidtrackingfpga destructor called";
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaDllPllCAidTrackingFpga::start_tracking()
|
||||
{
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
tracking_fpga_sc->start_tracking();
|
||||
@ -135,6 +129,7 @@ void GpsL1CaDllPllCAidTrackingFpga::start_tracking()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set tracking channel unique ID
|
||||
*/
|
||||
@ -154,6 +149,7 @@ void GpsL1CaDllPllCAidTrackingFpga::set_channel(unsigned int channel)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaDllPllCAidTrackingFpga::set_gnss_synchro(
|
||||
Gnss_Synchro* p_gnss_synchro)
|
||||
{
|
||||
@ -169,6 +165,7 @@ void GpsL1CaDllPllCAidTrackingFpga::set_gnss_synchro(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaDllPllCAidTrackingFpga::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
@ -177,6 +174,7 @@ void GpsL1CaDllPllCAidTrackingFpga::connect(gr::top_block_sptr top_block)
|
||||
//nothing to connect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaDllPllCAidTrackingFpga::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
@ -185,6 +183,7 @@ void GpsL1CaDllPllCAidTrackingFpga::disconnect(gr::top_block_sptr top_block)
|
||||
//nothing to disconnect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
// CONVERT TO SOURCE
|
||||
gr::basic_block_sptr GpsL1CaDllPllCAidTrackingFpga::get_left_block()
|
||||
{
|
||||
@ -201,6 +200,7 @@ gr::basic_block_sptr GpsL1CaDllPllCAidTrackingFpga::get_left_block()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GpsL1CaDllPllCAidTrackingFpga::get_right_block()
|
||||
{
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
@ -216,10 +216,9 @@ gr::basic_block_sptr GpsL1CaDllPllCAidTrackingFpga::get_right_block()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GpsL1CaDllPllCAidTrackingFpga::reset(void)
|
||||
{
|
||||
|
||||
tracking_fpga_sc->reset();
|
||||
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,8 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
|
||||
float dll_bw_hz;
|
||||
float early_late_space_chips;
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
|
@ -62,7 +62,8 @@ GpsL1CaDllPllTrackingGPU::GpsL1CaDllPllTrackingGPU(
|
||||
float early_late_space_chips;
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
//vector_length = configuration->property(role + ".vector_length", 2048);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
|
@ -61,7 +61,8 @@ GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking(
|
||||
size_t port_ch0;
|
||||
item_type = configuration->property(role + ".item_type",default_item_type);
|
||||
//vector_length = configuration->property(role + ".vector_length", 2048);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
|
||||
|
@ -61,7 +61,8 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking(
|
||||
float dll_bw_hz;
|
||||
float early_late_space_chips;
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
|
@ -107,7 +107,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
tmp.size = length;
|
||||
|
||||
if((specs&&specs->field_unsigned)
|
||||
? asn_INTEGER2ulong(&tmp, &l)
|
||||
? asn_INTEGER2ulong(&tmp, (unsigned long*)&l)
|
||||
: asn_INTEGER2long(&tmp, &l)) {
|
||||
rval.code = RC_FAIL;
|
||||
rval.consumed = 0;
|
||||
@ -187,7 +187,7 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
|
||||
if(rval.code == RC_OK) {
|
||||
long l;
|
||||
if((specs&&specs->field_unsigned)
|
||||
? asn_INTEGER2ulong(&st, &l)
|
||||
? asn_INTEGER2ulong(&st, (unsigned long*)&l)
|
||||
: asn_INTEGER2long(&st, &l)) {
|
||||
rval.code = RC_FAIL;
|
||||
rval.consumed = 0;
|
||||
@ -255,7 +255,7 @@ NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
|
||||
&tmpintptr, pd);
|
||||
if(rval.code == RC_OK) {
|
||||
if((specs&&specs->field_unsigned)
|
||||
? asn_INTEGER2ulong(&tmpint, native)
|
||||
? asn_INTEGER2ulong(&tmpint, (unsigned long*)native)
|
||||
: asn_INTEGER2long(&tmpint, native))
|
||||
rval.code = RC_FAIL;
|
||||
else
|
||||
|
@ -915,7 +915,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
nelems = uper_get_length(pd,
|
||||
ct ? ct->effective_bits : -1, &repeat);
|
||||
ASN_DEBUG("Got to decode %d elements (eff %d)",
|
||||
(int)nelems, (int)ct ? ct->effective_bits : -1);
|
||||
(int)nelems, (long)ct ? ct->effective_bits : -1);
|
||||
if(nelems < 0) _ASN_DECODE_STARVED;
|
||||
}
|
||||
|
||||
|
@ -384,7 +384,7 @@ buffer_dump() {
|
||||
(long)DynamicBuffer.length - 1,
|
||||
(long)8 - DynamicBuffer.unbits);
|
||||
} else {
|
||||
fprintf(stderr, " %d\n", DynamicBuffer.length);
|
||||
fprintf(stderr, " %ld\n", DynamicBuffer.length);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,26 +9,26 @@
|
||||
|
||||
char *
|
||||
per_data_string(asn_per_data_t *pd) {
|
||||
static char buf[2][32];
|
||||
static int n;
|
||||
n = (n+1) % 2;
|
||||
snprintf(buf[n], sizeof(buf),
|
||||
"{m=%d span %+d[%d..%d] (%d)}",
|
||||
pd->moved,
|
||||
(((int)pd->buffer) & 0xf),
|
||||
pd->nboff, pd->nbits,
|
||||
pd->nbits - pd->nboff);
|
||||
return buf[n];
|
||||
static char buf[2][32];
|
||||
static int n;
|
||||
n = (n+1) % 2;
|
||||
snprintf(buf[n], sizeof(buf[n]),
|
||||
"{m=%ld span %+ld[%d..%d] (%d)}",
|
||||
(long)pd->moved,
|
||||
(((long)pd->buffer) & 0xf),
|
||||
(int)pd->nboff, (int)pd->nbits,
|
||||
(int)(pd->nbits - pd->nboff));
|
||||
return buf[n];
|
||||
}
|
||||
|
||||
void
|
||||
per_get_undo(asn_per_data_t *pd, int nbits) {
|
||||
if((ssize_t)pd->nboff < nbits) {
|
||||
assert((ssize_t)pd->nboff < nbits);
|
||||
} else {
|
||||
pd->nboff -= nbits;
|
||||
pd->moved -= nbits;
|
||||
}
|
||||
if((ssize_t)pd->nboff < nbits) {
|
||||
assert((ssize_t)pd->nboff < nbits);
|
||||
} else {
|
||||
pd->nboff -= nbits;
|
||||
pd->moved -= nbits;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -36,83 +36,84 @@ per_get_undo(asn_per_data_t *pd, int nbits) {
|
||||
*/
|
||||
int32_t
|
||||
per_get_few_bits(asn_per_data_t *pd, int nbits) {
|
||||
size_t off; /* Next after last bit offset */
|
||||
ssize_t nleft; /* Number of bits left in this stream */
|
||||
uint32_t accum;
|
||||
const uint8_t *buf;
|
||||
size_t off; /* Next after last bit offset */
|
||||
ssize_t nleft; /* Number of bits left in this stream */
|
||||
uint32_t accum;
|
||||
const uint8_t *buf;
|
||||
|
||||
if(nbits < 0)
|
||||
return -1;
|
||||
if(nbits < 0)
|
||||
return -1;
|
||||
|
||||
nleft = pd->nbits - pd->nboff;
|
||||
if(nbits > nleft) {
|
||||
int32_t tailv, vhead;
|
||||
if(!pd->refill || nbits > 31) return -1;
|
||||
/* Accumulate unused bytes before refill */
|
||||
ASN_DEBUG("Obtain the rest %d bits (want %d)", nleft, nbits);
|
||||
tailv = per_get_few_bits(pd, nleft);
|
||||
if(tailv < 0) return -1;
|
||||
/* Refill (replace pd contents with new data) */
|
||||
if(pd->refill(pd))
|
||||
return -1;
|
||||
nbits -= nleft;
|
||||
vhead = per_get_few_bits(pd, nbits);
|
||||
/* Combine the rest of previous pd with the head of new one */
|
||||
tailv = (tailv << nbits) | vhead; /* Could == -1 */
|
||||
return tailv;
|
||||
}
|
||||
nleft = pd->nbits - pd->nboff;
|
||||
if(nbits > nleft) {
|
||||
int32_t tailv, vhead;
|
||||
if(!pd->refill || nbits > 31) return -1;
|
||||
/* Accumulate unused bytes before refill */
|
||||
ASN_DEBUG("Obtain the rest %d bits (want %d)",
|
||||
(int)nleft, (int)nbits);
|
||||
tailv = per_get_few_bits(pd, nleft);
|
||||
if(tailv < 0) return -1;
|
||||
/* Refill (replace pd contents with new data) */
|
||||
if(pd->refill(pd))
|
||||
return -1;
|
||||
nbits -= nleft;
|
||||
vhead = per_get_few_bits(pd, nbits);
|
||||
/* Combine the rest of previous pd with the head of new one */
|
||||
tailv = (tailv << nbits) | vhead; /* Could == -1 */
|
||||
return tailv;
|
||||
}
|
||||
|
||||
/*
|
||||
* Normalize position indicator.
|
||||
*/
|
||||
if(pd->nboff >= 8) {
|
||||
pd->buffer += (pd->nboff >> 3);
|
||||
pd->nbits -= (pd->nboff & ~0x07);
|
||||
pd->nboff &= 0x07;
|
||||
}
|
||||
pd->moved += nbits;
|
||||
pd->nboff += nbits;
|
||||
off = pd->nboff;
|
||||
buf = pd->buffer;
|
||||
/*
|
||||
* Normalize position indicator.
|
||||
*/
|
||||
if(pd->nboff >= 8) {
|
||||
pd->buffer += (pd->nboff >> 3);
|
||||
pd->nbits -= (pd->nboff & ~0x07);
|
||||
pd->nboff &= 0x07;
|
||||
}
|
||||
pd->moved += nbits;
|
||||
pd->nboff += nbits;
|
||||
off = pd->nboff;
|
||||
buf = pd->buffer;
|
||||
|
||||
/*
|
||||
* Extract specified number of bits.
|
||||
*/
|
||||
if(off <= 8)
|
||||
accum = nbits ? (buf[0]) >> (8 - off) : 0;
|
||||
else if(off <= 16)
|
||||
accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
|
||||
else if(off <= 24)
|
||||
accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
|
||||
else if(off <= 31)
|
||||
accum = ((buf[0] << 24) + (buf[1] << 16)
|
||||
+ (buf[2] << 8) + (buf[3])) >> (32 - off);
|
||||
else if(nbits <= 31) {
|
||||
asn_per_data_t tpd = *pd;
|
||||
/* Here are we with our 31-bits limit plus 1..7 bits offset. */
|
||||
per_get_undo(&tpd, nbits);
|
||||
/* The number of available bits in the stream allow
|
||||
* for the following operations to take place without
|
||||
* invoking the ->refill() function */
|
||||
accum = per_get_few_bits(&tpd, nbits - 24) << 24;
|
||||
accum |= per_get_few_bits(&tpd, 24);
|
||||
} else {
|
||||
per_get_undo(pd, nbits);
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* Extract specified number of bits.
|
||||
*/
|
||||
if(off <= 8)
|
||||
accum = nbits ? (buf[0]) >> (8 - off) : 0;
|
||||
else if(off <= 16)
|
||||
accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
|
||||
else if(off <= 24)
|
||||
accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
|
||||
else if(off <= 31)
|
||||
accum = ((buf[0] << 24) + (buf[1] << 16)
|
||||
+ (buf[2] << 8) + (buf[3])) >> (32 - off);
|
||||
else if(nbits <= 31) {
|
||||
asn_per_data_t tpd = *pd;
|
||||
/* Here are we with our 31-bits limit plus 1..7 bits offset. */
|
||||
per_get_undo(&tpd, nbits);
|
||||
/* The number of available bits in the stream allow
|
||||
* for the following operations to take place without
|
||||
* invoking the ->refill() function */
|
||||
accum = per_get_few_bits(&tpd, nbits - 24) << 24;
|
||||
accum |= per_get_few_bits(&tpd, 24);
|
||||
} else {
|
||||
per_get_undo(pd, nbits);
|
||||
return -1;
|
||||
}
|
||||
|
||||
accum &= (((uint32_t)1 << nbits) - 1);
|
||||
accum &= (((uint32_t)1 << nbits) - 1);
|
||||
|
||||
ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+d[%d..%d]:%02x (%d) => 0x%x]",
|
||||
nbits, nleft,
|
||||
pd->moved,
|
||||
(((int)pd->buffer) & 0xf),
|
||||
pd->nboff, pd->nbits,
|
||||
pd->buffer[0],
|
||||
pd->nbits - pd->nboff,
|
||||
(int)accum);
|
||||
ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
|
||||
(int)nbits, (int)nleft,
|
||||
(int)pd->moved,
|
||||
(((long)pd->buffer) & 0xf),
|
||||
(int)pd->nboff, (int)pd->nbits,
|
||||
((pd->buffer != NULL)?pd->buffer[0]:0),
|
||||
(int)(pd->nbits - pd->nboff),
|
||||
(int)accum);
|
||||
|
||||
return accum;
|
||||
return accum;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -120,70 +121,76 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
|
||||
*/
|
||||
int
|
||||
per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int alright, int nbits) {
|
||||
int32_t value;
|
||||
int32_t value;
|
||||
|
||||
if(alright && (nbits & 7)) {
|
||||
/* Perform right alignment of a first few bits */
|
||||
value = per_get_few_bits(pd, nbits & 0x07);
|
||||
if(value < 0) return -1;
|
||||
*dst++ = value; /* value is already right-aligned */
|
||||
nbits &= ~7;
|
||||
}
|
||||
if(alright && (nbits & 7)) {
|
||||
/* Perform right alignment of a first few bits */
|
||||
value = per_get_few_bits(pd, nbits & 0x07);
|
||||
if(value < 0) return -1;
|
||||
*dst++ = value; /* value is already right-aligned */
|
||||
nbits &= ~7;
|
||||
}
|
||||
|
||||
while(nbits) {
|
||||
if(nbits >= 24) {
|
||||
value = per_get_few_bits(pd, 24);
|
||||
if(value < 0) return -1;
|
||||
*(dst++) = value >> 16;
|
||||
*(dst++) = value >> 8;
|
||||
*(dst++) = value;
|
||||
nbits -= 24;
|
||||
} else {
|
||||
value = per_get_few_bits(pd, nbits);
|
||||
if(value < 0) return -1;
|
||||
if(nbits & 7) { /* implies left alignment */
|
||||
value <<= 8 - (nbits & 7),
|
||||
nbits += 8 - (nbits & 7);
|
||||
if(nbits > 24)
|
||||
*dst++ = value >> 24;
|
||||
}
|
||||
if(nbits > 16)
|
||||
*dst++ = value >> 16;
|
||||
if(nbits > 8)
|
||||
*dst++ = value >> 8;
|
||||
*dst++ = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while(nbits) {
|
||||
if(nbits >= 24) {
|
||||
value = per_get_few_bits(pd, 24);
|
||||
if(value < 0) return -1;
|
||||
*(dst++) = value >> 16;
|
||||
*(dst++) = value >> 8;
|
||||
*(dst++) = value;
|
||||
nbits -= 24;
|
||||
} else {
|
||||
value = per_get_few_bits(pd, nbits);
|
||||
if(value < 0) return -1;
|
||||
if(nbits & 7) { /* implies left alignment */
|
||||
value <<= 8 - (nbits & 7),
|
||||
nbits += 8 - (nbits & 7);
|
||||
if(nbits > 24)
|
||||
*dst++ = value >> 24;
|
||||
}
|
||||
if(nbits > 16)
|
||||
*dst++ = value >> 16;
|
||||
if(nbits > 8)
|
||||
*dst++ = value >> 8;
|
||||
*dst++ = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the length "n" from the stream.
|
||||
* X.691-201508 #10.9 General rules for encoding a length determinant.
|
||||
* Get the optionally constrained length "n" from the stream.
|
||||
*/
|
||||
ssize_t
|
||||
uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) {
|
||||
ssize_t value;
|
||||
ssize_t value;
|
||||
|
||||
*repeat = 0;
|
||||
*repeat = 0;
|
||||
|
||||
if(ebits >= 0) return per_get_few_bits(pd, ebits);
|
||||
/* #11.9.4.1 Encoding if constrained (according to effective bits) */
|
||||
if(ebits >= 0 && ebits <= 16) {
|
||||
return per_get_few_bits(pd, ebits);
|
||||
}
|
||||
|
||||
value = per_get_few_bits(pd, 8);
|
||||
if(value < 0) return -1;
|
||||
if((value & 128) == 0) /* #10.9.3.6 */
|
||||
return (value & 0x7F);
|
||||
if((value & 64) == 0) { /* #10.9.3.7 */
|
||||
value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
|
||||
if(value < 0) return -1;
|
||||
return value;
|
||||
}
|
||||
value &= 63; /* this is "m" from X.691, #10.9.3.8 */
|
||||
if(value < 1 || value > 4)
|
||||
return -1;
|
||||
*repeat = 1;
|
||||
return (16384 * value);
|
||||
value = per_get_few_bits(pd, 8);
|
||||
if((value & 0x80) == 0) { /* #11.9.3.6 */
|
||||
return (value & 0x7F);
|
||||
} else if((value & 0x40) == 0) { /* #11.9.3.7 */
|
||||
/* bit 8 ... set to 1 and bit 7 ... set to zero */
|
||||
value = ((value & 0x3f) << 8) | per_get_few_bits(pd, 8);
|
||||
return value; /* potential -1 from per_get_few_bits passes through. */
|
||||
} else if(value < 0) {
|
||||
return -1;
|
||||
}
|
||||
value &= 0x3f; /* this is "m" from X.691, #11.9.3.8 */
|
||||
if(value < 1 || value > 4) {
|
||||
return -1; /* Prohibited by #11.9.3.8 */
|
||||
}
|
||||
*repeat = 1;
|
||||
return (16384 * value);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -193,21 +200,21 @@ uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) {
|
||||
*/
|
||||
ssize_t
|
||||
uper_get_nslength(asn_per_data_t *pd) {
|
||||
ssize_t length;
|
||||
ssize_t length;
|
||||
|
||||
ASN_DEBUG("Getting normally small length");
|
||||
ASN_DEBUG("Getting normally small length");
|
||||
|
||||
if(per_get_few_bits(pd, 1) == 0) {
|
||||
length = per_get_few_bits(pd, 6) + 1;
|
||||
if(length <= 0) return -1;
|
||||
ASN_DEBUG("l=%d", length);
|
||||
return length;
|
||||
} else {
|
||||
int repeat;
|
||||
length = uper_get_length(pd, -1, &repeat);
|
||||
if(length >= 0 && !repeat) return length;
|
||||
return -1; /* Error, or do not support >16K extensions */
|
||||
}
|
||||
if(per_get_few_bits(pd, 1) == 0) {
|
||||
length = per_get_few_bits(pd, 6) + 1;
|
||||
if(length <= 0) return -1;
|
||||
ASN_DEBUG("l=%d", (int)length);
|
||||
return length;
|
||||
} else {
|
||||
int repeat;
|
||||
length = uper_get_length(pd, -1, &repeat);
|
||||
if(length >= 0 && !repeat) return length;
|
||||
return -1; /* Error, or do not support >16K extensions */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -216,135 +223,215 @@ uper_get_nslength(asn_per_data_t *pd) {
|
||||
*/
|
||||
ssize_t
|
||||
uper_get_nsnnwn(asn_per_data_t *pd) {
|
||||
ssize_t value;
|
||||
ssize_t value;
|
||||
|
||||
value = per_get_few_bits(pd, 7);
|
||||
if(value & 64) { /* implicit (value < 0) */
|
||||
value &= 63;
|
||||
value <<= 2;
|
||||
value |= per_get_few_bits(pd, 2);
|
||||
if(value & 128) /* implicit (value < 0) */
|
||||
return -1;
|
||||
if(value == 0)
|
||||
return 0;
|
||||
if(value >= 3)
|
||||
return -1;
|
||||
value = per_get_few_bits(pd, 8 * value);
|
||||
return value;
|
||||
}
|
||||
value = per_get_few_bits(pd, 7);
|
||||
if(value & 64) { /* implicit (value < 0) */
|
||||
value &= 63;
|
||||
value <<= 2;
|
||||
value |= per_get_few_bits(pd, 2);
|
||||
if(value & 128) /* implicit (value < 0) */
|
||||
return -1;
|
||||
if(value == 0)
|
||||
return 0;
|
||||
if(value >= 3)
|
||||
return -1;
|
||||
value = per_get_few_bits(pd, 8 * value);
|
||||
return value;
|
||||
}
|
||||
|
||||
return value;
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the normally small non-negative whole number.
|
||||
* X.691, #10.6
|
||||
* X.691-11/2008, #11.6
|
||||
* Encoding of a normally small non-negative whole number
|
||||
*/
|
||||
int
|
||||
uper_put_nsnnwn(asn_per_outp_t *po, int n) {
|
||||
int bytes;
|
||||
int bytes;
|
||||
|
||||
if(n <= 63) {
|
||||
if(n < 0) return -1;
|
||||
return per_put_few_bits(po, n, 7);
|
||||
}
|
||||
if(n < 256)
|
||||
bytes = 1;
|
||||
else if(n < 65536)
|
||||
bytes = 2;
|
||||
else if(n < 256 * 65536)
|
||||
bytes = 3;
|
||||
else
|
||||
return -1; /* This is not a "normally small" value */
|
||||
if(per_put_few_bits(po, bytes, 8))
|
||||
return -1;
|
||||
if(n <= 63) {
|
||||
if(n < 0) return -1;
|
||||
return per_put_few_bits(po, n, 7);
|
||||
}
|
||||
if(n < 256)
|
||||
bytes = 1;
|
||||
else if(n < 65536)
|
||||
bytes = 2;
|
||||
else if(n < 256 * 65536)
|
||||
bytes = 3;
|
||||
else
|
||||
return -1; /* This is not a "normally small" value */
|
||||
if(per_put_few_bits(po, bytes, 8))
|
||||
return -1;
|
||||
|
||||
return per_put_few_bits(po, n, 8 * bytes);
|
||||
return per_put_few_bits(po, n, 8 * bytes);
|
||||
}
|
||||
|
||||
|
||||
/* X.691-2008/11, #11.5.6 -> #11.3 */
|
||||
int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits) {
|
||||
unsigned long lhalf; /* Lower half of the number*/
|
||||
long half;
|
||||
|
||||
if(nbits <= 31) {
|
||||
half = per_get_few_bits(pd, nbits);
|
||||
if(half < 0) return -1;
|
||||
*out_value = half;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((size_t)nbits > 8 * sizeof(*out_value))
|
||||
return -1; /* RANGE */
|
||||
|
||||
half = per_get_few_bits(pd, 31);
|
||||
if(half < 0) return -1;
|
||||
|
||||
if(uper_get_constrained_whole_number(pd, &lhalf, nbits - 31))
|
||||
return -1;
|
||||
|
||||
*out_value = ((unsigned long)half << (nbits - 31)) | lhalf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* X.691-2008/11, #11.5.6 -> #11.3 */
|
||||
int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits) {
|
||||
/*
|
||||
* Assume signed number can be safely coerced into
|
||||
* unsigned of the same range.
|
||||
* The following testing code will likely be optimized out
|
||||
* by compiler if it is true.
|
||||
*/
|
||||
unsigned long uvalue1 = ULONG_MAX;
|
||||
long svalue = uvalue1;
|
||||
unsigned long uvalue2 = svalue;
|
||||
assert(uvalue1 == uvalue2);
|
||||
return uper_put_constrained_whole_number_u(po, v, nbits);
|
||||
}
|
||||
|
||||
int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits) {
|
||||
if(nbits <= 31) {
|
||||
return per_put_few_bits(po, v, nbits);
|
||||
} else {
|
||||
/* Put higher portion first, followed by lower 31-bit */
|
||||
if(uper_put_constrained_whole_number_u(po, v >> 31, nbits - 31))
|
||||
return -1;
|
||||
return per_put_few_bits(po, v, 31);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
per_put_aligned_flush(asn_per_outp_t *po) {
|
||||
uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07)));
|
||||
size_t complete_bytes =
|
||||
(po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3);
|
||||
|
||||
if(unused_bits) {
|
||||
po->buffer[po->nboff >> 3] &= ~0 << unused_bits;
|
||||
}
|
||||
|
||||
if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0) {
|
||||
return -1;
|
||||
} else {
|
||||
po->buffer = po->tmpspace;
|
||||
po->nboff = 0;
|
||||
po->nbits = 8 * sizeof(po->tmpspace);
|
||||
po->flushed_bytes += complete_bytes;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Put a small number of bits (<= 31).
|
||||
*/
|
||||
int
|
||||
per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
|
||||
size_t off; /* Next after last bit offset */
|
||||
size_t omsk; /* Existing last byte meaningful bits mask */
|
||||
uint8_t *buf;
|
||||
size_t off; /* Next after last bit offset */
|
||||
size_t omsk; /* Existing last byte meaningful bits mask */
|
||||
uint8_t *buf;
|
||||
|
||||
if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
|
||||
if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
|
||||
|
||||
ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
|
||||
obits, (int)bits, po->buffer, po->nboff);
|
||||
ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
|
||||
obits, (int)bits, po->buffer, (int)po->nboff);
|
||||
|
||||
/*
|
||||
* Normalize position indicator.
|
||||
*/
|
||||
if(po->nboff >= 8) {
|
||||
po->buffer += (po->nboff >> 3);
|
||||
po->nbits -= (po->nboff & ~0x07);
|
||||
po->nboff &= 0x07;
|
||||
}
|
||||
/*
|
||||
* Normalize position indicator.
|
||||
*/
|
||||
if(po->nboff >= 8) {
|
||||
po->buffer += (po->nboff >> 3);
|
||||
po->nbits -= (po->nboff & ~0x07);
|
||||
po->nboff &= 0x07;
|
||||
}
|
||||
|
||||
/*
|
||||
* Flush whole-bytes output, if necessary.
|
||||
*/
|
||||
if(po->nboff + obits > po->nbits) {
|
||||
int complete_bytes = (po->buffer - po->tmpspace);
|
||||
ASN_DEBUG("[PER output %d complete + %d]",
|
||||
complete_bytes, po->flushed_bytes);
|
||||
if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0)
|
||||
return -1;
|
||||
if(po->nboff)
|
||||
po->tmpspace[0] = po->buffer[0];
|
||||
po->buffer = po->tmpspace;
|
||||
po->nbits = 8 * sizeof(po->tmpspace);
|
||||
po->flushed_bytes += complete_bytes;
|
||||
}
|
||||
/*
|
||||
* Flush whole-bytes output, if necessary.
|
||||
*/
|
||||
if(po->nboff + obits > po->nbits) {
|
||||
size_t complete_bytes;
|
||||
if(!po->buffer) po->buffer = po->tmpspace;
|
||||
complete_bytes = (po->buffer - po->tmpspace);
|
||||
ASN_DEBUG("[PER output %ld complete + %ld]",
|
||||
(long)complete_bytes, (long)po->flushed_bytes);
|
||||
if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0)
|
||||
return -1;
|
||||
if(po->nboff)
|
||||
po->tmpspace[0] = po->buffer[0];
|
||||
po->buffer = po->tmpspace;
|
||||
po->nbits = 8 * sizeof(po->tmpspace);
|
||||
po->flushed_bytes += complete_bytes;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now, due to sizeof(tmpspace), we are guaranteed large enough space.
|
||||
*/
|
||||
buf = po->buffer;
|
||||
omsk = ~((1 << (8 - po->nboff)) - 1);
|
||||
off = (po->nboff += obits);
|
||||
/*
|
||||
* Now, due to sizeof(tmpspace), we are guaranteed large enough space.
|
||||
*/
|
||||
buf = po->buffer;
|
||||
omsk = ~((1 << (8 - po->nboff)) - 1);
|
||||
off = (po->nboff + obits);
|
||||
|
||||
/* Clear data of debris before meaningful bits */
|
||||
bits &= (((uint32_t)1 << obits) - 1);
|
||||
/* Clear data of debris before meaningful bits */
|
||||
bits &= (((uint32_t)1 << obits) - 1);
|
||||
|
||||
ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
|
||||
(int)bits, (int)bits,
|
||||
po->nboff - obits, off, buf[0], omsk&0xff, buf[0] & omsk);
|
||||
ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
|
||||
(int)bits, (int)bits,
|
||||
(int)po->nboff, (int)off,
|
||||
buf[0], (int)(omsk&0xff),
|
||||
(int)(buf[0] & omsk));
|
||||
|
||||
if(off <= 8) /* Completely within 1 byte */
|
||||
bits <<= (8 - off),
|
||||
buf[0] = (buf[0] & omsk) | bits;
|
||||
else if(off <= 16)
|
||||
bits <<= (16 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 8),
|
||||
buf[1] = bits;
|
||||
else if(off <= 24)
|
||||
bits <<= (24 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 16),
|
||||
buf[1] = bits >> 8,
|
||||
buf[2] = bits;
|
||||
else if(off <= 31)
|
||||
bits <<= (32 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 24),
|
||||
buf[1] = bits >> 16,
|
||||
buf[2] = bits >> 8,
|
||||
buf[3] = bits;
|
||||
else {
|
||||
ASN_DEBUG("->[PER out split %d]", obits);
|
||||
per_put_few_bits(po, bits >> 8, 24);
|
||||
per_put_few_bits(po, bits, obits - 24);
|
||||
ASN_DEBUG("<-[PER out split %d]", obits);
|
||||
}
|
||||
if(off <= 8) /* Completely within 1 byte */
|
||||
po->nboff = off,
|
||||
bits <<= (8 - off),
|
||||
buf[0] = (buf[0] & omsk) | bits;
|
||||
else if(off <= 16)
|
||||
po->nboff = off,
|
||||
bits <<= (16 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 8),
|
||||
buf[1] = bits;
|
||||
else if(off <= 24)
|
||||
po->nboff = off,
|
||||
bits <<= (24 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 16),
|
||||
buf[1] = bits >> 8,
|
||||
buf[2] = bits;
|
||||
else if(off <= 31)
|
||||
po->nboff = off,
|
||||
bits <<= (32 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 24),
|
||||
buf[1] = bits >> 16,
|
||||
buf[2] = bits >> 8,
|
||||
buf[3] = bits;
|
||||
else {
|
||||
if(per_put_few_bits(po, bits >> (obits - 24), 24)) return -1;
|
||||
if(per_put_few_bits(po, bits, obits - 24)) return -1;
|
||||
}
|
||||
|
||||
ASN_DEBUG("[PER out %u/%x => %02x buf+%d]",
|
||||
(int)bits, (int)bits, buf[0], po->buffer - po->tmpspace);
|
||||
ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
|
||||
(int)bits, (int)bits, buf[0],
|
||||
(long)(po->buffer - po->tmpspace));
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -354,30 +441,30 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
|
||||
int
|
||||
per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) {
|
||||
|
||||
while(nbits) {
|
||||
uint32_t value;
|
||||
while(nbits) {
|
||||
uint32_t value;
|
||||
|
||||
if(nbits >= 24) {
|
||||
value = (src[0] << 16) | (src[1] << 8) | src[2];
|
||||
src += 3;
|
||||
nbits -= 24;
|
||||
if(per_put_few_bits(po, value, 24))
|
||||
return -1;
|
||||
} else {
|
||||
value = src[0];
|
||||
if(nbits > 8)
|
||||
value = (value << 8) | src[1];
|
||||
if(nbits > 16)
|
||||
value = (value << 8) | src[2];
|
||||
if(nbits & 0x07)
|
||||
value >>= (8 - (nbits & 0x07));
|
||||
if(per_put_few_bits(po, value, nbits))
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(nbits >= 24) {
|
||||
value = (src[0] << 16) | (src[1] << 8) | src[2];
|
||||
src += 3;
|
||||
nbits -= 24;
|
||||
if(per_put_few_bits(po, value, 24))
|
||||
return -1;
|
||||
} else {
|
||||
value = src[0];
|
||||
if(nbits > 8)
|
||||
value = (value << 8) | src[1];
|
||||
if(nbits > 16)
|
||||
value = (value << 8) | src[2];
|
||||
if(nbits & 0x07)
|
||||
value >>= (8 - (nbits & 0x07));
|
||||
if(per_put_few_bits(po, value, nbits))
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -386,18 +473,18 @@ per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) {
|
||||
ssize_t
|
||||
uper_put_length(asn_per_outp_t *po, size_t length) {
|
||||
|
||||
if(length <= 127) /* #10.9.3.6 */
|
||||
return per_put_few_bits(po, length, 8)
|
||||
? -1 : (ssize_t)length;
|
||||
else if(length < 16384) /* #10.9.3.7 */
|
||||
return per_put_few_bits(po, length|0x8000, 16)
|
||||
? -1 : (ssize_t)length;
|
||||
if(length <= 127) /* #10.9.3.6 */
|
||||
return per_put_few_bits(po, length, 8)
|
||||
? -1 : (ssize_t)length;
|
||||
else if(length < 16384) /* #10.9.3.7 */
|
||||
return per_put_few_bits(po, length|0x8000, 16)
|
||||
? -1 : (ssize_t)length;
|
||||
|
||||
length >>= 14;
|
||||
if(length > 4) length = 4;
|
||||
length >>= 14;
|
||||
if(length > 4) length = 4;
|
||||
|
||||
return per_put_few_bits(po, 0xC0 | length, 8)
|
||||
? -1 : (ssize_t)(length << 14);
|
||||
return per_put_few_bits(po, 0xC0 | length, 8)
|
||||
? -1 : (ssize_t)(length << 14);
|
||||
}
|
||||
|
||||
|
||||
@ -409,17 +496,16 @@ uper_put_length(asn_per_outp_t *po, size_t length) {
|
||||
int
|
||||
uper_put_nslength(asn_per_outp_t *po, size_t length) {
|
||||
|
||||
if(length <= 64) {
|
||||
/* #10.9.3.4 */
|
||||
if(length == 0) return -1;
|
||||
return per_put_few_bits(po, length-1, 7) ? -1 : 0;
|
||||
} else {
|
||||
if(uper_put_length(po, length) != (ssize_t)length) {
|
||||
/* This might happen in case of >16K extensions */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if(length <= 64) {
|
||||
/* #10.9.3.4 */
|
||||
if(length == 0) return -1;
|
||||
return per_put_few_bits(po, length-1, 7) ? -1 : 0;
|
||||
} else {
|
||||
if(uper_put_length(po, length) != (ssize_t)length) {
|
||||
/* This might happen in case of >16K extensions */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
* All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#ifndef _PER_SUPPORT_H_
|
||||
#define _PER_SUPPORT_H_
|
||||
#ifndef _PER_SUPPORT_H_
|
||||
#define _PER_SUPPORT_H_
|
||||
|
||||
#include <asn_system.h> /* Platform-specific types */
|
||||
#include <asn_system.h> /* Platform-specific types */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -15,23 +15,23 @@ extern "C" {
|
||||
/*
|
||||
* Pre-computed PER constraints.
|
||||
*/
|
||||
typedef struct asn_per_constraint_s {
|
||||
enum asn_per_constraint_flags {
|
||||
APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
|
||||
APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
|
||||
APC_CONSTRAINED = 0x2, /* Fully constrained */
|
||||
APC_EXTENSIBLE = 0x4 /* May have extension */
|
||||
} flags;
|
||||
int range_bits; /* Full number of bits in the range */
|
||||
int effective_bits; /* Effective bits */
|
||||
long lower_bound; /* "lb" value */
|
||||
long upper_bound; /* "ub" value */
|
||||
typedef const struct asn_per_constraint_s {
|
||||
enum asn_per_constraint_flags {
|
||||
APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
|
||||
APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
|
||||
APC_CONSTRAINED = 0x2, /* Fully constrained */
|
||||
APC_EXTENSIBLE = 0x4 /* May have extension */
|
||||
} flags;
|
||||
int range_bits; /* Full number of bits in the range */
|
||||
int effective_bits; /* Effective bits */
|
||||
long lower_bound; /* "lb" value */
|
||||
long upper_bound; /* "ub" value */
|
||||
} asn_per_constraint_t;
|
||||
typedef struct asn_per_constraints_s {
|
||||
asn_per_constraint_t value;
|
||||
asn_per_constraint_t size;
|
||||
int (*value2code)(unsigned int value);
|
||||
int (*code2value)(unsigned int code);
|
||||
typedef const struct asn_per_constraints_s {
|
||||
struct asn_per_constraint_s value;
|
||||
struct asn_per_constraint_s size;
|
||||
int (*value2code)(unsigned int value);
|
||||
int (*code2value)(unsigned int code);
|
||||
} asn_per_constraints_t;
|
||||
|
||||
/*
|
||||
@ -62,14 +62,14 @@ void per_get_undo(asn_per_data_t *per_data, int get_nbits);
|
||||
* extracted due to EOD or other conditions.
|
||||
*/
|
||||
int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align,
|
||||
int get_nbits);
|
||||
int get_nbits);
|
||||
|
||||
/*
|
||||
* Get the length "n" from the Unaligned PER stream.
|
||||
*/
|
||||
ssize_t uper_get_length(asn_per_data_t *pd,
|
||||
int effective_bound_bits,
|
||||
int *repeat);
|
||||
int effective_bound_bits,
|
||||
int *repeat);
|
||||
|
||||
/*
|
||||
* Get the normally small length "n".
|
||||
@ -81,6 +81,9 @@ ssize_t uper_get_nslength(asn_per_data_t *pd);
|
||||
*/
|
||||
ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
|
||||
|
||||
/* X.691-2008/11, #11.5.6 */
|
||||
int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits);
|
||||
|
||||
/* Non-thread-safe debugging function, don't use it */
|
||||
char *per_data_string(asn_per_data_t *pd);
|
||||
|
||||
@ -88,13 +91,13 @@ char *per_data_string(asn_per_data_t *pd);
|
||||
* This structure supports forming PER output.
|
||||
*/
|
||||
typedef struct asn_per_outp_s {
|
||||
uint8_t *buffer; /* Pointer into the (tmpspace) */
|
||||
size_t nboff; /* Bit offset to the meaningful bit */
|
||||
size_t nbits; /* Number of bits left in (tmpspace) */
|
||||
uint8_t tmpspace[32]; /* Preliminary storage to hold data */
|
||||
int (*outper)(const void *data, size_t size, void *op_key);
|
||||
void *op_key; /* Key for (outper) data callback */
|
||||
size_t flushed_bytes; /* Bytes already flushed through (outper) */
|
||||
uint8_t *buffer; /* Pointer into the (tmpspace) */
|
||||
size_t nboff; /* Bit offset to the meaningful bit */
|
||||
size_t nbits; /* Number of bits left in (tmpspace) */
|
||||
uint8_t tmpspace[32]; /* Preliminary storage to hold data */
|
||||
int (*outper)(const void *data, size_t size, void *op_key);
|
||||
void *op_key; /* Key for (outper) data callback */
|
||||
size_t flushed_bytes; /* Bytes already flushed through (outper) */
|
||||
} asn_per_outp_t;
|
||||
|
||||
/* Output a small number of bits (<= 31) */
|
||||
@ -103,6 +106,17 @@ int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits);
|
||||
/* Output a large number of bits */
|
||||
int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits);
|
||||
|
||||
/*
|
||||
* Flush whole bytes (0 or more) through (outper) member.
|
||||
* The least significant bits which are not used are guaranteed to be set to 0.
|
||||
* Returns -1 if callback returns -1. Otherwise, 0.
|
||||
*/
|
||||
int per_put_aligned_flush(asn_per_outp_t *po);
|
||||
|
||||
/* X.691-2008/11, #11.5 */
|
||||
int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits);
|
||||
int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits);
|
||||
|
||||
/*
|
||||
* Put the length "n" to the Unaligned PER stream.
|
||||
* This function returns the number of units which may be flushed
|
||||
@ -125,4 +139,4 @@ int uper_put_nsnnwn(asn_per_outp_t *po, int n);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _PER_SUPPORT_H_ */
|
||||
#endif /* _PER_SUPPORT_H_ */
|
||||
|
@ -107,7 +107,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
tmp.size = length;
|
||||
|
||||
if((specs&&specs->field_unsigned)
|
||||
? asn_INTEGER2ulong(&tmp, &l)
|
||||
? asn_INTEGER2ulong(&tmp, (unsigned long *)&l)
|
||||
: asn_INTEGER2long(&tmp, &l)) {
|
||||
rval.code = RC_FAIL;
|
||||
rval.consumed = 0;
|
||||
@ -187,7 +187,7 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
|
||||
if(rval.code == RC_OK) {
|
||||
long l;
|
||||
if((specs&&specs->field_unsigned)
|
||||
? asn_INTEGER2ulong(&st, &l)
|
||||
? asn_INTEGER2ulong(&st, (unsigned long *)&l)
|
||||
: asn_INTEGER2long(&st, &l)) {
|
||||
rval.code = RC_FAIL;
|
||||
rval.consumed = 0;
|
||||
@ -255,7 +255,7 @@ NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
|
||||
&tmpintptr, pd);
|
||||
if(rval.code == RC_OK) {
|
||||
if((specs&&specs->field_unsigned)
|
||||
? asn_INTEGER2ulong(&tmpint, native)
|
||||
? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
|
||||
: asn_INTEGER2long(&tmpint, native))
|
||||
rval.code = RC_FAIL;
|
||||
else
|
||||
|
@ -915,7 +915,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
nelems = uper_get_length(pd,
|
||||
ct ? ct->effective_bits : -1, &repeat);
|
||||
ASN_DEBUG("Got to decode %d elements (eff %d)",
|
||||
(int)nelems, (int)ct ? ct->effective_bits : -1);
|
||||
(int)nelems, (long)ct ? ct->effective_bits : -1);
|
||||
if(nelems < 0) _ASN_DECODE_STARVED;
|
||||
}
|
||||
|
||||
|
@ -9,26 +9,26 @@
|
||||
|
||||
char *
|
||||
per_data_string(asn_per_data_t *pd) {
|
||||
static char buf[2][32];
|
||||
static int n;
|
||||
n = (n+1) % 2;
|
||||
snprintf(buf[n], sizeof(buf),
|
||||
"{m=%d span %+d[%d..%d] (%d)}",
|
||||
pd->moved,
|
||||
(((int)pd->buffer) & 0xf),
|
||||
pd->nboff, pd->nbits,
|
||||
pd->nbits - pd->nboff);
|
||||
return buf[n];
|
||||
static char buf[2][32];
|
||||
static int n;
|
||||
n = (n+1) % 2;
|
||||
snprintf(buf[n], sizeof(buf[n]),
|
||||
"{m=%ld span %+ld[%d..%d] (%d)}",
|
||||
(long)pd->moved,
|
||||
(((long)pd->buffer) & 0xf),
|
||||
(int)pd->nboff, (int)pd->nbits,
|
||||
(int)(pd->nbits - pd->nboff));
|
||||
return buf[n];
|
||||
}
|
||||
|
||||
void
|
||||
per_get_undo(asn_per_data_t *pd, int nbits) {
|
||||
if((ssize_t)pd->nboff < nbits) {
|
||||
assert((ssize_t)pd->nboff < nbits);
|
||||
} else {
|
||||
pd->nboff -= nbits;
|
||||
pd->moved -= nbits;
|
||||
}
|
||||
if((ssize_t)pd->nboff < nbits) {
|
||||
assert((ssize_t)pd->nboff < nbits);
|
||||
} else {
|
||||
pd->nboff -= nbits;
|
||||
pd->moved -= nbits;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -36,83 +36,84 @@ per_get_undo(asn_per_data_t *pd, int nbits) {
|
||||
*/
|
||||
int32_t
|
||||
per_get_few_bits(asn_per_data_t *pd, int nbits) {
|
||||
size_t off; /* Next after last bit offset */
|
||||
ssize_t nleft; /* Number of bits left in this stream */
|
||||
uint32_t accum;
|
||||
const uint8_t *buf;
|
||||
size_t off; /* Next after last bit offset */
|
||||
ssize_t nleft; /* Number of bits left in this stream */
|
||||
uint32_t accum;
|
||||
const uint8_t *buf;
|
||||
|
||||
if(nbits < 0)
|
||||
return -1;
|
||||
if(nbits < 0)
|
||||
return -1;
|
||||
|
||||
nleft = pd->nbits - pd->nboff;
|
||||
if(nbits > nleft) {
|
||||
int32_t tailv, vhead;
|
||||
if(!pd->refill || nbits > 31) return -1;
|
||||
/* Accumulate unused bytes before refill */
|
||||
ASN_DEBUG("Obtain the rest %d bits (want %d)", nleft, nbits);
|
||||
tailv = per_get_few_bits(pd, nleft);
|
||||
if(tailv < 0) return -1;
|
||||
/* Refill (replace pd contents with new data) */
|
||||
if(pd->refill(pd))
|
||||
return -1;
|
||||
nbits -= nleft;
|
||||
vhead = per_get_few_bits(pd, nbits);
|
||||
/* Combine the rest of previous pd with the head of new one */
|
||||
tailv = (tailv << nbits) | vhead; /* Could == -1 */
|
||||
return tailv;
|
||||
}
|
||||
nleft = pd->nbits - pd->nboff;
|
||||
if(nbits > nleft) {
|
||||
int32_t tailv, vhead;
|
||||
if(!pd->refill || nbits > 31) return -1;
|
||||
/* Accumulate unused bytes before refill */
|
||||
ASN_DEBUG("Obtain the rest %d bits (want %d)",
|
||||
(int)nleft, (int)nbits);
|
||||
tailv = per_get_few_bits(pd, nleft);
|
||||
if(tailv < 0) return -1;
|
||||
/* Refill (replace pd contents with new data) */
|
||||
if(pd->refill(pd))
|
||||
return -1;
|
||||
nbits -= nleft;
|
||||
vhead = per_get_few_bits(pd, nbits);
|
||||
/* Combine the rest of previous pd with the head of new one */
|
||||
tailv = (tailv << nbits) | vhead; /* Could == -1 */
|
||||
return tailv;
|
||||
}
|
||||
|
||||
/*
|
||||
* Normalize position indicator.
|
||||
*/
|
||||
if(pd->nboff >= 8) {
|
||||
pd->buffer += (pd->nboff >> 3);
|
||||
pd->nbits -= (pd->nboff & ~0x07);
|
||||
pd->nboff &= 0x07;
|
||||
}
|
||||
pd->moved += nbits;
|
||||
pd->nboff += nbits;
|
||||
off = pd->nboff;
|
||||
buf = pd->buffer;
|
||||
/*
|
||||
* Normalize position indicator.
|
||||
*/
|
||||
if(pd->nboff >= 8) {
|
||||
pd->buffer += (pd->nboff >> 3);
|
||||
pd->nbits -= (pd->nboff & ~0x07);
|
||||
pd->nboff &= 0x07;
|
||||
}
|
||||
pd->moved += nbits;
|
||||
pd->nboff += nbits;
|
||||
off = pd->nboff;
|
||||
buf = pd->buffer;
|
||||
|
||||
/*
|
||||
* Extract specified number of bits.
|
||||
*/
|
||||
if(off <= 8)
|
||||
accum = nbits ? (buf[0]) >> (8 - off) : 0;
|
||||
else if(off <= 16)
|
||||
accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
|
||||
else if(off <= 24)
|
||||
accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
|
||||
else if(off <= 31)
|
||||
accum = ((buf[0] << 24) + (buf[1] << 16)
|
||||
+ (buf[2] << 8) + (buf[3])) >> (32 - off);
|
||||
else if(nbits <= 31) {
|
||||
asn_per_data_t tpd = *pd;
|
||||
/* Here are we with our 31-bits limit plus 1..7 bits offset. */
|
||||
per_get_undo(&tpd, nbits);
|
||||
/* The number of available bits in the stream allow
|
||||
* for the following operations to take place without
|
||||
* invoking the ->refill() function */
|
||||
accum = per_get_few_bits(&tpd, nbits - 24) << 24;
|
||||
accum |= per_get_few_bits(&tpd, 24);
|
||||
} else {
|
||||
per_get_undo(pd, nbits);
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* Extract specified number of bits.
|
||||
*/
|
||||
if(off <= 8)
|
||||
accum = nbits ? (buf[0]) >> (8 - off) : 0;
|
||||
else if(off <= 16)
|
||||
accum = ((buf[0] << 8) + buf[1]) >> (16 - off);
|
||||
else if(off <= 24)
|
||||
accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off);
|
||||
else if(off <= 31)
|
||||
accum = ((buf[0] << 24) + (buf[1] << 16)
|
||||
+ (buf[2] << 8) + (buf[3])) >> (32 - off);
|
||||
else if(nbits <= 31) {
|
||||
asn_per_data_t tpd = *pd;
|
||||
/* Here are we with our 31-bits limit plus 1..7 bits offset. */
|
||||
per_get_undo(&tpd, nbits);
|
||||
/* The number of available bits in the stream allow
|
||||
* for the following operations to take place without
|
||||
* invoking the ->refill() function */
|
||||
accum = per_get_few_bits(&tpd, nbits - 24) << 24;
|
||||
accum |= per_get_few_bits(&tpd, 24);
|
||||
} else {
|
||||
per_get_undo(pd, nbits);
|
||||
return -1;
|
||||
}
|
||||
|
||||
accum &= (((uint32_t)1 << nbits) - 1);
|
||||
accum &= (((uint32_t)1 << nbits) - 1);
|
||||
|
||||
ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+d[%d..%d]:%02x (%d) => 0x%x]",
|
||||
nbits, nleft,
|
||||
pd->moved,
|
||||
(((int)pd->buffer) & 0xf),
|
||||
pd->nboff, pd->nbits,
|
||||
pd->buffer[0],
|
||||
pd->nbits - pd->nboff,
|
||||
(int)accum);
|
||||
ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
|
||||
(int)nbits, (int)nleft,
|
||||
(int)pd->moved,
|
||||
(((long)pd->buffer) & 0xf),
|
||||
(int)pd->nboff, (int)pd->nbits,
|
||||
((pd->buffer != NULL)?pd->buffer[0]:0),
|
||||
(int)(pd->nbits - pd->nboff),
|
||||
(int)accum);
|
||||
|
||||
return accum;
|
||||
return accum;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -120,70 +121,76 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
|
||||
*/
|
||||
int
|
||||
per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int alright, int nbits) {
|
||||
int32_t value;
|
||||
int32_t value;
|
||||
|
||||
if(alright && (nbits & 7)) {
|
||||
/* Perform right alignment of a first few bits */
|
||||
value = per_get_few_bits(pd, nbits & 0x07);
|
||||
if(value < 0) return -1;
|
||||
*dst++ = value; /* value is already right-aligned */
|
||||
nbits &= ~7;
|
||||
}
|
||||
if(alright && (nbits & 7)) {
|
||||
/* Perform right alignment of a first few bits */
|
||||
value = per_get_few_bits(pd, nbits & 0x07);
|
||||
if(value < 0) return -1;
|
||||
*dst++ = value; /* value is already right-aligned */
|
||||
nbits &= ~7;
|
||||
}
|
||||
|
||||
while(nbits) {
|
||||
if(nbits >= 24) {
|
||||
value = per_get_few_bits(pd, 24);
|
||||
if(value < 0) return -1;
|
||||
*(dst++) = value >> 16;
|
||||
*(dst++) = value >> 8;
|
||||
*(dst++) = value;
|
||||
nbits -= 24;
|
||||
} else {
|
||||
value = per_get_few_bits(pd, nbits);
|
||||
if(value < 0) return -1;
|
||||
if(nbits & 7) { /* implies left alignment */
|
||||
value <<= 8 - (nbits & 7),
|
||||
nbits += 8 - (nbits & 7);
|
||||
if(nbits > 24)
|
||||
*dst++ = value >> 24;
|
||||
}
|
||||
if(nbits > 16)
|
||||
*dst++ = value >> 16;
|
||||
if(nbits > 8)
|
||||
*dst++ = value >> 8;
|
||||
*dst++ = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while(nbits) {
|
||||
if(nbits >= 24) {
|
||||
value = per_get_few_bits(pd, 24);
|
||||
if(value < 0) return -1;
|
||||
*(dst++) = value >> 16;
|
||||
*(dst++) = value >> 8;
|
||||
*(dst++) = value;
|
||||
nbits -= 24;
|
||||
} else {
|
||||
value = per_get_few_bits(pd, nbits);
|
||||
if(value < 0) return -1;
|
||||
if(nbits & 7) { /* implies left alignment */
|
||||
value <<= 8 - (nbits & 7),
|
||||
nbits += 8 - (nbits & 7);
|
||||
if(nbits > 24)
|
||||
*dst++ = value >> 24;
|
||||
}
|
||||
if(nbits > 16)
|
||||
*dst++ = value >> 16;
|
||||
if(nbits > 8)
|
||||
*dst++ = value >> 8;
|
||||
*dst++ = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the length "n" from the stream.
|
||||
* X.691-201508 #10.9 General rules for encoding a length determinant.
|
||||
* Get the optionally constrained length "n" from the stream.
|
||||
*/
|
||||
ssize_t
|
||||
uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) {
|
||||
ssize_t value;
|
||||
ssize_t value;
|
||||
|
||||
*repeat = 0;
|
||||
*repeat = 0;
|
||||
|
||||
if(ebits >= 0) return per_get_few_bits(pd, ebits);
|
||||
/* #11.9.4.1 Encoding if constrained (according to effective bits) */
|
||||
if(ebits >= 0 && ebits <= 16) {
|
||||
return per_get_few_bits(pd, ebits);
|
||||
}
|
||||
|
||||
value = per_get_few_bits(pd, 8);
|
||||
if(value < 0) return -1;
|
||||
if((value & 128) == 0) /* #10.9.3.6 */
|
||||
return (value & 0x7F);
|
||||
if((value & 64) == 0) { /* #10.9.3.7 */
|
||||
value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
|
||||
if(value < 0) return -1;
|
||||
return value;
|
||||
}
|
||||
value &= 63; /* this is "m" from X.691, #10.9.3.8 */
|
||||
if(value < 1 || value > 4)
|
||||
return -1;
|
||||
*repeat = 1;
|
||||
return (16384 * value);
|
||||
value = per_get_few_bits(pd, 8);
|
||||
if((value & 0x80) == 0) { /* #11.9.3.6 */
|
||||
return (value & 0x7F);
|
||||
} else if((value & 0x40) == 0) { /* #11.9.3.7 */
|
||||
/* bit 8 ... set to 1 and bit 7 ... set to zero */
|
||||
value = ((value & 0x3f) << 8) | per_get_few_bits(pd, 8);
|
||||
return value; /* potential -1 from per_get_few_bits passes through. */
|
||||
} else if(value < 0) {
|
||||
return -1;
|
||||
}
|
||||
value &= 0x3f; /* this is "m" from X.691, #11.9.3.8 */
|
||||
if(value < 1 || value > 4) {
|
||||
return -1; /* Prohibited by #11.9.3.8 */
|
||||
}
|
||||
*repeat = 1;
|
||||
return (16384 * value);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -193,21 +200,21 @@ uper_get_length(asn_per_data_t *pd, int ebits, int *repeat) {
|
||||
*/
|
||||
ssize_t
|
||||
uper_get_nslength(asn_per_data_t *pd) {
|
||||
ssize_t length;
|
||||
ssize_t length;
|
||||
|
||||
ASN_DEBUG("Getting normally small length");
|
||||
ASN_DEBUG("Getting normally small length");
|
||||
|
||||
if(per_get_few_bits(pd, 1) == 0) {
|
||||
length = per_get_few_bits(pd, 6) + 1;
|
||||
if(length <= 0) return -1;
|
||||
ASN_DEBUG("l=%d", length);
|
||||
return length;
|
||||
} else {
|
||||
int repeat;
|
||||
length = uper_get_length(pd, -1, &repeat);
|
||||
if(length >= 0 && !repeat) return length;
|
||||
return -1; /* Error, or do not support >16K extensions */
|
||||
}
|
||||
if(per_get_few_bits(pd, 1) == 0) {
|
||||
length = per_get_few_bits(pd, 6) + 1;
|
||||
if(length <= 0) return -1;
|
||||
ASN_DEBUG("l=%d", (int)length);
|
||||
return length;
|
||||
} else {
|
||||
int repeat;
|
||||
length = uper_get_length(pd, -1, &repeat);
|
||||
if(length >= 0 && !repeat) return length;
|
||||
return -1; /* Error, or do not support >16K extensions */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -216,135 +223,215 @@ uper_get_nslength(asn_per_data_t *pd) {
|
||||
*/
|
||||
ssize_t
|
||||
uper_get_nsnnwn(asn_per_data_t *pd) {
|
||||
ssize_t value;
|
||||
ssize_t value;
|
||||
|
||||
value = per_get_few_bits(pd, 7);
|
||||
if(value & 64) { /* implicit (value < 0) */
|
||||
value &= 63;
|
||||
value <<= 2;
|
||||
value |= per_get_few_bits(pd, 2);
|
||||
if(value & 128) /* implicit (value < 0) */
|
||||
return -1;
|
||||
if(value == 0)
|
||||
return 0;
|
||||
if(value >= 3)
|
||||
return -1;
|
||||
value = per_get_few_bits(pd, 8 * value);
|
||||
return value;
|
||||
}
|
||||
value = per_get_few_bits(pd, 7);
|
||||
if(value & 64) { /* implicit (value < 0) */
|
||||
value &= 63;
|
||||
value <<= 2;
|
||||
value |= per_get_few_bits(pd, 2);
|
||||
if(value & 128) /* implicit (value < 0) */
|
||||
return -1;
|
||||
if(value == 0)
|
||||
return 0;
|
||||
if(value >= 3)
|
||||
return -1;
|
||||
value = per_get_few_bits(pd, 8 * value);
|
||||
return value;
|
||||
}
|
||||
|
||||
return value;
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the normally small non-negative whole number.
|
||||
* X.691, #10.6
|
||||
* X.691-11/2008, #11.6
|
||||
* Encoding of a normally small non-negative whole number
|
||||
*/
|
||||
int
|
||||
uper_put_nsnnwn(asn_per_outp_t *po, int n) {
|
||||
int bytes;
|
||||
int bytes;
|
||||
|
||||
if(n <= 63) {
|
||||
if(n < 0) return -1;
|
||||
return per_put_few_bits(po, n, 7);
|
||||
}
|
||||
if(n < 256)
|
||||
bytes = 1;
|
||||
else if(n < 65536)
|
||||
bytes = 2;
|
||||
else if(n < 256 * 65536)
|
||||
bytes = 3;
|
||||
else
|
||||
return -1; /* This is not a "normally small" value */
|
||||
if(per_put_few_bits(po, bytes, 8))
|
||||
return -1;
|
||||
if(n <= 63) {
|
||||
if(n < 0) return -1;
|
||||
return per_put_few_bits(po, n, 7);
|
||||
}
|
||||
if(n < 256)
|
||||
bytes = 1;
|
||||
else if(n < 65536)
|
||||
bytes = 2;
|
||||
else if(n < 256 * 65536)
|
||||
bytes = 3;
|
||||
else
|
||||
return -1; /* This is not a "normally small" value */
|
||||
if(per_put_few_bits(po, bytes, 8))
|
||||
return -1;
|
||||
|
||||
return per_put_few_bits(po, n, 8 * bytes);
|
||||
return per_put_few_bits(po, n, 8 * bytes);
|
||||
}
|
||||
|
||||
|
||||
/* X.691-2008/11, #11.5.6 -> #11.3 */
|
||||
int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits) {
|
||||
unsigned long lhalf; /* Lower half of the number*/
|
||||
long half;
|
||||
|
||||
if(nbits <= 31) {
|
||||
half = per_get_few_bits(pd, nbits);
|
||||
if(half < 0) return -1;
|
||||
*out_value = half;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((size_t)nbits > 8 * sizeof(*out_value))
|
||||
return -1; /* RANGE */
|
||||
|
||||
half = per_get_few_bits(pd, 31);
|
||||
if(half < 0) return -1;
|
||||
|
||||
if(uper_get_constrained_whole_number(pd, &lhalf, nbits - 31))
|
||||
return -1;
|
||||
|
||||
*out_value = ((unsigned long)half << (nbits - 31)) | lhalf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* X.691-2008/11, #11.5.6 -> #11.3 */
|
||||
int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits) {
|
||||
/*
|
||||
* Assume signed number can be safely coerced into
|
||||
* unsigned of the same range.
|
||||
* The following testing code will likely be optimized out
|
||||
* by compiler if it is true.
|
||||
*/
|
||||
unsigned long uvalue1 = ULONG_MAX;
|
||||
long svalue = uvalue1;
|
||||
unsigned long uvalue2 = svalue;
|
||||
assert(uvalue1 == uvalue2);
|
||||
return uper_put_constrained_whole_number_u(po, v, nbits);
|
||||
}
|
||||
|
||||
int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits) {
|
||||
if(nbits <= 31) {
|
||||
return per_put_few_bits(po, v, nbits);
|
||||
} else {
|
||||
/* Put higher portion first, followed by lower 31-bit */
|
||||
if(uper_put_constrained_whole_number_u(po, v >> 31, nbits - 31))
|
||||
return -1;
|
||||
return per_put_few_bits(po, v, 31);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
per_put_aligned_flush(asn_per_outp_t *po) {
|
||||
uint32_t unused_bits = (0x7 & (8 - (po->nboff & 0x07)));
|
||||
size_t complete_bytes =
|
||||
(po->buffer ? po->buffer - po->tmpspace : 0) + ((po->nboff + 7) >> 3);
|
||||
|
||||
if(unused_bits) {
|
||||
po->buffer[po->nboff >> 3] &= ~0 << unused_bits;
|
||||
}
|
||||
|
||||
if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0) {
|
||||
return -1;
|
||||
} else {
|
||||
po->buffer = po->tmpspace;
|
||||
po->nboff = 0;
|
||||
po->nbits = 8 * sizeof(po->tmpspace);
|
||||
po->flushed_bytes += complete_bytes;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Put a small number of bits (<= 31).
|
||||
*/
|
||||
int
|
||||
per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
|
||||
size_t off; /* Next after last bit offset */
|
||||
size_t omsk; /* Existing last byte meaningful bits mask */
|
||||
uint8_t *buf;
|
||||
size_t off; /* Next after last bit offset */
|
||||
size_t omsk; /* Existing last byte meaningful bits mask */
|
||||
uint8_t *buf;
|
||||
|
||||
if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
|
||||
if(obits <= 0 || obits >= 32) return obits ? -1 : 0;
|
||||
|
||||
ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
|
||||
obits, (int)bits, po->buffer, po->nboff);
|
||||
ASN_DEBUG("[PER put %d bits %x to %p+%d bits]",
|
||||
obits, (int)bits, po->buffer, (int)po->nboff);
|
||||
|
||||
/*
|
||||
* Normalize position indicator.
|
||||
*/
|
||||
if(po->nboff >= 8) {
|
||||
po->buffer += (po->nboff >> 3);
|
||||
po->nbits -= (po->nboff & ~0x07);
|
||||
po->nboff &= 0x07;
|
||||
}
|
||||
/*
|
||||
* Normalize position indicator.
|
||||
*/
|
||||
if(po->nboff >= 8) {
|
||||
po->buffer += (po->nboff >> 3);
|
||||
po->nbits -= (po->nboff & ~0x07);
|
||||
po->nboff &= 0x07;
|
||||
}
|
||||
|
||||
/*
|
||||
* Flush whole-bytes output, if necessary.
|
||||
*/
|
||||
if(po->nboff + obits > po->nbits) {
|
||||
int complete_bytes = (po->buffer - po->tmpspace);
|
||||
ASN_DEBUG("[PER output %d complete + %d]",
|
||||
complete_bytes, po->flushed_bytes);
|
||||
if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0)
|
||||
return -1;
|
||||
if(po->nboff)
|
||||
po->tmpspace[0] = po->buffer[0];
|
||||
po->buffer = po->tmpspace;
|
||||
po->nbits = 8 * sizeof(po->tmpspace);
|
||||
po->flushed_bytes += complete_bytes;
|
||||
}
|
||||
/*
|
||||
* Flush whole-bytes output, if necessary.
|
||||
*/
|
||||
if(po->nboff + obits > po->nbits) {
|
||||
size_t complete_bytes;
|
||||
if(!po->buffer) po->buffer = po->tmpspace;
|
||||
complete_bytes = (po->buffer - po->tmpspace);
|
||||
ASN_DEBUG("[PER output %ld complete + %ld]",
|
||||
(long)complete_bytes, (long)po->flushed_bytes);
|
||||
if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0)
|
||||
return -1;
|
||||
if(po->nboff)
|
||||
po->tmpspace[0] = po->buffer[0];
|
||||
po->buffer = po->tmpspace;
|
||||
po->nbits = 8 * sizeof(po->tmpspace);
|
||||
po->flushed_bytes += complete_bytes;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now, due to sizeof(tmpspace), we are guaranteed large enough space.
|
||||
*/
|
||||
buf = po->buffer;
|
||||
omsk = ~((1 << (8 - po->nboff)) - 1);
|
||||
off = (po->nboff += obits);
|
||||
/*
|
||||
* Now, due to sizeof(tmpspace), we are guaranteed large enough space.
|
||||
*/
|
||||
buf = po->buffer;
|
||||
omsk = ~((1 << (8 - po->nboff)) - 1);
|
||||
off = (po->nboff + obits);
|
||||
|
||||
/* Clear data of debris before meaningful bits */
|
||||
bits &= (((uint32_t)1 << obits) - 1);
|
||||
/* Clear data of debris before meaningful bits */
|
||||
bits &= (((uint32_t)1 << obits) - 1);
|
||||
|
||||
ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
|
||||
(int)bits, (int)bits,
|
||||
po->nboff - obits, off, buf[0], omsk&0xff, buf[0] & omsk);
|
||||
ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits,
|
||||
(int)bits, (int)bits,
|
||||
(int)po->nboff, (int)off,
|
||||
buf[0], (int)(omsk&0xff),
|
||||
(int)(buf[0] & omsk));
|
||||
|
||||
if(off <= 8) /* Completely within 1 byte */
|
||||
bits <<= (8 - off),
|
||||
buf[0] = (buf[0] & omsk) | bits;
|
||||
else if(off <= 16)
|
||||
bits <<= (16 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 8),
|
||||
buf[1] = bits;
|
||||
else if(off <= 24)
|
||||
bits <<= (24 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 16),
|
||||
buf[1] = bits >> 8,
|
||||
buf[2] = bits;
|
||||
else if(off <= 31)
|
||||
bits <<= (32 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 24),
|
||||
buf[1] = bits >> 16,
|
||||
buf[2] = bits >> 8,
|
||||
buf[3] = bits;
|
||||
else {
|
||||
ASN_DEBUG("->[PER out split %d]", obits);
|
||||
per_put_few_bits(po, bits >> 8, 24);
|
||||
per_put_few_bits(po, bits, obits - 24);
|
||||
ASN_DEBUG("<-[PER out split %d]", obits);
|
||||
}
|
||||
if(off <= 8) /* Completely within 1 byte */
|
||||
po->nboff = off,
|
||||
bits <<= (8 - off),
|
||||
buf[0] = (buf[0] & omsk) | bits;
|
||||
else if(off <= 16)
|
||||
po->nboff = off,
|
||||
bits <<= (16 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 8),
|
||||
buf[1] = bits;
|
||||
else if(off <= 24)
|
||||
po->nboff = off,
|
||||
bits <<= (24 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 16),
|
||||
buf[1] = bits >> 8,
|
||||
buf[2] = bits;
|
||||
else if(off <= 31)
|
||||
po->nboff = off,
|
||||
bits <<= (32 - off),
|
||||
buf[0] = (buf[0] & omsk) | (bits >> 24),
|
||||
buf[1] = bits >> 16,
|
||||
buf[2] = bits >> 8,
|
||||
buf[3] = bits;
|
||||
else {
|
||||
if(per_put_few_bits(po, bits >> (obits - 24), 24)) return -1;
|
||||
if(per_put_few_bits(po, bits, obits - 24)) return -1;
|
||||
}
|
||||
|
||||
ASN_DEBUG("[PER out %u/%x => %02x buf+%d]",
|
||||
(int)bits, (int)bits, buf[0], po->buffer - po->tmpspace);
|
||||
ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
|
||||
(int)bits, (int)bits, buf[0],
|
||||
(long)(po->buffer - po->tmpspace));
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -354,30 +441,30 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
|
||||
int
|
||||
per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) {
|
||||
|
||||
while(nbits) {
|
||||
uint32_t value;
|
||||
while(nbits) {
|
||||
uint32_t value;
|
||||
|
||||
if(nbits >= 24) {
|
||||
value = (src[0] << 16) | (src[1] << 8) | src[2];
|
||||
src += 3;
|
||||
nbits -= 24;
|
||||
if(per_put_few_bits(po, value, 24))
|
||||
return -1;
|
||||
} else {
|
||||
value = src[0];
|
||||
if(nbits > 8)
|
||||
value = (value << 8) | src[1];
|
||||
if(nbits > 16)
|
||||
value = (value << 8) | src[2];
|
||||
if(nbits & 0x07)
|
||||
value >>= (8 - (nbits & 0x07));
|
||||
if(per_put_few_bits(po, value, nbits))
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(nbits >= 24) {
|
||||
value = (src[0] << 16) | (src[1] << 8) | src[2];
|
||||
src += 3;
|
||||
nbits -= 24;
|
||||
if(per_put_few_bits(po, value, 24))
|
||||
return -1;
|
||||
} else {
|
||||
value = src[0];
|
||||
if(nbits > 8)
|
||||
value = (value << 8) | src[1];
|
||||
if(nbits > 16)
|
||||
value = (value << 8) | src[2];
|
||||
if(nbits & 0x07)
|
||||
value >>= (8 - (nbits & 0x07));
|
||||
if(per_put_few_bits(po, value, nbits))
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -386,18 +473,18 @@ per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int nbits) {
|
||||
ssize_t
|
||||
uper_put_length(asn_per_outp_t *po, size_t length) {
|
||||
|
||||
if(length <= 127) /* #10.9.3.6 */
|
||||
return per_put_few_bits(po, length, 8)
|
||||
? -1 : (ssize_t)length;
|
||||
else if(length < 16384) /* #10.9.3.7 */
|
||||
return per_put_few_bits(po, length|0x8000, 16)
|
||||
? -1 : (ssize_t)length;
|
||||
if(length <= 127) /* #10.9.3.6 */
|
||||
return per_put_few_bits(po, length, 8)
|
||||
? -1 : (ssize_t)length;
|
||||
else if(length < 16384) /* #10.9.3.7 */
|
||||
return per_put_few_bits(po, length|0x8000, 16)
|
||||
? -1 : (ssize_t)length;
|
||||
|
||||
length >>= 14;
|
||||
if(length > 4) length = 4;
|
||||
length >>= 14;
|
||||
if(length > 4) length = 4;
|
||||
|
||||
return per_put_few_bits(po, 0xC0 | length, 8)
|
||||
? -1 : (ssize_t)(length << 14);
|
||||
return per_put_few_bits(po, 0xC0 | length, 8)
|
||||
? -1 : (ssize_t)(length << 14);
|
||||
}
|
||||
|
||||
|
||||
@ -409,17 +496,16 @@ uper_put_length(asn_per_outp_t *po, size_t length) {
|
||||
int
|
||||
uper_put_nslength(asn_per_outp_t *po, size_t length) {
|
||||
|
||||
if(length <= 64) {
|
||||
/* #10.9.3.4 */
|
||||
if(length == 0) return -1;
|
||||
return per_put_few_bits(po, length-1, 7) ? -1 : 0;
|
||||
} else {
|
||||
if(uper_put_length(po, length) != (ssize_t)length) {
|
||||
/* This might happen in case of >16K extensions */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if(length <= 64) {
|
||||
/* #10.9.3.4 */
|
||||
if(length == 0) return -1;
|
||||
return per_put_few_bits(po, length-1, 7) ? -1 : 0;
|
||||
} else {
|
||||
if(uper_put_length(po, length) != (ssize_t)length) {
|
||||
/* This might happen in case of >16K extensions */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
* All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#ifndef _PER_SUPPORT_H_
|
||||
#define _PER_SUPPORT_H_
|
||||
#ifndef _PER_SUPPORT_H_
|
||||
#define _PER_SUPPORT_H_
|
||||
|
||||
#include <asn_system.h> /* Platform-specific types */
|
||||
#include <asn_system.h> /* Platform-specific types */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -15,23 +15,23 @@ extern "C" {
|
||||
/*
|
||||
* Pre-computed PER constraints.
|
||||
*/
|
||||
typedef struct asn_per_constraint_s {
|
||||
enum asn_per_constraint_flags {
|
||||
APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
|
||||
APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
|
||||
APC_CONSTRAINED = 0x2, /* Fully constrained */
|
||||
APC_EXTENSIBLE = 0x4 /* May have extension */
|
||||
} flags;
|
||||
int range_bits; /* Full number of bits in the range */
|
||||
int effective_bits; /* Effective bits */
|
||||
long lower_bound; /* "lb" value */
|
||||
long upper_bound; /* "ub" value */
|
||||
typedef const struct asn_per_constraint_s {
|
||||
enum asn_per_constraint_flags {
|
||||
APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
|
||||
APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
|
||||
APC_CONSTRAINED = 0x2, /* Fully constrained */
|
||||
APC_EXTENSIBLE = 0x4 /* May have extension */
|
||||
} flags;
|
||||
int range_bits; /* Full number of bits in the range */
|
||||
int effective_bits; /* Effective bits */
|
||||
long lower_bound; /* "lb" value */
|
||||
long upper_bound; /* "ub" value */
|
||||
} asn_per_constraint_t;
|
||||
typedef struct asn_per_constraints_s {
|
||||
asn_per_constraint_t value;
|
||||
asn_per_constraint_t size;
|
||||
int (*value2code)(unsigned int value);
|
||||
int (*code2value)(unsigned int code);
|
||||
typedef const struct asn_per_constraints_s {
|
||||
struct asn_per_constraint_s value;
|
||||
struct asn_per_constraint_s size;
|
||||
int (*value2code)(unsigned int value);
|
||||
int (*code2value)(unsigned int code);
|
||||
} asn_per_constraints_t;
|
||||
|
||||
/*
|
||||
@ -62,14 +62,14 @@ void per_get_undo(asn_per_data_t *per_data, int get_nbits);
|
||||
* extracted due to EOD or other conditions.
|
||||
*/
|
||||
int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align,
|
||||
int get_nbits);
|
||||
int get_nbits);
|
||||
|
||||
/*
|
||||
* Get the length "n" from the Unaligned PER stream.
|
||||
*/
|
||||
ssize_t uper_get_length(asn_per_data_t *pd,
|
||||
int effective_bound_bits,
|
||||
int *repeat);
|
||||
int effective_bound_bits,
|
||||
int *repeat);
|
||||
|
||||
/*
|
||||
* Get the normally small length "n".
|
||||
@ -81,6 +81,9 @@ ssize_t uper_get_nslength(asn_per_data_t *pd);
|
||||
*/
|
||||
ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
|
||||
|
||||
/* X.691-2008/11, #11.5.6 */
|
||||
int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits);
|
||||
|
||||
/* Non-thread-safe debugging function, don't use it */
|
||||
char *per_data_string(asn_per_data_t *pd);
|
||||
|
||||
@ -88,13 +91,13 @@ char *per_data_string(asn_per_data_t *pd);
|
||||
* This structure supports forming PER output.
|
||||
*/
|
||||
typedef struct asn_per_outp_s {
|
||||
uint8_t *buffer; /* Pointer into the (tmpspace) */
|
||||
size_t nboff; /* Bit offset to the meaningful bit */
|
||||
size_t nbits; /* Number of bits left in (tmpspace) */
|
||||
uint8_t tmpspace[32]; /* Preliminary storage to hold data */
|
||||
int (*outper)(const void *data, size_t size, void *op_key);
|
||||
void *op_key; /* Key for (outper) data callback */
|
||||
size_t flushed_bytes; /* Bytes already flushed through (outper) */
|
||||
uint8_t *buffer; /* Pointer into the (tmpspace) */
|
||||
size_t nboff; /* Bit offset to the meaningful bit */
|
||||
size_t nbits; /* Number of bits left in (tmpspace) */
|
||||
uint8_t tmpspace[32]; /* Preliminary storage to hold data */
|
||||
int (*outper)(const void *data, size_t size, void *op_key);
|
||||
void *op_key; /* Key for (outper) data callback */
|
||||
size_t flushed_bytes; /* Bytes already flushed through (outper) */
|
||||
} asn_per_outp_t;
|
||||
|
||||
/* Output a small number of bits (<= 31) */
|
||||
@ -103,6 +106,17 @@ int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits);
|
||||
/* Output a large number of bits */
|
||||
int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits);
|
||||
|
||||
/*
|
||||
* Flush whole bytes (0 or more) through (outper) member.
|
||||
* The least significant bits which are not used are guaranteed to be set to 0.
|
||||
* Returns -1 if callback returns -1. Otherwise, 0.
|
||||
*/
|
||||
int per_put_aligned_flush(asn_per_outp_t *po);
|
||||
|
||||
/* X.691-2008/11, #11.5 */
|
||||
int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits);
|
||||
int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits);
|
||||
|
||||
/*
|
||||
* Put the length "n" to the Unaligned PER stream.
|
||||
* This function returns the number of units which may be flushed
|
||||
@ -125,4 +139,4 @@ int uper_put_nsnnwn(asn_per_outp_t *po, int n);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _PER_SUPPORT_H_ */
|
||||
#endif /* _PER_SUPPORT_H_ */
|
||||
|
@ -217,7 +217,7 @@ int EXPORT supl_decode_rrlp(supl_ulp_t *ulp_pdu, PDU_t **ret_rrlp) {
|
||||
|
||||
int EXPORT supl_server_connect(supl_ctx_t *ctx, char *server) {
|
||||
int err;
|
||||
const SSL_METHOD *meth;
|
||||
SSL_METHOD *meth;
|
||||
|
||||
SSLeay_add_ssl_algorithms();
|
||||
// meth = TLSv1_client_method();
|
||||
|
@ -39,6 +39,7 @@
|
||||
#endif
|
||||
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/exception_ptr.hpp>
|
||||
@ -140,15 +141,42 @@ int main(int argc, char** argv)
|
||||
}
|
||||
catch(const boost::exception & e)
|
||||
{
|
||||
LOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
if(GOOGLE_STRIP_LOG == 0)
|
||||
{
|
||||
LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Boost exception: " << boost::diagnostic_information(e) << std::endl;
|
||||
}
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 1;
|
||||
}
|
||||
catch(const std::exception & ex)
|
||||
{
|
||||
LOG(FATAL) << "STD exception: " << ex.what();
|
||||
if(GOOGLE_STRIP_LOG == 0)
|
||||
{
|
||||
LOG(WARNING) << "C++ Standard Library exception: " << ex.what();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "C++ Standard Library exception: " << ex.what() << std::endl;
|
||||
}
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 1;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
LOG(INFO) << "Unexpected catch";
|
||||
if(GOOGLE_STRIP_LOG == 0)
|
||||
{
|
||||
LOG(WARNING) << "Unexpected catch. This should not happen.";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Unexpected catch. This should not happen." << std::endl;
|
||||
}
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// report the elapsed time
|
||||
|
@ -41,7 +41,7 @@ DEFINE_string(static_position, "30.286502,120.032669,100", "Static receiver posi
|
||||
DEFINE_string(dynamic_position, "", "Observer positions file, in .csv or .nmea format");
|
||||
DEFINE_string(filename_rinex_obs, "sim.16o", "Filename of output RINEX navigation file");
|
||||
DEFINE_string(filename_raw_data, "signal_out.bin", "Filename of output raw data file");
|
||||
DEFINE_int32(fs_gen_hz, 2600000, "Sampling frequency [sps]");
|
||||
DEFINE_int32(fs_gen_sps, 2600000, "Sampling frequency [sps]");
|
||||
DEFINE_int32(test_satellite_PRN, 1, "PRN of the satellite under test (must be visible during the observation time)");
|
||||
DEFINE_int32(test_satellite_PRN2, 2, "PRN of the satellite under test (must be visible during the observation time)");
|
||||
|
||||
|
@ -206,7 +206,7 @@ int ObsGpsL1SystemTest::configure_receiver()
|
||||
const int display_rate_ms = 500;
|
||||
const int output_rate_ms = 100;
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(sampling_rate_internal));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_rate_internal));
|
||||
|
||||
// Set the assistance system parameters
|
||||
config->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "false");
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
std::string p4;
|
||||
std::string p5;
|
||||
|
||||
const double baseband_sampling_freq = static_cast<double>(FLAGS_fs_gen_hz);
|
||||
const double baseband_sampling_freq = static_cast<double>(FLAGS_fs_gen_sps);
|
||||
|
||||
std::string filename_rinex_obs = FLAGS_filename_rinex_obs;
|
||||
std::string filename_raw_data = FLAGS_filename_raw_data;
|
||||
@ -77,7 +77,6 @@ public:
|
||||
double compute_stdev_precision(const std::vector<double> & vec);
|
||||
double compute_stdev_accuracy(const std::vector<double> & vec, double ref);
|
||||
|
||||
|
||||
void geodetic2Enu(const double latitude, const double longitude, const double altitude,
|
||||
double* east, double* north, double* up);
|
||||
|
||||
@ -88,7 +87,6 @@ public:
|
||||
private:
|
||||
void geodetic2Ecef(const double latitude, const double longitude, const double altitude,
|
||||
double* x, double* y, double* z);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -276,7 +274,7 @@ int StaticPositionSystemTest::configure_receiver()
|
||||
const int display_rate_ms = 1000;
|
||||
const int output_rate_ms = 1000;
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(sampling_rate_internal));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(sampling_rate_internal));
|
||||
|
||||
// Set the assistance system parameters
|
||||
config->set_property("GNSS-SDR.SUPL_read_gps_assistance_xml", "false");
|
||||
|
@ -127,7 +127,7 @@ void TfttGpsL1CATest::config_1()
|
||||
{
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(FLAGS_fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(FLAGS_fs_in));
|
||||
|
||||
// Set the assistance system parameters
|
||||
config->set_property("GNSS-SDR.SUPL_gps_ephemeris_server", "supl.google.com");
|
||||
@ -248,7 +248,7 @@ void TfttGpsL1CATest::config_2()
|
||||
}
|
||||
|
||||
int d_sampling_rate;
|
||||
d_sampling_rate = config2->property("GNSS-SDR.internal_fs_hz", FLAGS_fs_in);
|
||||
d_sampling_rate = config2->property("GNSS-SDR.internal_fs_sps", FLAGS_fs_in);
|
||||
config2->set_property("SignalSource.samples", std::to_string(d_sampling_rate * FLAGS_max_measurement_duration));
|
||||
}
|
||||
|
||||
|
@ -125,6 +125,7 @@ DECLARE_string(log_dir);
|
||||
#include "unit-tests/signal-processing-blocks/pvt/rtcm_test.cc"
|
||||
#include "unit-tests/signal-processing-blocks/pvt/rtcm_printer_test.cc"
|
||||
#include "unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc"
|
||||
#include "unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc"
|
||||
|
||||
#if EXTRA_TESTS
|
||||
#include "unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc"
|
||||
|
@ -201,7 +201,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -269,7 +269,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -359,7 +359,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message()
|
||||
}
|
||||
catch( const boost::exception & e )
|
||||
{
|
||||
DLOG(FATAL) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
|
||||
}
|
||||
|
||||
end = std::chrono::system_clock::now();
|
||||
|
@ -202,7 +202,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_1()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -274,7 +274,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_2()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
|
@ -158,7 +158,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::init()
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
gnss_synchro.PRN = 11;
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", "4000000");
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
|
||||
config->set_property("Acquisition.item_type", "gr_complex");
|
||||
config->set_property("Acquisition.if", "0");
|
||||
config->set_property("Acquisition.coherent_integration_time_ms", "4");
|
||||
|
@ -138,7 +138,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::init()
|
||||
signal.copy(gnss_synchro.Signal, 2, 0);
|
||||
gnss_synchro.PRN = 1;
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", "4000000");
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
|
||||
config->set_property("Acquisition.item_type", "gr_complex");
|
||||
config->set_property("Acquisition.if", "0");
|
||||
config->set_property("Acquisition.coherent_integration_time_ms", "4");
|
||||
|
@ -203,7 +203,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_1()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -274,7 +274,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
|
@ -221,7 +221,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_1()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -298,7 +298,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_2()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
@ -389,7 +389,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_3()
|
||||
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("GNSS-SDR.internal_fs_hz", std::to_string(fs_in));
|
||||
config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(fs_in));
|
||||
|
||||
config->set_property("SignalSource.fs_hz", std::to_string(fs_in));
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user