Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9f6d4c01
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9f6d4c01
编写于
7月 29, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 29, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9593 【XTS】【communication】BT蓝牙接口覆盖新增,NFC修改
Merge pull request !9593 from 权力/myfeature3
上级
570989a5
29ad4b91
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
74 addition
and
3 deletion
+74
-3
communication/BUILD.gn
communication/BUILD.gn
+1
-0
communication/bluetooth_gatt/src/main/js/test/BtManagerGattAdvertiser.test.js
...oth_gatt/src/main/js/test/BtManagerGattAdvertiser.test.js
+1
-0
communication/bluetooth_gatt/src/main/js/test/BtManagerGattManager.test.js
...etooth_gatt/src/main/js/test/BtManagerGattManager.test.js
+8
-0
communication/bluetooth_gatt/src/main/js/test/BtManagerGattService.test.js
...etooth_gatt/src/main/js/test/BtManagerGattService.test.js
+1
-1
communication/bluetooth_scanpairing/src/main/js/test/BtManagerPair.test.js
...etooth_scanpairing/src/main/js/test/BtManagerPair.test.js
+63
-2
未找到文件。
communication/BUILD.gn
浏览文件 @
9f6d4c01
...
...
@@ -27,6 +27,7 @@ group("communication") {
"dsoftbus/rpc_request:ActsRpcRequestJsTest",
"nfc_Controller:ActsNFCJSTest",
"nfc_ErrorCode:ActsNFCErrorJSTest",
"nfc_SecureElement:ActsnfcSEServiceTest",
"wifi_ErrorCode201:ActsErrorcode201Test",
"wifi_ErrorCode202:ActsErrorcode202Test",
"wifi_ErrorCode401:ActsErrorcode401Test",
...
...
communication/bluetooth_gatt/src/main/js/test/BtManagerGattAdvertiser.test.js
浏览文件 @
9f6d4c01
...
...
@@ -102,6 +102,7 @@ describe('btManagerGattAdvertTest', function() {
serviceUuid
:
"
00001888-0000-1000-8000-00805f9b34fb
"
,
serviceValue
:
serviceValueBuffer
.
buffer
}],
includeDeviceName
:
false
,
}
let
advResponse
=
{
serviceUuids
:[
"
00001889-0000-1000-8000-00805f9b34fb
"
],
...
...
communication/bluetooth_gatt/src/main/js/test/BtManagerGattManager.test.js
浏览文件 @
9f6d4c01
...
...
@@ -475,6 +475,14 @@ describe('btManagerGattManagerTest', function() {
console
.
log
(
'
bluetooth characteristic characteristicUuid:
'
+
BLECharacteristic
.
characteristicUuid
);
console
.
log
(
'
bluetooth characteristic characteristicValue:
'
+
BLECharacteristic
.
characteristicValue
);
console
.
log
(
'
bluetooth characteristic descriptors:
'
+
BLECharacteristic
.
descriptors
);
console
.
log
(
'
bluetooth characteristic properties:
'
+
BLECharacteristic
.
properties
);
console
.
log
(
'
bluetooth BLECharacteristic write:
'
+
BLECharacteristic
.
properties
.
write
);
console
.
log
(
'
bluetooth BLECharacteristic writeNoResponse:
'
+
BLECharacteristic
.
properties
.
writeNoResponse
);
console
.
log
(
'
bluetooth BLECharacteristic read:
'
+
BLECharacteristic
.
properties
.
read
);
console
.
log
(
'
bluetooth BLECharacteristic notify:
'
+
BLECharacteristic
.
properties
.
notify
);
console
.
log
(
'
bluetooth BLECharacteristic indicate:
'
+
BLECharacteristic
.
properties
.
indicate
);
let
value
=
new
Uint8Array
(
BLECharacteristic
.
characteristicValue
);
console
.
log
(
'
bluetooth characteristic value:
'
+
value
[
0
]
+
'
,
'
+
value
[
1
]
+
'
,
'
+
value
[
2
]
+
'
,
'
+
value
[
3
]);
...
...
communication/bluetooth_gatt/src/main/js/test/BtManagerGattService.test.js
浏览文件 @
9f6d4c01
...
...
@@ -56,7 +56,7 @@ describe('btManagerGattServiceTest', function() {
console
.
info
(
'
beforeAll called
'
)
await
tryToEnableBt
()
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
11:22:33:44:55:66
"
);
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
92:3A:C0:3A:4C:28
"
);
done
()
})
beforeEach
(
async
function
(
done
)
{
...
...
communication/bluetooth_scanpairing/src/main/js/test/BtManagerPair.test.js
浏览文件 @
9f6d4c01
...
...
@@ -67,8 +67,6 @@ describe('btManagerPairTest', function() {
* @tc.number SUB_COMMUNICATION_BTMANAGER_PAIR_0100
* @tc.name Test pinRequired and setDevicePairing true
* @tc.desc Test pinRequired off api
* @tc.size MEDIUM
* @ since 8
* @tc.type Function
* @tc.level Level 3
*/
...
...
@@ -85,5 +83,68 @@ describe('btManagerPairTest', function() {
}
done
();
})
/**
* @tc.number SUB_COMMUNICATION_BTMANAGER_PAIR_0200
* @tc.name Test setDevicePinCode callback
* @tc.desc Test setDevicePinCode api10
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_PAIR_0200
'
,
0
,
async
function
(
done
)
{
try
{
bluetoothManager
.
setDevicePinCode
(
'
11:22:33:44:55:66
'
,
'
12345
'
,
(
err
,
data
)
=>
{
console
.
info
(
'
setDevicePinCode callback,device name err:
'
+
JSON
.
stringify
(
err
)
+
'
,device name:
'
+
JSON
.
stringify
(
data
));
});
}
catch
(
err
)
{
console
.
error
(
"
setDevicePinCode callback errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
2900099
'
);
}
done
();
})
/**
* @tc.number SUB_COMMUNICATION_BTMANAGER_PAIR_0300
* @tc.name Test setDevicePinCode promise
* @tc.desc Test setDevicePinCode api10
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_PAIR_0300
'
,
0
,
async
function
(
done
)
{
try
{
bluetoothManager
.
setDevicePinCode
(
'
11:22:33:44:55:66
'
,
'
12345
'
).
then
(()
=>
{
console
.
info
(
'
setDevicePinCode promise
'
);
},
error
=>
{
console
.
info
(
'
setDevicePinCode promise: errCode:
'
+
error
.
code
+
'
,errMessage
'
+
error
.
message
);
})
}
catch
(
err
)
{
console
.
error
(
"
setDevicePinCode promise errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
2900099
'
);
}
done
();
})
/**
* @tc.number SUB_COMMUNICATION_BTMANAGER_PAIR_0400
* @tc.name Test BluetoothTransport
* @tc.desc Test BluetoothTransport api10
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_PAIR_0400
'
,
0
,
async
function
(
done
)
{
try
{
let
TRANSPORT_BR_EDR
=
bluetoothManager
.
BluetoothTransport
.
TRANSPORT_BR_EDR
;
console
.
info
(
"
[bluetooth_js]TRANSPORT_BR_EDR :
"
+
JSON
.
stringify
(
TRANSPORT_BR_EDR
));
expect
(
true
).
assertTrue
(
TRANSPORT_BR_EDR
==
0
);
let
TRANSPORT_LE
=
bluetoothManager
.
BluetoothTransport
.
TRANSPORT_LE
;
console
.
info
(
"
[bluetooth_js]TRANSPORT_LE :
"
+
JSON
.
stringify
(
TRANSPORT_LE
));
expect
(
true
).
assertTrue
(
TRANSPORT_LE
==
1
);
}
catch
(
err
)
{
console
.
error
(
"
BluetoothTransport errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
done
();
})
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录