resource-manager: Add API for fine-tuned event listening 92/299792/5
authorYoungjae Cho <y0.cho@samsung.com>
Fri, 6 Oct 2023 07:23:04 +0000 (16:23 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 16 Oct 2023 07:43:37 +0000 (16:43 +0900)
commit8e7737961a6c8a9bbd6818e6a729b5b1a804a7d2
tree6ad5af97111c819f73f59e8057d526e516e64cfd
parent5b24597f25d7474a64186b8a4b9800a9bd329427
resource-manager: Add API for fine-tuned event listening

The syscommon_resman_subscribe_resource_event() has been split into
3 variants, each of which can narrow down the range of events that
we want to listen to.
- syscommon_resman_subscribe_event(...)
  : It is identical to the existing one. Listen any events from any
    type of resources.

- syscommon_resman_subscribe_resource_event(resource_type, ...)
  : Listen any changes of attribute from specific type of resources.

- syscommon_resman_subscribe_resource_attribute_event(resource_type,
     attr_mask, ...)
  : Listen change of specific attributes from specific type of resources.

In addition, the event callback has been changed to receive an additional
parameter, void *user_data.

Change-Id: I41876fa746d1d042bc1595db55d29e3b8ff13e86
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
include/libsyscommon/resource-manager.h
src/resource-manager/resource-manager.c
tests/resource-manager/battery-interface.h [new file with mode: 0644]
tests/resource-manager/common-interface.h
tests/resource-manager/resource-battery.c [new file with mode: 0644]
tests/resource-manager/resource-battery.h [new file with mode: 0644]
tests/resource-manager/resource-display.c
tests/resource-manager/test.c