-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE]: add classes for live GPS tracking in core
git-svn-id: http://svn.osgeo.org/qgis/trunk@12685 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
mhugent
committed
Jan 7, 2010
1 parent
670bb0d
commit 426e3b3
Showing
34 changed files
with
5,612 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* | ||
* NMEA library | ||
* URL: http://nmea.sourceforge.net | ||
* Author: Tim (xtimor@gmail.com) | ||
* Licence: http://www.gnu.org/licenses/lgpl.html | ||
* $Id: config.h 17 2008-03-11 11:56:11Z xtimor $ | ||
* | ||
*/ | ||
|
||
#ifndef __NMEA_CONFIG_H__ | ||
#define __NMEA_CONFIG_H__ | ||
|
||
#define NMEA_VERSION ("0.5.3") | ||
#define NMEA_VERSION_MAJOR (0) | ||
#define NMEA_VERSION_MINOR (5) | ||
#define NMEA_VERSION_PATCH (3) | ||
|
||
#define NMEA_CONVSTR_BUF (256) | ||
#define NMEA_TIMEPARSE_BUF (256) | ||
|
||
#if defined(WINCE) || defined(UNDER_CE) | ||
# define NMEA_CE | ||
#endif | ||
|
||
#if defined(WIN32) || defined(NMEA_CE) | ||
# define NMEA_WIN | ||
#else | ||
# define NMEA_UNI | ||
#endif | ||
|
||
#if defined(NMEA_WIN) && (_MSC_VER >= 1400) | ||
# pragma warning(disable: 4996) /* declared deprecated */ | ||
#endif | ||
|
||
#if defined(_MSC_VER) | ||
# define NMEA_POSIX(x) _##x | ||
# define NMEA_INLINE __inline | ||
#else | ||
# define NMEA_POSIX(x) x | ||
# define NMEA_INLINE inline | ||
#endif | ||
|
||
#if !defined(NDEBUG) && !defined(NMEA_CE) | ||
# include <assert.h> | ||
# define NMEA_ASSERT(x) assert(x) | ||
#else | ||
# define NMEA_ASSERT(x) | ||
#endif | ||
|
||
#endif /* __NMEA_CONFIG_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* | ||
* NMEA library | ||
* URL: http://nmea.sourceforge.net | ||
* Author: Tim (xtimor@gmail.com) | ||
* Licence: http://www.gnu.org/licenses/lgpl.html | ||
* $Id: context.c 17 2008-03-11 11:56:11Z xtimor $ | ||
* | ||
*/ | ||
|
||
#include "context.h" | ||
|
||
#include <string.h> | ||
#include <stdarg.h> | ||
#include <stdio.h> | ||
|
||
nmeaPROPERTY * nmea_property() | ||
{ | ||
static nmeaPROPERTY prop = | ||
{ | ||
0, 0, NMEA_DEF_PARSEBUFF | ||
}; | ||
|
||
return ∝ | ||
} | ||
|
||
void nmea_trace( const char *str, ... ) | ||
{ | ||
int size; | ||
va_list arg_list; | ||
char buff[NMEA_DEF_PARSEBUFF]; | ||
nmeaTraceFunc func = nmea_property()->trace_func; | ||
|
||
if ( func ) | ||
{ | ||
va_start( arg_list, str ); | ||
size = NMEA_POSIX( vsnprintf )( &buff[0], NMEA_DEF_PARSEBUFF - 1, str, arg_list ); | ||
va_end( arg_list ); | ||
|
||
if ( size > 0 ) | ||
( *func )( &buff[0], size ); | ||
} | ||
} | ||
|
||
void nmea_trace_buff( const char *buff, int buff_size ) | ||
{ | ||
nmeaTraceFunc func = nmea_property()->trace_func; | ||
if ( func && buff_size ) | ||
( *func )( buff, buff_size ); | ||
} | ||
|
||
void nmea_error( const char *str, ... ) | ||
{ | ||
int size; | ||
va_list arg_list; | ||
char buff[NMEA_DEF_PARSEBUFF]; | ||
nmeaErrorFunc func = nmea_property()->error_func; | ||
|
||
if ( func ) | ||
{ | ||
va_start( arg_list, str ); | ||
size = NMEA_POSIX( vsnprintf )( &buff[0], NMEA_DEF_PARSEBUFF - 1, str, arg_list ); | ||
va_end( arg_list ); | ||
|
||
if ( size > 0 ) | ||
( *func )( &buff[0], size ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* | ||
* NMEA library | ||
* URL: http://nmea.sourceforge.net | ||
* Author: Tim (xtimor@gmail.com) | ||
* Licence: http://www.gnu.org/licenses/lgpl.html | ||
* $Id: context.h 4 2007-08-27 13:11:03Z xtimor $ | ||
* | ||
*/ | ||
|
||
#ifndef __NMEA_CONTEXT_H__ | ||
#define __NMEA_CONTEXT_H__ | ||
|
||
#include "config.h" | ||
|
||
#define NMEA_DEF_PARSEBUFF (1024) | ||
#define NMEA_MIN_PARSEBUFF (256) | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
typedef void ( *nmeaTraceFunc )( const char *str, int str_size ); | ||
typedef void ( *nmeaErrorFunc )( const char *str, int str_size ); | ||
|
||
typedef struct _nmeaPROPERTY | ||
{ | ||
nmeaTraceFunc trace_func; | ||
nmeaErrorFunc error_func; | ||
int parse_buff_size; | ||
|
||
} nmeaPROPERTY; | ||
|
||
nmeaPROPERTY * nmea_property(); | ||
|
||
void nmea_trace( const char *str, ... ); | ||
void nmea_trace_buff( const char *buff, int buff_size ); | ||
void nmea_error( const char *str, ... ); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* __NMEA_CONTEXT_H__ */ |
Oops, something went wrong.