From d421a71d97032ab67c77a675a046ec376897665a Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 12 Feb 2025 21:35:17 +0800 Subject: [PATCH] modify controlDeviceAction api version Signed-off-by: lee --- frameworks/js/napi/src/connection/napi_bluetooth_connection.cpp | 2 ++ interfaces/inner_api/include/bluetooth_remote_device.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frameworks/js/napi/src/connection/napi_bluetooth_connection.cpp b/frameworks/js/napi/src/connection/napi_bluetooth_connection.cpp index fbe9ee19..f7db4465 100644 --- a/frameworks/js/napi/src/connection/napi_bluetooth_connection.cpp +++ b/frameworks/js/napi/src/connection/napi_bluetooth_connection.cpp @@ -1054,6 +1054,8 @@ napi_value ControlDeviceAction(napi_env env, napi_callback_info info) auto checkRes = napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL); NAPI_BT_ASSERT_RETURN_UNDEF(env, checkRes == napi_ok, BT_ERR_INVALID_PARAM); + NAPI_BT_ASSERT_RETURN_UNDEF(env, argc == ARGS_SIZE_ONE, BT_ERR_INVALID_PARAM); + ControlDeviceActionParams params = { INVALID_MAC_ADDRESS, INVALID_CONTROL_TYPE, INVALID_CONTROL_TYPE_VAL, INVALID_CONTROL_OBJECT }; auto status = ParseControlDeviceActionParams(env, argv[PARAM0], params); diff --git a/interfaces/inner_api/include/bluetooth_remote_device.h b/interfaces/inner_api/include/bluetooth_remote_device.h index 73563275..cb0210dc 100644 --- a/interfaces/inner_api/include/bluetooth_remote_device.h +++ b/interfaces/inner_api/include/bluetooth_remote_device.h @@ -408,7 +408,7 @@ public: * @param controlObject The control object. * @return Returns BT_NO_ERROR if the operation is successful; * returns Other code if the operation fails. - * @since 16 + * @since 15 */ int32_t ControlDeviceAction(uint32_t controlType, uint32_t controlTypeVal, uint32_t controlObject) const; -- Gitee