文件名称:
SubscriberCallback.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
4.25 KB
下载地址:
文本预览:
# SubscriberCallback
## **Overview**
**Related Modules:**
[Core](Core.md)
**Description:**
Called when the driver subscribes to other driver services.
The callback is used in the service subscription mechanism. After the driver is registered with the HDF, the HDF proactively invokes the callback after the subscribed-to driver is loaded.
**Since:**
1.0
## **Summary**
## Data Fields
## **Details**
## **Field Documentation**
## deviceObject
```
struct [HdfDeviceObject](HdfDeviceObject.md)* SubscriberCallback::deviceObject
```
**Description:**
Driver object of the subscriber
## OnServiceConnected
```
int32_t(* SubscriberCallback::OnServiceConnected) (struct [HdfDeviceObject](HdfDeviceObject.md) *[deviceObject](SubscriberCallback.md#af8640bdb30eb50c1d69781940b62c20d), const struct [HdfObject](HdfObject.md) *service)
```
**Description:**
Called by the HDF when the subscribed-to driver service is loaded.
**Parameters:**
**Returns:**
Returns **0** if the operation is successful; returns a non-zero value otherwise.
## **Overview**
**Related Modules:**
[Core](Core.md)
**Description:**
Called when the driver subscribes to other driver services.
The callback is used in the service subscription mechanism. After the driver is registered with the HDF, the HDF proactively invokes the callback after the subscribed-to driver is loaded.
**Since:**
1.0
## **Summary**
## Data Fields
struct HdfDeviceObject * | |
OnServiceConnected )(struct HdfDeviceObject *deviceObject, const struct HdfObject *service) | Called by the HDF when the subscribed-to driver service is loaded. |
## **Details**
## **Field Documentation**
## deviceObject
```
struct [HdfDeviceObject](HdfDeviceObject.md)* SubscriberCallback::deviceObject
```
**Description:**
Driver object of the subscriber
## OnServiceConnected
```
int32_t(* SubscriberCallback::OnServiceConnected) (struct [HdfDeviceObject](HdfDeviceObject.md) *[deviceObject](SubscriberCallback.md#af8640bdb30eb50c1d69781940b62c20d), const struct [HdfObject](HdfObject.md) *service)
```
**Description:**
Called by the HDF when the subscribed-to driver service is loaded.
**Parameters:**
deviceObject | Indicates the pointer to the variable of the HdfDeviceObject type. This variable is generated by the HDF and passed to the driver. |
service | Indicates the pointer to the service object. |
**Returns:**
Returns **0** if the operation is successful; returns a non-zero value otherwise.
点赞
回复
X