diff --git a/entry/src/main/ets/pages/judgeSDK/api/index.ets b/entry/src/main/ets/pages/judgeSDK/api/index.ets index 7b0ba8d0..505cd261 100644 --- a/entry/src/main/ets/pages/judgeSDK/api/index.ets +++ b/entry/src/main/ets/pages/judgeSDK/api/index.ets @@ -45,7 +45,8 @@ export async function examJudgeInit(data: JudgeInitObj) { * @desc 执行实时考试过程 实时传递传感信息 */ export async function examJudgeRealExam(data) { - const temp: number = libJudgeSdk.examJudgeRealExam(JSON.stringify(data), str.length); + const str = JSON.stringify(data); + const temp: number = libJudgeSdk.examJudgeRealExam(str, str.length); return await handle(temp, 'examJudgeRealExam') } diff --git a/ohos/so/@ohos.data.dataSharePredicates.d.ts b/ohos/dts/@ohos.data.dataSharePredicates.d.ts similarity index 100% rename from ohos/so/@ohos.data.dataSharePredicates.d.ts rename to ohos/dts/@ohos.data.dataSharePredicates.d.ts diff --git a/ohos/so/@ohos.distributedHardware.deviceManager.d.ts b/ohos/dts/@ohos.distributedHardware.deviceManager.d.ts similarity index 100% rename from ohos/so/@ohos.distributedHardware.deviceManager.d.ts rename to ohos/dts/@ohos.distributedHardware.deviceManager.d.ts diff --git a/ohos/so/@ohos.file.fileAccess.d.ts b/ohos/dts/@ohos.file.fileAccess.d.ts similarity index 100% rename from ohos/so/@ohos.file.fileAccess.d.ts rename to ohos/dts/@ohos.file.fileAccess.d.ts diff --git a/ohos/so/@ohos.file.photoAccessHelper.d.ts b/ohos/dts/@ohos.file.photoAccessHelper.d.ts similarity index 100% rename from ohos/so/@ohos.file.photoAccessHelper.d.ts rename to ohos/dts/@ohos.file.photoAccessHelper.d.ts diff --git a/ohos/so/@ohos.hiserialsdk.d.ts b/ohos/dts/@ohos.hiserialsdk.d.ts similarity index 85% rename from ohos/so/@ohos.hiserialsdk.d.ts rename to ohos/dts/@ohos.hiserialsdk.d.ts index 3cd65c46..ba716dfb 100644 --- a/ohos/so/@ohos.hiserialsdk.d.ts +++ b/ohos/dts/@ohos.hiserialsdk.d.ts @@ -21,7 +21,7 @@ import {Callback} from "./basic"; * @namespace HiSerialSDK * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform -* @since 9 +* @HONGZOS 2.0 */ declare namespace HiSerialSDK { /** @@ -45,6 +45,7 @@ declare namespace HiSerialSDK { * * @param hiSerDevice 串口设备路径,如 "/dev/ttyS0" * @param callback 串口设备fd句柄,如果串口打开失败返回-1 + * @HONGZOS 3.0 */ function SerialOpenAsync(hiSerDevice: string, callback: Callback): void; @@ -72,9 +73,29 @@ declare namespace HiSerialSDK { * @param stopbits 停止位 * @param parity 奇偶校验位 * @param callback 设置是否成功(0: 成功, -1: 失败) + * @HONGZOS 3.0 */ function SerialSetAsync(fd: number, speed: number, flow_ctrl: number, databits: number, stopbits: number, parity: number, callback: Callback): void; + /** + * 设置串口监听回调 + * + * @param fd 串口设备fd句柄 + * @param callback 监听到数据后执行的回调函数,其中参数1: 监听的串口设备fd句柄;参数2: 接收的串口数据长度;参数3: 接收的串口数据字节数组 + * + * @return 设置是否成功(0: 成功, -1: 失败) + */ + function SerialListenCallbackSet(fd: number, callback: Callback): number; + + /** + * 取消串口监听 + * + * @param fd 串口设备fd句柄 + * + * @return 设置是否成功(0: 成功, -1: 失败) + */ + function SerialListenCallbackCancel(fd: number): number; + /** * 发送数据 * @@ -90,6 +111,7 @@ declare namespace HiSerialSDK { * @param fd 串口设备fd句柄 * @param sendBuf 发送的数据字节数组 * @param callback 发送成功返回发送的数据长度,发送失败返回-1 + * @HONGZOS 3.0 */ function SerialSendAsync(fd: number, sendBuf: number[], callback: Callback): void; @@ -111,6 +133,7 @@ declare namespace HiSerialSDK { * @param timeout 接收数据时的最大等待时间,可设置为0,单位微秒(如:1000000 为1秒超时) * @param callback 接收的数据信息 * @param recvLen (可选参数)接收的最大字节数,不填默认一次最多接收1024字节 + * @HONGZOS 3.0 */ function SerialRecvAsync(fd: number, timeout: number, callback: Callback, recvLen?: number): void; @@ -127,6 +150,7 @@ declare namespace HiSerialSDK { * * @param fd 串口设备fd句柄 * @param 关闭操作执行结果(0: 成功, 其它: 失败) + * @HONGZOS 3.0 */ function SerialCloseAsync(fd: number, callback: Callback): void; } diff --git a/ohos/so/@ohos.idcard.d.ts b/ohos/dts/@ohos.idcard.d.ts similarity index 100% rename from ohos/so/@ohos.idcard.d.ts rename to ohos/dts/@ohos.idcard.d.ts diff --git a/ohos/so/@ohos.multimedia.camera.d.ts b/ohos/dts/@ohos.multimedia.camera.d.ts similarity index 100% rename from ohos/so/@ohos.multimedia.camera.d.ts rename to ohos/dts/@ohos.multimedia.camera.d.ts diff --git a/ohos/so/@ohos.multimedia.media.d.ts b/ohos/dts/@ohos.multimedia.media.d.ts similarity index 100% rename from ohos/so/@ohos.multimedia.media.d.ts rename to ohos/dts/@ohos.multimedia.media.d.ts diff --git a/ohos/so/@ohos.multimedia.mediaLibrary.d.ts b/ohos/dts/@ohos.multimedia.mediaLibrary.d.ts similarity index 100% rename from ohos/so/@ohos.multimedia.mediaLibrary.d.ts rename to ohos/dts/@ohos.multimedia.mediaLibrary.d.ts diff --git a/ohos/so/@ohos.net.ethernet.d.ts b/ohos/dts/@ohos.net.ethernet.d.ts similarity index 100% rename from ohos/so/@ohos.net.ethernet.d.ts rename to ohos/dts/@ohos.net.ethernet.d.ts diff --git a/ohos/so/@ohos.onvifclient.d.ts b/ohos/dts/@ohos.onvifclient.d.ts similarity index 100% rename from ohos/so/@ohos.onvifclient.d.ts rename to ohos/dts/@ohos.onvifclient.d.ts diff --git a/ohos/so/@ohos.rtsprecord.d.ts b/ohos/dts/@ohos.rtsprecord.d.ts similarity index 100% rename from ohos/so/@ohos.rtsprecord.d.ts rename to ohos/dts/@ohos.rtsprecord.d.ts diff --git a/ohos/so/libhiserialsdk.z.so b/ohos/so/libhiserialsdk.z.so new file mode 100644 index 00000000..b55c1497 Binary files /dev/null and b/ohos/so/libhiserialsdk.z.so differ