• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef HDF_SERVICE_OBSERVER_H
10 #define HDF_SERVICE_OBSERVER_H
11 
12 #include "hdf_service_subscriber.h"
13 #include "osal_mutex.h"
14 
15 struct HdfServiceObserver {
16     struct HdfSList services;
17     struct OsalMutex observerMutex;
18 };
19 
20 bool HdfServiceObserverConstruct(struct HdfServiceObserver *observer);
21 void HdfServiceObserverDestruct(struct HdfServiceObserver *observer);
22 int HdfServiceObserverPublishService(struct HdfServiceObserver *observer,
23     const char *svcName, uint32_t pubHardwareId, uint16_t policy, struct HdfObject *service);
24 int HdfServiceObserverSubscribeService(struct HdfServiceObserver *observer,
25     const char *svcName, uint32_t subHardwareId, struct SubscriberCallback callback);
26 void HdfServiceObserverRemoveRecord(struct HdfServiceObserver *observer, const char *svcName);
27 
28 #endif /* HDF_SERVICE_OBSERVER_H */
29