resource-manager: Add API for event handling 68/298768/4
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 13 Sep 2023 07:38:04 +0000 (16:38 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 16 Oct 2023 07:43:37 +0000 (16:43 +0900)
commitd91ade14e1b885621f084a30a81bee3f7e8adfae
treefd530f32d1ae768ec1be8c1ef83f50263c4a5231
parent8d3d43228304e7e920f13b2bcf55a7fc283f65e2
resource-manager: Add API for event handling

On setting a value onto an attribute using resource-manager set API,
that setting event is broadcasted to listeners.

- typedef (*syscommon_resman_resource_event_cb) (int resource_type,
int resource_id, int attr_id, const void *data, int count)
  : It receives information about attribute value that has been set
    by resource-manager set API.

- syscommon_resman_subscribe_resource_event()
  : It registers callback function and receives associated 'id' that
    represents callback object. The callback function will be called
    on calling set API to the attribute.

- syscommon_resman_unsubscribe_resource_event()
  : It unregisters callback from listening. The 'id' is one that has
    received from the syscommon_resman_subscribe_resource_event().

Change-Id: I38765498521968e5db0c11a5e5d9285b4a4951f2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
include/libsyscommon/resource-manager.h
src/resource-manager/resource-manager.c
tests/resource-manager/test.c