Handle device events
Device insertion callback
The driver framework calls the insertion callback, hid_insertion() in joystick_demo.c of the demo driver, when the identified device is inserted. The demo performs the following typical actions:
Find reports you’re interested in (hidd_get_collections(), hidd_collection_usage(), hidd_get_report_instance())
Get information about the report (hidd_report_len() , hidd_num_buttons())
Attach to reports (hidd_report_attach())
The joystick_demo.c file is located in hiddi.h; this library is present in your SDP installation for declaring data structure and functions.
Device removal callback
The driver framework calls the removal callback when the identified device is removed from the system. Use hidd_reports_detach() to unregister from reports for a device in the removal callback. You can also set up signal handling to clean up resources on process termination. Refer to the hid_removal() and joystick_demo_signal_handler() functions in joystick_demo.c of the demo driver for details.
