Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
be2a322f
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看板
提交
be2a322f
编写于
11月 17, 2022
作者:
Q
quanli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
quanli1@huawei.com
Signed-off-by:
N
quanli
<
quanli1@huawei.com
>
上级
2b9db8e1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
36 deletion
+15
-36
communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js
...tion/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js
+1
-21
communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js
...ion/bluetooth_ble/src/main/js/test/BleGattManager.test.js
+12
-13
communication/bluetooth_on/src/main/js/test/BleScanResult.test.js
...ation/bluetooth_on/src/main/js/test/BleScanResult.test.js
+2
-2
未找到文件。
communication/bluetooth_ble/src/main/js/test/BleAdvertiser.test.js
浏览文件 @
be2a322f
...
...
@@ -21,7 +21,6 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
export
default
function
bluetoothBLETest2
()
{
describe
(
'
bluetoothBLETest2
'
,
function
()
{
let
gattServer
=
null
;
let
gattClient
=
null
;
function
sleep
(
delay
)
{
return
new
Promise
(
resovle
=>
setTimeout
(
resovle
,
delay
))
}
...
...
@@ -53,7 +52,6 @@ describe('bluetoothBLETest2', function() {
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll called
'
)
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
00:00:00:00:00:00
"
);
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
...
...
@@ -79,7 +77,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0100
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -136,7 +133,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0200
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -192,8 +188,7 @@ describe('bluetoothBLETest2', function() {
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0300
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0300
'
,
0
,
async
function
(
done
)
{
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -250,7 +245,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0400
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -307,7 +301,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0500
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -364,7 +357,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0800
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -421,7 +413,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_0900
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -478,7 +469,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1000
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -535,7 +525,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1100
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -592,7 +581,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1200
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -649,7 +637,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1400
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -706,7 +693,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1500
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -763,7 +749,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 1
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1600
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -820,7 +805,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1800
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -877,7 +861,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_1900
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -929,7 +912,6 @@ describe('bluetoothBLETest2', function() {
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_AdvertiseData_2100
'
,
0
,
async
function
(
done
)
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
manufactureValueBuffer
=
new
Uint8Array
(
4
);
manufactureValueBuffer
[
0
]
=
1
;
manufactureValueBuffer
[
1
]
=
2
;
...
...
@@ -982,7 +964,6 @@ describe('bluetoothBLETest2', function() {
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_StartAdvertise_0400
'
,
0
,
function
()
{
let
isRet
=
true
;
try
{
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
gattServer
.
stopAdvertising
();
expect
(
isRet
).
assertTrue
();
}
catch
(
error
){
...
...
@@ -995,4 +976,3 @@ describe('bluetoothBLETest2', function() {
})
}
communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js
浏览文件 @
be2a322f
...
...
@@ -18,7 +18,6 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
export
default
function
bluetoothBLETest
()
{
describe
(
'
bluetoothBLETest
'
,
function
()
{
let
gattServer
=
null
;
let
gattClient
=
null
;
function
sleep
(
delay
)
{
...
...
@@ -64,7 +63,7 @@ describe('bluetoothBLETest', function() {
})
afterAll
(
function
()
{
console
.
info
(
'
afterAll called
'
)
gatt
Server
.
close
();
gatt
Client
.
close
();
})
/**
...
...
@@ -539,7 +538,7 @@ describe('bluetoothBLETest', function() {
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_ReadDescriptor_0300
'
,
0
,
async
function
(
done
)
{
let
arrayBufferCCC
=
new
ArrayBuffer
(
8
);
let
cccValue
=
new
Uint8Array
(
arrayBufferCCC
);
cccValue
[
0
]
=
1011
;
...
...
@@ -685,7 +684,7 @@ describe('bluetoothBLETest', function() {
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_WriteDescriptor_0300
'
,
0
,
async
function
(
done
)
{
let
arrayBufferDesc
=
new
ArrayBuffer
(
8
);
let
descValue
=
new
Uint8Array
(
arrayBufferDesc
);
function
WriteDescriptorReq
(
DescriptorWriteReq
)
{
...
...
@@ -696,7 +695,6 @@ describe('bluetoothBLETest', function() {
let
needRsp
=
DescriptorWriteReq
.
needRsp
;
let
value
=
new
Uint8Array
(
DescriptorWriteReq
.
value
);
let
descriptorUuid
=
DescriptorWriteReq
.
descriptorUuid
;
descValue
[
0
]
=
value
[
0
];
let
serverResponse
=
{
deviceId
:
deviceId
,
transId
:
transId
,
status
:
0
,
offset
:
offset
,
value
:
arrayBufferDesc
};
...
...
@@ -720,7 +718,7 @@ describe('bluetoothBLETest', function() {
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_NotifyCharacteristic_0100
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_
Set
NotifyCharacteristic_0100
* @tc.name testSetNotifyCharacteristicChanged
* @tc.desc Test SetNotifyCharacteristicChanged api.
* @tc.size MEDIUM
...
...
@@ -756,7 +754,7 @@ describe('bluetoothBLETest', function() {
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_NotifyCharacteristic_0200
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_
Set
NotifyCharacteristic_0200
* @tc.name testSetNotifyCharacteristicChanged
* @tc.desc Test SetNotifyCharacteristicChanged api.
* @tc.size MEDIUM
...
...
@@ -792,7 +790,7 @@ describe('bluetoothBLETest', function() {
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_NotifyCharacteristic_0300
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_
Set
NotifyCharacteristic_0300
* @tc.name testSetNotifyCharacteristicChanged
* @tc.desc Test SetNotifyCharacteristicChanged api.
* @tc.size MEDIUM
...
...
@@ -807,7 +805,7 @@ describe('bluetoothBLETest', function() {
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_NotifyCharacteristic_0400
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_
Set
NotifyCharacteristic_0400
* @tc.name test BLECharacteristicChangeON
* @tc.desc Test On and off api.
* @tc.size MEDIUM
...
...
@@ -850,12 +848,12 @@ describe('bluetoothBLETest', function() {
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_
NotifyCharacteristic_03
00
* @tc.name test
SetNotifyCharacteristicChanged
* @tc.desc Test
SetNotifyCharacteristicChanged
api.
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_
GattClose_01
00
* @tc.name test
gattClient close
* @tc.desc Test
close
api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level
2
* @tc.level Level
3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_GattClose_0100
'
,
0
,
async
function
(
done
)
{
let
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
11:22:33:44:55:66
"
);
...
...
@@ -868,3 +866,4 @@ describe('bluetoothBLETest', function() {
})
}
communication/bluetooth_on/src/main/js/test/BleScanResult.test.js
浏览文件 @
be2a322f
...
...
@@ -584,7 +584,7 @@ describe('bluetoothhostTest', function() {
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_
Connect_01
00
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_
Scan_18
00
* @tc.name test gatt connect and disconnect
* @tc.desc Test connect and disconnect api .
* @tc.size MEDIUM
...
...
@@ -592,7 +592,7 @@ describe('bluetoothhostTest', function() {
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_
Connect_01
00
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_
Scan_18
00
'
,
0
,
async
function
(
done
)
{
async
function
onReceiveEvent
(
ScanResult
)
{
console
.
info
(
'
[bluetooth_js] BLEscan device result12
'
+
JSON
.
stringify
(
ScanResult
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录