summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Burnicki <martin.burnicki@meinberg.de>2024-01-03 11:08:00 +0100
committerMartin Burnicki <martin.burnicki@meinberg.de>2024-01-03 11:08:00 +0100
commitbd7416de0b38da4111416114460968c0b6b86d22 (patch)
tree4e114231c800e5b14431864942a245f0cfb945c0
parent5ebc50745f1aa5605374585efa016c57d9c3463c (diff)
downloadmbgreadtimestring-bd7416de0b38da4111416114460968c0b6b86d22.tar.gz
mbgreadtimestring-bd7416de0b38da4111416114460968c0b6b86d22.zip
Update some mbglib files
-rw-r--r--mbglib/common/mbg_tgt.h20
-rw-r--r--mbglib/common/mbgerror.h22
-rw-r--r--mbglib/common/mbgserio.c17
-rw-r--r--mbglib/common/mbgserio.h6
4 files changed, 48 insertions, 17 deletions
diff --git a/mbglib/common/mbg_tgt.h b/mbglib/common/mbg_tgt.h
index 07bdcf8..cdd6706 100644
--- a/mbglib/common/mbg_tgt.h
+++ b/mbglib/common/mbg_tgt.h
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbg_tgt.h 1.54 2022/09/01 15:46:33 martin.burnicki REL_M $
+ * $Id: mbg_tgt.h 1.56 2023/04/05 15:12:24 martin.burnicki REL_M $
*
* Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
*
@@ -11,7 +11,11 @@
*
* -----------------------------------------------------------------------
* $Log: mbg_tgt.h $
- * Revision 1.54 2022/09/01 15:46:33 martin.burnicki
+ * Revision 1.56 2023/04/05 15:12:24 martin.burnicki
+ * Changed the VS version for which some warnings are disabled.
+ * Revision 1.55 2023/03/09 15:43:15Z martin.burnicki
+ * Disable some compiler warnings from old VS versions.
+ * Revision 1.54 2022/09/01 15:46:33Z martin.burnicki
* Suppress deprecated function warnings if
* NO_WARN_DEPRECATED is defined.
* Revision 1.53 2022/03/17 16:38:57Z martin.burnicki
@@ -743,6 +747,18 @@ extern "C" {
#define strtoll _strtoi64
#endif
+ #if ( _MSC_VER <= 1600 )
+ // Disable the annoying "conditional expression is constant"
+ // warnings thrown by older VS versions.
+ #pragma warning( disable : 4127 )
+ #endif
+
+ #if ( _MSC_VER <= 1600 )
+ // Disable the annoying "nameless struct/union"
+ // warnings thrown by older VS versions.
+ #pragma warning( disable : 4201 )
+ #endif
+
#elif defined( _CVI_ )
// 1000 for CVI v10.0 (CVI 2010)
diff --git a/mbglib/common/mbgerror.h b/mbglib/common/mbgerror.h
index fe97576..1b90fd6 100644
--- a/mbglib/common/mbgerror.h
+++ b/mbglib/common/mbgerror.h
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgerror.h 1.34 2021/12/01 15:51:25 martin.burnicki REL_M $
+ * $Id: mbgerror.h 1.35 2023/12/05 19:59:33 martin REL_M $
*
* Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
*
@@ -11,6 +11,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgerror.h $
+ * Revision 1.35 2023/12/05 19:59:33 martin
+ * New error code MBG_ERR_CFG_TRUNC.
+ * Also modified some error strings.
* Revision 1.34 2021/12/01 15:51:25 martin.burnicki
* New error code MBG_ERR_OP_NOT_SUPP for EOPNOTSUPP and ENOTSUP.
* Revision 1.33 2021/11/03 16:57:02 martin.burnicki
@@ -434,6 +437,8 @@ extern "C" {
#define MBG_ERR_NOT_SUPP_BY_DRVR -124 ///< Requested feature is not supported by the driver
#define MBG_ERR_OP_NOT_SUPP -125 ///< Requested operation is not supported
+#define MBG_ERR_CFG_TRUNC -126 ///< Configuration parameter was truncated by the device
+
// NOTE: New codes have to be appended to this list, and the sequence of codes must not
// be changed. Whenever new codes have been defined, appropriate entries have to be added
// to the ::MBG_ERR_STR_TABLE_ENG table initializer below, and the Windows-specific message
@@ -466,7 +471,7 @@ extern "C" {
#define MBG_ERR_STR_TABLE_BASE_ENG \
{ MBG_SUCCESS, "Success" }, \
{ MBG_ERR_STIME, "Invalid date/time for device" }, \
- { MBG_ERR_CFG, "Invalid configuration parameters for device" }, \
+ { MBG_ERR_CFG, "Invalid configuration parameter for device" }, \
{ MBG_ERR_GENERIC, "Generic error" }, \
{ MBG_ERR_TIMEOUT, "Timeout" }, \
{ MBG_ERR_FW_ID, "Invalid firmware ID" }, \
@@ -476,7 +481,7 @@ extern "C" {
{ MBG_ERR_NOT_READY, "Device not ready" }, \
{ MBG_ERR_INV_TYPE, "Unsupported data type" }, \
{ MBG_ERR_NO_MEM, "Memory allocation error" }, \
- { MBG_ERR_CLAIM_RSRC, "Faild to claim resources" }, \
+ { MBG_ERR_CLAIM_RSRC, "Failed to claim resources" }, \
{ MBG_ERR_DEV_NOT_SUPP, "Device not supported" }, \
{ MBG_ERR_INV_DEV_REQUEST, "Request not supported" }, \
{ MBG_ERR_NOT_SUPP_BY_DEV, "Not supported by device" }, \
@@ -502,7 +507,7 @@ extern "C" {
{ MBG_ERR_CONN_TYPE, "Invalid I/O connection type" }, \
{ MBG_ERR_BYTES_WRITTEN, "Failed to write all bytes" }, \
{ MBG_ERR_IO, "Input/output error" }, \
- { MBG_ERR_INV_PARM, "Invalid parameter passed to function" }, \
+ { MBG_ERR_INV_PARM, "Invalid parameter" }, \
{ MBG_ERR_NO_DEV, "No such device, or attempted an inappropriate function." }, \
{ MBG_ERR_NOT_FOUND, "Specified item not found" }, \
{ MBG_ERR_OVERFLOW, "Buffer overflow" }, \
@@ -513,7 +518,7 @@ extern "C" {
{ MBG_ERR_DECRYPT, "Decryption failed" }, \
{ MBG_ERR_DISCONN, "Connection closed by remote site/host" }, \
{ MBG_ERR_INV_CFG, "Invalid/inconsistent configuration read from device" }, \
- { MBG_ERR_RANGE, "Input parameter was out of range" }, \
+ { MBG_ERR_RANGE, "Input parameter out of range" }, \
{ MBG_ERR_INV_TLV_ANN_BYTES, "TLV num of transferred bytes differs from num of announced bytes" }, \
{ MBG_ERR_INV_TLV_SIZE, "MBG_ERR_INV_TLV_SIZE" }, /* ### TODO */ \
{ MBG_ERR_INV_TLV_UID, "MBG_ERR_INV_TLV_UID" }, /* ### TODO */ \
@@ -526,7 +531,7 @@ extern "C" {
{ MBG_ERR_UNKNOWN, "Unknown error code from external API" }, \
{ MBG_ERR_PAM, "PAM authentication error" }, \
{ MBG_ERR_TIMER, "Timer expired" }, \
- { MBG_ERR_AGAIN, "Try again (later)" }, \
+ { MBG_ERR_AGAIN, "Try again later" }, \
{ MBG_ERR_STR_CHAR, "Invalid character in string" }, \
{ MBG_ERR_STR_LEN, "Wrong string length" }, \
{ MBG_ERR_SN_GCODE_LEN, "Invalid device group code length" }, \
@@ -535,14 +540,15 @@ extern "C" {
{ MBG_ERR_SN_VRFY, "Serial number could not be verified" }, \
{ MBG_ERR_RSRC_ITEM, "Too many resource items" }, \
{ MBG_ERR_BUFFER_TOO_SMALL, "Data buffer too small" }, \
- { MBG_ERR_OUTDATED, "Software/Module is too old/outdated. Please update!" }, \
+ { MBG_ERR_OUTDATED, "Software/module is too old/outdated. Please update!" }, \
{ MBG_ERR_STR_SUBSTR, "Invalid substring in string" }, \
{ MBG_ERR_IN_PROGRESS, "Long lasting operation in progress" }, \
{ MBG_ERR_INV_USER, "Invalid user" }, \
{ MBG_ERR_INV_GROUP, "Invalid group" }, \
{ MBG_ERR_NAME, "Invalid name" }, \
{ MBG_ERR_NOT_SUPP_BY_DRVR, "Not supported by the driver" }, \
- { MBG_ERR_OP_NOT_SUPP, "Requested operation is not supported" }
+ { MBG_ERR_OP_NOT_SUPP, "Requested operation not supported" }, \
+ { MBG_ERR_CFG_TRUNC, "Value was truncated" }
/**
diff --git a/mbglib/common/mbgserio.c b/mbglib/common/mbgserio.c
index c69a775..7439c7b 100644
--- a/mbglib/common/mbgserio.c
+++ b/mbglib/common/mbgserio.c
@@ -1,7 +1,6 @@
-
/**************************************************************************
*
- * $Id: mbgserio.c 1.11 2021/12/01 10:19:07 martin.burnicki REL_M $
+ * $Id: mbgserio.c 1.13 2023/05/09 10:00:38 martin REL_M $
*
* Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
*
@@ -10,7 +9,11 @@
*
* -----------------------------------------------------------------------
* $Log: mbgserio.c $
- * Revision 1.11 2021/12/01 10:19:07 martin.burnicki
+ * Revision 1.13 2023/05/09 10:00:38 martin
+ * Fixed a doxygen comment.
+ * Revision 1.12 2023/02/16 07:34:33 gregoire.diehl
+ * Added strdup define for target CVI
+ * Revision 1.11 2021/12/01 10:19:07Z martin.burnicki
* Make a parameter of mbgserio_get_duration_rcv() const.
* Revision 1.10 2021/05/04 20:31:36 martin
* New functions mbgserio_get_rx_fifo_threshold,
@@ -76,6 +79,7 @@
#include <mbgerror.h>
#include <str_util.h>
+#include <mbg_tgt.h>
#include <stdio.h>
#include <ctype.h>
@@ -87,7 +91,10 @@
#include <errno.h>
#endif
-#if defined( MBG_TGT_WIN32 )
+#if defined( MBG_TGT_CVI )
+ #include "toolbox.h"
+ #define strdup StrDup
+#elif defined( MBG_TGT_WIN32 )
#define strdup _strdup
#endif
@@ -1355,7 +1362,7 @@ _NO_MBG_API_ATTR int _MBG_API mbgserio_read( MBGSERIO_DEV *sdev, void *buffer, u
* @param[in] buffer Buffer with the bytes to write.
* @param[in] count Number of bytes in @p buffer to write.
*
- * @return On Success, the (positive) number of byte read,
+ * @return On Success, the (positive) number of byte written,
* or one of the (negative) @ref MBG_ERROR_CODES on error.
*/
_NO_MBG_API_ATTR int _MBG_API mbgserio_write( MBGSERIO_DEV *sdev, const void *buffer, unsigned int count )
diff --git a/mbglib/common/mbgserio.h b/mbglib/common/mbgserio.h
index 96c3be7..73b9cc8 100644
--- a/mbglib/common/mbgserio.h
+++ b/mbglib/common/mbgserio.h
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgserio.h 1.12 2021/12/01 10:19:10 martin.burnicki REL_M $
+ * $Id: mbgserio.h 1.13 2023/05/09 10:00:41 martin REL_M $
*
* Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
*
@@ -10,6 +10,8 @@
*
* -----------------------------------------------------------------------
* $Log: mbgserio.h $
+ * Revision 1.13 2023/05/09 10:00:41 martin
+ * Fixed a doxygen comment.
* Revision 1.12 2021/12/01 10:19:10 martin.burnicki
* Make a parameter of mbgserio_get_duration_rcv() const.
* Revision 1.11 2021/05/04 20:43:25 martin
@@ -337,7 +339,7 @@ typedef struct
* @param[in] buffer Buffer with the bytes to write.
* @param[in] count Number of bytes in @p buffer to write.
*
- * @return On Success, the (positive) number of byte read,
+ * @return On Success, the (positive) number of byte written,
* or one of the (negative) @ref MBG_ERROR_CODES on error.
*/
_NO_MBG_API_ATTR int _MBG_API mbgserio_write( MBGSERIO_DEV *sdev, const void *buffer, unsigned int count ) ;