From 1e8636c3cde1bdaa3e115c4fcd2f6a5a59412248 Mon Sep 17 00:00:00 2001 From: hui Date: Tue, 1 Jul 2025 16:22:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E7=BA=A7=E5=88=AB=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20Signed-off-by:=20hui=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bluetooth/gatt-development-guide.md | 16 ++++++++-------- .../js-apis-bluetooth-ble.md | 8 ++++---- .../js-apis-bluetooth-connection-sys.md | 2 +- .../js-apis-bluetooth-connection.md | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/zh-cn/application-dev/connectivity/bluetooth/gatt-development-guide.md b/zh-cn/application-dev/connectivity/bluetooth/gatt-development-guide.md index 7c21b8e5a20..ecfe27231d5 100644 --- a/zh-cn/application-dev/connectivity/bluetooth/gatt-development-guide.md +++ b/zh-cn/application-dev/connectivity/bluetooth/gatt-development-guide.md @@ -236,7 +236,7 @@ try { // enable入参: true表示启用,false表示禁用 gattClient.setCharacteristicChangeNotification(characteristic, true, (err: BusinessError) => { if (err) { - console.info('setCharacteristicChangeNotification callback failed'); + console.error('setCharacteristicChangeNotification callback failed'); } else { console.info('setCharacteristicChangeNotification callback successful'); } @@ -250,7 +250,7 @@ try { // enable入参: true表示启用,false表示禁用 gattClient.setCharacteristicChangeIndication(characteristic, true, (err: BusinessError) => { if (err) { - console.info('setCharacteristicChangeIndication callback failed'); + console.error('setCharacteristicChangeIndication callback failed'); } else { console.info('setCharacteristicChangeIndication callback successful'); } @@ -511,7 +511,7 @@ try { // 发送变更通知或指示 gattServer.notifyCharacteristicChanged(device, notifyCharacter, (err: BusinessError) => { if (err) { - console.info('notifyCharacteristicChanged callback failed'); + console.error('notifyCharacteristicChanged callback failed'); } else { console.info('notifyCharacteristicChanged callback successful'); } @@ -694,7 +694,7 @@ export class GattClientManager { // 3. client端连接成功后,需要进行服务发现 public async discoverServices() { if (!this.gattClient) { - console.info(TAG, 'gattClient does not exist'); + console.error(TAG, 'gattClient does not exist'); return; } console.info(TAG, 'discoverServices'); @@ -846,7 +846,7 @@ export class GattClientManager { // 设置特征值变化通知能力,enable: true表示启用,false表示禁用 this.gattClient.setCharacteristicChangeNotification(this.myCharacteristic, enable, (err: BusinessError) => { if (err) { - console.info('setCharacteristicChangeNotification callback failed'); + console.error('setCharacteristicChangeNotification callback failed'); } else { console.info('setCharacteristicChangeNotification callback successful'); } @@ -875,7 +875,7 @@ export class GattClientManager { // 设置特征值变化指示能力,enable: true表示启用,false表示禁用 this.gattClient.setCharacteristicChangeIndication(this.myCharacteristic, enable, (err: BusinessError) => { if (err) { - console.info('setCharacteristicChangeIndication callback failed'); + console.error('setCharacteristicChangeIndication callback failed'); } else { console.info('setCharacteristicChangeIndication callback successful'); } @@ -1152,7 +1152,7 @@ export class GattServerManager { console.info(TAG, 'sendCharacterChange notification'); this.gattServer?.notifyCharacteristicChanged(this.device, notifyCharacter, (err: BusinessError) => { if (err) { - console.info(TAG, 'notifyCharacteristicChanged notification callback failed'); + console.error(TAG, 'notifyCharacteristicChanged notification callback failed'); } else { console.info(TAG, 'notifyCharacteristicChanged notification callback successful'); } @@ -1167,7 +1167,7 @@ export class GattServerManager { console.info(TAG, 'sendCharacterChange indication'); this.gattServer?.notifyCharacteristicChanged(this.device, notifyCharacter, (err: BusinessError) => { if (err) { - console.info(TAG, 'notifyCharacteristicChanged indication callback failed'); + console.error(TAG, 'notifyCharacteristicChanged indication callback failed'); } else { console.info(TAG, 'notifyCharacteristicChanged indication callback successful'); } diff --git a/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-ble.md b/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-ble.md index 2401a44e879..9607566a229 100644 --- a/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-ble.md +++ b/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-ble.md @@ -1586,7 +1586,7 @@ try { let gattServer: ble.GattServer = ble.createGattServer(); gattServer.notifyCharacteristicChanged('XX:XX:XX:XX:XX:XX', notifyCharacter, (err: BusinessError) => { if (err) { - console.info('notifyCharacteristicChanged callback failed'); + console.error('notifyCharacteristicChanged callback failed'); } else { console.info('notifyCharacteristicChanged callback successful'); } @@ -3072,7 +3072,7 @@ try { let device: ble.GattClientDevice = ble.createGattClientDevice('XX:XX:XX:XX:XX:XX'); device.writeDescriptorValue(descriptor, (err: BusinessError) => { if (err) { - console.info('notifyCharacteristicChanged callback failed'); + console.error('notifyCharacteristicChanged callback failed'); } else { console.info('notifyCharacteristicChanged callback successful'); } @@ -3346,7 +3346,7 @@ try { let device: ble.GattClientDevice = ble.createGattClientDevice('XX:XX:XX:XX:XX:XX'); device.setCharacteristicChangeNotification(characteristic, false, (err: BusinessError) => { if (err) { - console.info('notifyCharacteristicChanged callback failed'); + console.error('notifyCharacteristicChanged callback failed'); } else { console.info('notifyCharacteristicChanged callback successful'); } @@ -3487,7 +3487,7 @@ try { let device: ble.GattClientDevice = ble.createGattClientDevice('XX:XX:XX:XX:XX:XX'); device.setCharacteristicChangeIndication(characteristic, false, (err: BusinessError) => { if (err) { - console.info('notifyCharacteristicChanged callback failed'); + console.error('notifyCharacteristicChanged callback failed'); } else { console.info('notifyCharacteristicChanged callback successful'); } diff --git a/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-connection-sys.md b/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-connection-sys.md index da67ce95559..94f6ff12aab 100644 --- a/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-connection-sys.md +++ b/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-connection-sys.md @@ -218,7 +218,7 @@ try { connection.cancelPairedDevice('11:22:33:44:55:66').then(() => { console.info('cancelPairedDevice'); }, (error: BusinessError) => { - console.info('cancelPairedDevice: errCode:' + error.code + ',errMessage' + error.message); + console.error('cancelPairedDevice: errCode:' + error.code + ',errMessage' + error.message); }) } catch (err) { diff --git a/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-connection.md b/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-connection.md index ab93cdc1a1d..f835ff6540b 100644 --- a/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-connection.md +++ b/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-connection.md @@ -176,7 +176,7 @@ try { connection.pairDevice('11:22:33:44:55:66').then(() => { console.info('pairDevice'); }, (error: BusinessError) => { - console.info('pairDevice: errCode:' + error.code + ',errMessage' + error.message); + console.error('pairDevice: errCode:' + error.code + ',errMessage' + error.message); }) } catch (err) { @@ -745,7 +745,7 @@ try { connection.setDevicePinCode('11:22:33:44:55:66', '12345').then(() => { console.info('setDevicePinCode'); }, (error: BusinessError) => { - console.info('setDevicePinCode: errCode:' + error.code + ',errMessage' + error.message); + console.error('setDevicePinCode: errCode:' + error.code + ',errMessage' + error.message); }) } catch (err) { -- Gitee