未验证 提交 18f3c16c 编写于 作者: Z Zhang 提交者: Gitee

update zh-cn/device-dev/driver/driver-hdf-sample.md.

Signed-off-by: NZhang <zhangfengxi@huawei.com>
上级 07c4127d
...@@ -157,13 +157,13 @@ static int OnDevEventReceived(void *priv, uint32_t id, struct HdfSBuf *data) ...@@ -157,13 +157,13 @@ static int OnDevEventReceived(void *priv, uint32_t id, struct HdfSBuf *data)
static int SendEvent(struct HdfIoService *serv, char *eventData) static int SendEvent(struct HdfIoService *serv, char *eventData)
{ {
int ret = 0; int ret = 0;
struct HdfSBuf *data = HdfSBufObtainDefaultSize(); struct HdfSBuf *data = HdfSbufObtainDefaultSize();
if (data == NULL) { if (data == NULL) {
HDF_LOGE("fail to obtain sbuf data"); HDF_LOGE("fail to obtain sbuf data");
return 1; return 1;
} }
struct HdfSBuf *reply = HdfSBufObtainDefaultSize(); struct HdfSBuf *reply = HdfSbufObtainDefaultSize();
if (reply == NULL) { if (reply == NULL) {
HDF_LOGE("fail to obtain sbuf reply"); HDF_LOGE("fail to obtain sbuf reply");
ret = HDF_DEV_ERR_NO_MEMORY; ret = HDF_DEV_ERR_NO_MEMORY;
...@@ -190,8 +190,8 @@ static int SendEvent(struct HdfIoService *serv, char *eventData) ...@@ -190,8 +190,8 @@ static int SendEvent(struct HdfIoService *serv, char *eventData)
} }
HDF_LOGE("Get reply is: %d", replyData); HDF_LOGE("Get reply is: %d", replyData);
out: out:
HdfSBufRecycle(data); HdfSbufRecycle(data);
HdfSBufRecycle(reply); HdfSbufRecycle(reply);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册