Hello,
I'd like to be able to create a general mechanism where my application can send a request to a device with the device driver knowing as little as possible about the request, so I can extend the device command set without altering the driver.
What I'd like to do is pass a reference to an event to the driver, and have the driver trigger the event and send a void * data value for the application to interpret. It seems like triggering an event is the best way to go - UpdateProperty wants a specific data type, and I'd like for the driver not to have to know the data type of the result.
I wrote a small app to test the concept, and I see the code generated for the trigger event is:
/* This method is intended to be called by the device to notify the GUI applicationabout a particular system event. */
void ApplicationDeviceClass_TriggerEvent( ApplicationDeviceClass _this )
{
CoreSystemEvent_Trigger( &_this->SystemEvent, 0, 0 );
}
It seems like the parameter is supposed to be a reference to the class, not arbitrary data. Is that correct? Or does the parameter get passed to the event handler without being interpreted? It the second case, can I pass a reference to the trigger function to my device driver to be called when the operation is complete?
Thanks!