mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-08-26 18:17:07 -04:00
Add DAC user mode interface
Signed-off-by: zhangyalei <zhangyalei7@huawei.com>
This commit is contained in:
@@ -32,7 +32,7 @@ static int32_t DacTestGetConfig(struct DacTestConfig *config)
|
||||
return HDF_ERR_NOT_SUPPORT;
|
||||
}
|
||||
|
||||
reply = HdfSBufObtain(sizeof(*config) + sizeof(uint64_t));
|
||||
reply = HdfSbufObtain(sizeof(*config) + sizeof(uint64_t));
|
||||
if (reply == NULL) {
|
||||
HDF_LOGE("%s: failed to obtain reply", __func__);
|
||||
return HDF_ERR_MALLOC_FAIL;
|
||||
@@ -41,27 +41,28 @@ static int32_t DacTestGetConfig(struct DacTestConfig *config)
|
||||
ret = service->dispatcher->Dispatch(&service->object, 0, NULL, reply);
|
||||
if (ret != HDF_SUCCESS) {
|
||||
HDF_LOGE("%s: remote dispatch failed", __func__);
|
||||
HdfSbufRecycle(reply);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!HdfSbufReadBuffer(reply, &buf, &len)) {
|
||||
HDF_LOGE("%s: read buf failed", __func__);
|
||||
HdfSBufRecycle(reply);
|
||||
HdfSbufRecycle(reply);
|
||||
return HDF_ERR_IO;
|
||||
}
|
||||
|
||||
if (len != sizeof(*config)) {
|
||||
HDF_LOGE("%s: config size:%zu, read size:%u", __func__, sizeof(*config), len);
|
||||
HdfSBufRecycle(reply);
|
||||
HdfSbufRecycle(reply);
|
||||
return HDF_ERR_IO;
|
||||
}
|
||||
|
||||
if (memcpy_s(config, sizeof(*config), buf, sizeof(*config)) != EOK) {
|
||||
HDF_LOGE("%s: memcpy buf failed", __func__);
|
||||
HdfSBufRecycle(reply);
|
||||
HdfSbufRecycle(reply);
|
||||
return HDF_ERR_IO;
|
||||
}
|
||||
HdfSBufRecycle(reply);
|
||||
HdfSbufRecycle(reply);
|
||||
HDF_LOGD("%s: exit", __func__);
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user