BlueAndi / vscp-framework

Very Simple Control Protocol (VSCP) Level 1 Framework
Other
12 stars 8 forks source link

Adding unimplemented events #9

Closed troky closed 2 years ago

troky commented 6 years ago

How can I add unimplemented events, e.g. CLASS1.DISPLAY etc? I see those files are auto-generated.

BlueAndi commented 6 years ago

Providing this kind of abstraction is a lot of effort if its done manually (just by my own). Therefore the question 2 years ago was, how to do this automatically. The problem was that the event information was only available in the wiki. So I decided to write a wiki parser, which generated more or less the files automatically. Unfortunately, the wiki changed again.

The vision is to have the whole event informations in a xml file and use this as single source to generate them and additional other stuff as well. I am working on it in the background, but not ready right now.

This means you have to this by your own right now, e.g.

extern BOOL vscp_information_sendAliveEvent(uint8_t userData, uint8_t zone, uint8_t subZone)
{
    vscp_TxMessage txMsg;

    vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_INFORMATION, VSCP_TYPE_INFORMATION_ALIVE, VSCP_PRIORITY_3_NORMAL);

    txMsg.dataNum = 3;
    txMsg.data[0] = userData;
    txMsg.data[1] = zone;
    txMsg.data[2] = subZone;

    return vscp_core_sendEvent(&txMsg);
}

If you like, you can provide a file e.g. for CLASS1.DISPLAY via pull request. :-)

troky commented 6 years ago

Ok, will do.

troky commented 6 years ago

BTW, have you ever considered renaming that dataNum to something less confusing with meaning like dataLen? :)

BlueAndi commented 6 years ago

Always a question of the perspective ... what about dataSize :-)

troky commented 6 years ago

dataSize is also fine