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 DEVICE_HOST_SERVICE_H 10 #define DEVICE_HOST_SERVICE_H 11 12 #include "devhost_service_if.h" 13 #include "hdf_service_observer.h" 14 #include "hdf_dlist.h" 15 #include "osal_mutex.h" 16 #include "osal_sysevent.h" 17 18 struct DevHostService { 19 struct IDevHostService super; 20 uint16_t hostId; 21 const char *hostName; 22 struct DListHead devices; 23 struct HdfServiceObserver observer; 24 struct HdfSysEventNotifyNode sysEventNotifyNode; 25 }; 26 27 void DevHostServiceConstruct(struct DevHostService *service); 28 void DevHostServiceDestruct(struct DevHostService *service); 29 int DevHostServiceAddDevice(struct IDevHostService *inst, const struct HdfDeviceInfo *deviceInfo); 30 int DevHostServiceDelDevice(struct IDevHostService *inst, devid_t devId); 31 struct IDevHostService *DevHostServiceNewInstance(uint16_t hostId, const char *hostName); 32 void DevHostServiceFreeInstance(struct IDevHostService *service); 33 struct HdfObject *DevHostServiceCreate(void); 34 void DevHostServiceRelease(struct HdfObject *object); 35 36 #endif /* DEVICE_HOST_SERVICE_H */ 37