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

Question not an Issue :) #8

Open
michpro opened this issue Oct 29, 2024 · 1 comment
Open

Question not an Issue :) #8

michpro opened this issue Oct 29, 2024 · 1 comment
Labels

Comments

@michpro
Copy link

michpro commented Oct 29, 2024

Great library :)
Do you have any example using decision matrix? Is it enough to send the corresponding values e.g. through the VSCP works program (with the corresponding mdf file of course) and in the program only handle the actions in the callback 'void actionExecute(unsigned char action, unsigned char par, vscp_RxMessage const * const msg)' or does something else need to be added?

@BlueAndi
Copy link
Owner

BlueAndi commented Oct 29, 2024

You need to configure the decision matrix itself. You can do this via code or via a tool.
Don't forget to enable each decision matrix row otherwise its not considered. :-)

One decision matrix row looks like:
https://github.com/BlueAndi/vscp-framework/blob/6c6e339a009bc2cddff1ce315198a8be0734a48a/src/vscp_dm.h#L135-L147

Via code:

void configureDM()
{
    vscp_dm_MatrixRow   rows[2];
    uint8_t*            data    = (uint8_t*)rows;

    /* Row 0 */
    rows[0].oaddr = ...
    rows[0].flags = ...
    rows[0].classMask = ...
    rows[0].classFilter = ...
    rows[0].typeMask = ...
    rows[0].typeFilter = ...
    rows[0].action = ...
    rows[0].actionPar= ...

    /* Row 1 */
    ...

    /* Write to persistent memory. */
    vscp_ps_writeDMMultiple(0, data, sizeof(rows));
}

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

No branches or pull requests

2 participants