加入收藏
举报
02-14 20:02
#0
文件名称:
SubscriberCallback.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
4.25 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# 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












Variable Name


Description


deviceObject


struct HdfDeviceObject


OnServiceConnected )(struct HdfDeviceObject *deviceObject, const struct HdfObject *service)


int32_t(* 


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:**












Name


Description


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.
点赞 回复
回帖
支持markdown部分语法 ?