Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in SendInformationEvent() #8

Open
waaslandwolf opened this issue May 31, 2015 · 0 comments
Open

Possible bug in SendInformationEvent() #8

waaslandwolf opened this issue May 31, 2015 · 0 comments

Comments

@waaslandwolf
Copy link

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 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant