Categories
Development General VSCP

Change of #VSCP package header definition

The VSCP package header is a 16-bit code that give some information about a VSCP event. A change has been made to this header that is not binary backward compatible. Software relying on it must therefore be recompiled to be compatible with other software for the upcoming version 14.0 of VSCP & Friends.

The first change is that the dumb-node bit has been moved from bit 14 to bit 15. This bit is used to indicate that an event originate from a node that does not have a MDF, no registers, noting else than that it can send VSCP events and maybe receive VSCP events. Ignorant of any other rules. Applications that used the VSCP_HEADER16_DUMB define will handle this perfectly if recompiled.

The second change is the bit that tells that the GUID is an IPv6 address. This bit was previously in bit 15 but is now in bit 12. Furthermore a field of three bits (14/13/12) has been allocated for GUID types. Applications that want to be compatible with the upcoming 14.0 release must take care of this.

Two new GUID types are also introduced. RFC-4122 V1 and RFC-4122 V4. You can read more about the difference between them here. This make sit easier to take advantage of UUID generating tools like this one.

So the complete header is now defined as

/*
            Bit 15 - This is a dumb node. No MDF, register, nothing.
            Bit 14 - GUID type 
            Bit 13 - GUID type
            Bit 12 - GUID type (GUID is IP v.6 address.)
            Bit 8-11 = Reserved
            Bit 765 =  priority, Priority 0-7 where 0 is highest.
            Bit 4 = hard coded, true for a hard coded device.
            Bit 3 = Don't calculate CRC, false for CRC usage.
                  Just checked when CRC is used.
                  If set the CRC should be set to 0xAA55 for
                  the event to be accepted without a CRC check.
            Bit 2 = Rolling index.
            Bit 1 = Rolling index.
            Bit 0 = Rolling index.
 */

New and old/changed defines are

#define VSCP_HEADER16_IPV6_GUID 0x1000 /* GUID is IPv6 address */
#define VSCP_HEADER16_DUMB 0x8000      /* This node is dumb */

/* Bits 14/13/12 for GUID type */
#define VSCP_HEADER16_GUID_TYPE_STANDARD  0x0000 /* VSCP standard GUID */
#define VSCP_HEADER16_GUID_TYPE_IPV6  0x1000     /* GUID is IPv6 address */
/* https://www.sohamkamani.com/blog/2016/10/05/uuid1-vs-uuid4/ */
#define VSCP_HEADER16_GUID_TYPE_RFC4122V1  0x2000 /* GUID is RFC 4122 Version 1 */
#define VSCP_HEADER16_GUID_TYPE_RFC4122V4  0x3000 /* GUID is RFC 4122 Version 4 */

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.