提交 05f0ceef 编写于 作者: O openharmony_ci 提交者: Gitee

!301 update driver docs to adapt the latest interface

Merge pull request !301 from yuanbo/master
...@@ -24,7 +24,7 @@ The message mechanism provides the following features: ...@@ -24,7 +24,7 @@ The message mechanism provides the following features:
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody><tr id="row1582426174114"><td class="cellrowborder" valign="top" width="46.379999999999995%" headers="mcps1.2.3.1.1 "><p id="p182341916144420"><a name="p182341916144420"></a><a name="p182341916144420"></a>struct HdfIoService *HdfIoServiceBind(const char *serviceName, mode_t permission)</p> <tbody><tr id="row1582426174114"><td class="cellrowborder" valign="top" width="46.379999999999995%" headers="mcps1.2.3.1.1 "><p id="p182341916144420"><a name="p182341916144420"></a><a name="p182341916144420"></a>struct HdfIoService *HdfIoServiceBind(const char *serviceName)</p>
</td> </td>
<td class="cellrowborder" valign="top" width="53.620000000000005%" headers="mcps1.2.3.1.2 "><p id="p58272614113"><a name="p58272614113"></a><a name="p58272614113"></a>Obtains a specified driver service. After the service is obtained, the <strong id="b9799159433"><a name="b9799159433"></a><a name="b9799159433"></a>Dispatch</strong> function of the service is used to send messages to the driver.</p> <td class="cellrowborder" valign="top" width="53.620000000000005%" headers="mcps1.2.3.1.2 "><p id="p58272614113"><a name="p58272614113"></a><a name="p58272614113"></a>Obtains a specified driver service. After the service is obtained, the <strong id="b9799159433"><a name="b9799159433"></a><a name="b9799159433"></a>Dispatch</strong> function of the service is used to send messages to the driver.</p>
</td> </td>
...@@ -100,7 +100,7 @@ The message mechanism provides the following features: ...@@ -100,7 +100,7 @@ The message mechanism provides the following features:
HDF_LOGE("test msg is null"); HDF_LOGE("test msg is null");
return -1; return -1;
} }
struct HdfIoService *serv = HdfIoServiceBind("sample_driver", 0); struct HdfIoService *serv = HdfIoServiceBind("sample_driver");
if (serv == NULL) { if (serv == NULL) {
HDF_LOGE("fail to get service"); HDF_LOGE("fail to get service");
return -1; return -1;
...@@ -159,7 +159,7 @@ The message mechanism provides the following features: ...@@ -159,7 +159,7 @@ The message mechanism provides the following features:
``` ```
int RegisterListen() int RegisterListen()
{ {
struct HdfIoService *serv = HdfIoServiceBind("sample_driver", 0); struct HdfIoService *serv = HdfIoServiceBind("sample_driver");
if (serv == NULL) { if (serv == NULL) {
HDF_LOGE("fail to get service"); HDF_LOGE("fail to get service");
return -1; return -1;
......
...@@ -195,7 +195,7 @@ out: ...@@ -195,7 +195,7 @@ out:
int main() int main()
{ {
char *sendData = "default event info"; char *sendData = "default event info";
struct HdfIoService *serv = HdfIoServiceBind(SAMPLE_SERVICE_NAME, 0); struct HdfIoService *serv = HdfIoServiceBind(SAMPLE_SERVICE_NAME);
if (serv == NULL) { if (serv == NULL) {
HDF_LOGE("fail to get service %s", SAMPLE_SERVICE_NAME); HDF_LOGE("fail to get service %s", SAMPLE_SERVICE_NAME);
return HDF_FAILURE; return HDF_FAILURE;
......
...@@ -195,7 +195,7 @@ out: ...@@ -195,7 +195,7 @@ out:
int main() int main()
{ {
char *sendData = "default event info"; char *sendData = "default event info";
struct HdfIoService *serv = HdfIoServiceBind(SAMPLE_SERVICE_NAME, 0); struct HdfIoService *serv = HdfIoServiceBind(SAMPLE_SERVICE_NAME);
if (serv == NULL) { if (serv == NULL) {
HDF_LOGE("fail to get service %s", SAMPLE_SERVICE_NAME); HDF_LOGE("fail to get service %s", SAMPLE_SERVICE_NAME);
return HDF_FAILURE; return HDF_FAILURE;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody><tr id="row1582426174114"><td class="cellrowborder" valign="top" width="46.379999999999995%" headers="mcps1.2.3.1.1 "><p id="p182341916144420"><a name="p182341916144420"></a><a name="p182341916144420"></a>struct HdfIoService *HdfIoServiceBind(const char *serviceName, mode_t permission)</p> <tbody><tr id="row1582426174114"><td class="cellrowborder" valign="top" width="46.379999999999995%" headers="mcps1.2.3.1.1 "><p id="p182341916144420"><a name="p182341916144420"></a><a name="p182341916144420"></a>struct HdfIoService *HdfIoServiceBind(const char *serviceName)</p>
</td> </td>
<td class="cellrowborder" valign="top" width="53.620000000000005%" headers="mcps1.2.3.1.2 "><p id="p58272614113"><a name="p58272614113"></a><a name="p58272614113"></a>用户态获取驱动的服务,获取该服务之后通过服务中的Dispatch方法向驱动发送消息。</p> <td class="cellrowborder" valign="top" width="53.620000000000005%" headers="mcps1.2.3.1.2 "><p id="p58272614113"><a name="p58272614113"></a><a name="p58272614113"></a>用户态获取驱动的服务,获取该服务之后通过服务中的Dispatch方法向驱动发送消息。</p>
</td> </td>
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
HDF_LOGE("test msg is null"); HDF_LOGE("test msg is null");
return -1; return -1;
} }
struct HdfIoService *serv = HdfIoServiceBind("sample_driver", 0); struct HdfIoService *serv = HdfIoServiceBind("sample_driver");
if (serv == NULL) { if (serv == NULL) {
HDF_LOGE("fail to get service"); HDF_LOGE("fail to get service");
return -1; return -1;
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
``` ```
int RegisterListen() int RegisterListen()
{ {
struct HdfIoService *serv = HdfIoServiceBind("sample_driver", 0); struct HdfIoService *serv = HdfIoServiceBind("sample_driver");
if (serv == NULL) { if (serv == NULL) {
HDF_LOGE("fail to get service"); HDF_LOGE("fail to get service");
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册