From 8c5e3230ce942bd95ef53b23d97b7cf774536865 Mon Sep 17 00:00:00 2001 From: asterix Date: Mon, 5 Oct 2009 17:12:38 +0000 Subject: [PATCH] Make configurable some nmeap parser context. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3030 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/cfg_nmea.h | 28 ++++++++++++++++++++++++++++ bertos/net/nmeap/inc/nmeap.h | 8 +++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/bertos/cfg/cfg_nmea.h b/bertos/cfg/cfg_nmea.h index 781d78fe..35a58a5c 100644 --- a/bertos/cfg/cfg_nmea.h +++ b/bertos/cfg/cfg_nmea.h @@ -54,4 +54,32 @@ */ #define NMEA_LOG_FORMAT LOG_FMT_TERSE + +/** + * Maximum number of sentence parsers supported. + * + * $WIZ$ type = "int" + * $WIZ$ min = 1 + */ +#define CONFIG_NMEAP_MAX_SENTENCES 8 + +/** + * Max length of a complete sentence. The standard says 82 bytes, but its probably + * better to go at least 128 since some units don't adhere to the 82 bytes + * especially for proprietary sentences. + * + * $WIZ$ type = "int" + * $WIZ$ min = 1 + */ +#define CONFIG_NMEAP_MAX_SENTENCE_LENGTH 255 + +/** + * Max tokens in one sentence. 24 is enough for any standard sentence. + * + * $WIZ$ type = "int" + * $WIZ$ min = 1 + */ +#define CONFIG_NMEAP_MAX_TOKENS 24 + #endif /* CFG_NMEA_H */ + diff --git a/bertos/net/nmeap/inc/nmeap.h b/bertos/net/nmeap/inc/nmeap.h index a1035c92..ef52d2d8 100644 --- a/bertos/net/nmeap/inc/nmeap.h +++ b/bertos/net/nmeap/inc/nmeap.h @@ -26,6 +26,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. extern "C" { #endif +#include "cfg/cfg_nmea.h" + /* ============================================ COMPILE TIME CONFIGURATION CONSTANTS @@ -37,14 +39,14 @@ COMPILE TIME CONFIGURATION CONSTANTS /* these constants affect the size of the context object. tweak them as desired but know what you are doing */ /** maximum number of sentence parsers supported */ -#define NMEAP_MAX_SENTENCES 8 +#define NMEAP_MAX_SENTENCES CONFIG_NMEAP_MAX_SENTENCES /** length of sentence name. leave this at 5 unless you really know what you are doing */ #define NMEAP_MAX_SENTENCE_NAME_LENGTH 5 /** max length of a complete sentence. the standard says 82 bytes, but its probably better to go at least 128 since * some units don't adhere to the 82 bytes especially for proprietary sentences */ -#define NMEAP_MAX_SENTENCE_LENGTH 255 +#define NMEAP_MAX_SENTENCE_LENGTH CONFIG_NMEAP_MAX_SENTENCE_LENGTH /** max tokens in one sentence. 24 is enough for any standard sentence */ -#define NMEAP_MAX_TOKENS 24 +#define NMEAP_MAX_TOKENS CONFIG_NMEAP_MAX_TOKENS /* predefined message ID's */ -- 2.25.1