GNU Radio's HOWTO Package
gn3s_source.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------------------------*/
2 //
3 // FILENAME: gps_source.h
4 //
5 // DESCRIPTION: Defines the GPS_Source class.
6 //
7 // DEVELOPERS: Gregory W. Heckler (2003-2009)
8 //
9 // LICENSE TERMS: Copyright (c) Gregory W. Heckler 2009
10 //
11 // This file is part of the GPS Software Defined Radio (GPS-SDR)
12 //
13 // The GPS-SDR is free software; you can redistribute it and/or modify it under the terms of the
14 // GNU General Public License as published by the Free Software Foundation; either version 2 of
15 // the License, or (at your option) any later version. The GPS-SDR is distributed in the hope that
16 // it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // more details.
19 //
20 // Note: Comments within this file follow a syntax that is compatible with
21 // DOXYGEN and are utilized for automated document extraction
22 //
23 // Reference:
24 /*----------------------------------------------------------------------------------------------*/
25 
26 #ifndef GN3S_SOURCE_H_
27 #define GN3S_SOURCE_H_
28 
29 #include "gn3s_defines.h"
30 #include "gn3s.h"
31 
32 /*! \ingroup CLASSES
33  *
34  */
36 {
37 
38  private:
39 
40  /* Generic variables */
41  int source_type; //!< Source type
42  int sample_mode; //!< Sample mode
43  int leftover; //!< Leftover bytes for USRP double buffering
44  int bwrite; //!< Bytes somthing something?
45  int ms_count; //!< Count the numbers of ms processed
46 
47  bool flag_first_read;
48  /* Tag overflows */
49  time_t rawtime;
50  struct tm * timeinfo;
51 
52  /* AGC Values */
53  int agc_scale; //!< To do the AGC
54  int overflw; //!< Overflow counter
55  int soverflw; //!< Overflow counter
56 
57  /* Data buffers */
58  unsigned char gbuff[GN3S_SAMPS_5MS*2]; //!< Byte buffer for GN3S
59  GN3S_CPX buff[GN3S_SAMPS_5MS]; //!< Base buffer for GN3S
60 
61  /* SOURCE_SIGE_GN3S Handles */
62  gn3s *gn3s_a;
63 
64  private:
65 
66  void Open_GN3S(); //!< Open the SparkFun GN3S Sampler
67  void Close_GN3S(); //!< Close the SparkFun GN3S Sampler
68  void Read_GN3S(gn3s_ms_packet *_p,int n_samples); //!< Read from the SparkFun GN3S Sampler
69 
70  public:
71 
72  gn3s_Source(); //!< Create the GPS source with the proper hardware type
73  ~gn3s_Source(); //!< Kill the object
74  void Read(gn3s_ms_packet *_p,int n_samples); //!< Read in a single ms of data
75  int getScale(){return(agc_scale);}
76  int getOvrflw(){return(overflw);}
77 
78 };
79 
80 #endif /* GN3S_SOURCE_H_ */
Definition: gn3s.h:93
Definition: gn3s_defines.h:4
int getScale()
Definition: gn3s_source.h:75
gn3s_Source()
Create the GPS source with the proper hardware type.
Definition: gn3s_source.h:35
int getOvrflw()
Definition: gn3s_source.h:76
void Read(gn3s_ms_packet *_p, int n_samples)
Read in a single ms of data.
linked list structure for circular FIFO buffer
Definition: gn3s_defines.h:16
~gn3s_Source()
Kill the object.
#define GN3S_SAMPS_5MS
FIFO structure for linked list?
Definition: gn3s_defines.h:11