Skip to content

Possible bug in SendInformationEvent() #8

@waaslandwolf

Description

@waaslandwolf

The current implementation of SendInformationEvent() in my Hasselt/Paris-based firmware is:

void SendInformationEvent( unsigned char idx, unsigned char eventClass, unsigned char eventTypeId) 

{
    vscp_omsg.priority = VSCP_PRIORITY_MEDIUM;
    vscp_omsg.flags = VSCP_VALID_MSG + 3;
    vscp_omsg.vscp_class = eventClass;
    vscp_omsg.vscp_type = eventTypeId;

    vscp_omsg.data[ 0 ] = idx;                                          //index
    vscp_omsg.data[ 1 ] = readEEPROM( VSCP_EEPROM_END + EEPROM_ZONE );  //zone
    vscp_omsg.data[ 2 ] = readEEPROM( VSCP_EEPROM_END + idx );          //subzone

    vscp_sendEvent();   // Send data
}

omsg.data[2] should be the subzone as per the protocol specification. In the case of my MDF the subzone register is indeed located at VSCP_EEPROM_END + idx, but in case the register order in the MDF changes this will no longer be the case.

Wouldn't it be better to use this instead?
vscp_omsg.data[ 2 ] = readEEPROM( VSCP_EEPROM_END + EEPROM_SUBZONE );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions