Skip to content

Commit

Permalink
Fixed some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed May 17, 2024
1 parent a86618c commit 0d98b25
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/vscp/common/vscp.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,14 @@ typedef VSCPChannelInfo *PVSCPCHANNELINFO;

/* Interface types */
#define VSCP_INTERFACE_TYPE_UNKNOWN 0
#define VSCP_INTERFACE_TYPE_INTERNAL 1 // Internal to daemon/server
#define VSCP_INTERFACE_TYPE_LEVEL1DRV 2 // Level I driver
#define VSCP_INTERFACE_TYPE_LEVEL2DRV 3 // Level II driver
#define VSCP_INTERFACE_TYPE_CLIENT_TCPIP 4 // TCP/IP client
#define VSCP_INTERFACE_TYPE_CLIENT_UDP 5 // UDP client
#define VSCP_INTERFACE_TYPE_CLIENT_WEB 6 // Web server
#define VSCP_INTERFACE_TYPE_CLIENT_WEBSOCK 7 // Websocket client
#define VSCP_INTERFACE_TYPE_CLIENT_REST 8 // REST client
#define VSCP_INTERFACE_TYPE_INTERNAL 1 // Internal to daemon/server
#define VSCP_INTERFACE_TYPE_LEVEL1DRV 2 // Level I driver
#define VSCP_INTERFACE_TYPE_LEVEL2DRV 3 // Level II driver
#define VSCP_INTERFACE_TYPE_CLIENT_TCPIP 4 // TCP/IP client
#define VSCP_INTERFACE_TYPE_CLIENT_UDP 5 // UDP client
#define VSCP_INTERFACE_TYPE_CLIENT_WEB 6 // Web server
#define VSCP_INTERFACE_TYPE_CLIENT_WEBSOCK 7 // Websocket client
#define VSCP_INTERFACE_TYPE_CLIENT_REST 8 // REST client

/* VSCP Encryption types */
#define VSCP_ENCRYPTION_NONE 0
Expand Down Expand Up @@ -479,11 +479,16 @@ struct vscpMyNode {
/* * * * Standard VSCP registers * * * */

/* Register defines above 0x7f (Level I) / 0xffffff7f (Level II) */
#define VSCP_STD_REGISTER_START 0x80

// Alarm status (Read only)
#define VSCP_STD_REGISTER_ALARM_STATUS 0x80

#define VSCP_STD_REGISTER_MAJOR_VERSION 0x81
#define VSCP_STD_REGISTER_MINOR_VERSION 0x82
#define VSCP_STD_REGISTER_SUB_VERSION 0x83

// Counts errors
#define VSCP_STD_REGISTER_ERROR_COUNTER 0x83

/* 0x84 - 0x88 - User id space */
#define VSCP_STD_REGISTER_USER_ID 0x84
Expand All @@ -506,10 +511,11 @@ struct vscpMyNode {
#define VSCP_STD_REGISTER_FIRMWARE_MAJOR 0x94
#define VSCP_STD_REGISTER_FIRMWARE_MINOR 0x95
#define VSCP_STD_REGISTER_FIRMWARE_SUBMINOR 0x96
#define VSCP_STD_REGISTER_FIRMWARE_RELEASE 0x96

#define VSCP_STD_REGISTER_BOOT_LOADER 0x97
#define VSCP_STD_REGISTER_BUFFER_SIZE 0x98
#define VSCP_STD_REGISTER_PAGES_COUNT 0x99
#define VSCP_STD_REGISTER_BUFFER_SIZE 0x98 // Deprecated
#define VSCP_STD_REGISTER_PAGES_COUNT 0x99 // Deprecated

/* Unsigned 32-bit integer for family code */
#define VSCP_STD_REGISTER_FAMILY_CODE 0x9A
Expand Down
13 changes: 13 additions & 0 deletions src/vscp/common/vscphelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@
(((val) >> 24) & 0x0000000000FF0000) | (((val) >> 8) & 0x00000000FF000000) | (((val) << 8) & 0x000000FF00000000) | \
(((val) << 24) & 0x0000FF0000000000) | (((val) << 40) & 0x00FF000000000000) | (((val) << 56) & 0xFF00000000000000))

/*!
* @name Min/max macros
* @{
*/
#if !defined(MIN)
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif

#if !defined(MAX)
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
/* @} */

// For platform independet non-case dependent string compare
#ifdef _MSC_VER
// not #if defined(_WIN32) || defined(_WIN64) because we have strncasecmp in mingw
Expand Down

0 comments on commit 0d98b25

Please sign in to comment.