Skip to content

Commit 0d98b25

Browse files
Fixed some errors
1 parent a86618c commit 0d98b25

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

src/vscp/common/vscp.h

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,14 @@ typedef VSCPChannelInfo *PVSCPCHANNELINFO;
292292

293293
/* Interface types */
294294
#define VSCP_INTERFACE_TYPE_UNKNOWN 0
295-
#define VSCP_INTERFACE_TYPE_INTERNAL 1 // Internal to daemon/server
296-
#define VSCP_INTERFACE_TYPE_LEVEL1DRV 2 // Level I driver
297-
#define VSCP_INTERFACE_TYPE_LEVEL2DRV 3 // Level II driver
298-
#define VSCP_INTERFACE_TYPE_CLIENT_TCPIP 4 // TCP/IP client
299-
#define VSCP_INTERFACE_TYPE_CLIENT_UDP 5 // UDP client
300-
#define VSCP_INTERFACE_TYPE_CLIENT_WEB 6 // Web server
301-
#define VSCP_INTERFACE_TYPE_CLIENT_WEBSOCK 7 // Websocket client
302-
#define VSCP_INTERFACE_TYPE_CLIENT_REST 8 // REST client
295+
#define VSCP_INTERFACE_TYPE_INTERNAL 1 // Internal to daemon/server
296+
#define VSCP_INTERFACE_TYPE_LEVEL1DRV 2 // Level I driver
297+
#define VSCP_INTERFACE_TYPE_LEVEL2DRV 3 // Level II driver
298+
#define VSCP_INTERFACE_TYPE_CLIENT_TCPIP 4 // TCP/IP client
299+
#define VSCP_INTERFACE_TYPE_CLIENT_UDP 5 // UDP client
300+
#define VSCP_INTERFACE_TYPE_CLIENT_WEB 6 // Web server
301+
#define VSCP_INTERFACE_TYPE_CLIENT_WEBSOCK 7 // Websocket client
302+
#define VSCP_INTERFACE_TYPE_CLIENT_REST 8 // REST client
303303

304304
/* VSCP Encryption types */
305305
#define VSCP_ENCRYPTION_NONE 0
@@ -479,11 +479,16 @@ struct vscpMyNode {
479479
/* * * * Standard VSCP registers * * * */
480480

481481
/* Register defines above 0x7f (Level I) / 0xffffff7f (Level II) */
482+
#define VSCP_STD_REGISTER_START 0x80
483+
484+
// Alarm status (Read only)
482485
#define VSCP_STD_REGISTER_ALARM_STATUS 0x80
483486

484487
#define VSCP_STD_REGISTER_MAJOR_VERSION 0x81
485488
#define VSCP_STD_REGISTER_MINOR_VERSION 0x82
486-
#define VSCP_STD_REGISTER_SUB_VERSION 0x83
489+
490+
// Counts errors
491+
#define VSCP_STD_REGISTER_ERROR_COUNTER 0x83
487492

488493
/* 0x84 - 0x88 - User id space */
489494
#define VSCP_STD_REGISTER_USER_ID 0x84
@@ -506,10 +511,11 @@ struct vscpMyNode {
506511
#define VSCP_STD_REGISTER_FIRMWARE_MAJOR 0x94
507512
#define VSCP_STD_REGISTER_FIRMWARE_MINOR 0x95
508513
#define VSCP_STD_REGISTER_FIRMWARE_SUBMINOR 0x96
514+
#define VSCP_STD_REGISTER_FIRMWARE_RELEASE 0x96
509515

510516
#define VSCP_STD_REGISTER_BOOT_LOADER 0x97
511-
#define VSCP_STD_REGISTER_BUFFER_SIZE 0x98
512-
#define VSCP_STD_REGISTER_PAGES_COUNT 0x99
517+
#define VSCP_STD_REGISTER_BUFFER_SIZE 0x98 // Deprecated
518+
#define VSCP_STD_REGISTER_PAGES_COUNT 0x99 // Deprecated
513519

514520
/* Unsigned 32-bit integer for family code */
515521
#define VSCP_STD_REGISTER_FAMILY_CODE 0x9A

src/vscp/common/vscphelper.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,19 @@
140140
(((val) >> 24) & 0x0000000000FF0000) | (((val) >> 8) & 0x00000000FF000000) | (((val) << 8) & 0x000000FF00000000) | \
141141
(((val) << 24) & 0x0000FF0000000000) | (((val) << 40) & 0x00FF000000000000) | (((val) << 56) & 0xFF00000000000000))
142142

143+
/*!
144+
* @name Min/max macros
145+
* @{
146+
*/
147+
#if !defined(MIN)
148+
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
149+
#endif
150+
151+
#if !defined(MAX)
152+
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
153+
#endif
154+
/* @} */
155+
143156
// For platform independet non-case dependent string compare
144157
#ifdef _MSC_VER
145158
// not #if defined(_WIN32) || defined(_WIN64) because we have strncasecmp in mingw

0 commit comments

Comments
 (0)