Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
21fae3ad
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看板
未验证
提交
21fae3ad
编写于
9月 02, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 02, 2023
浏览文件
操作
浏览文件
下载
差异文件
!10021 [XTS] [MASTER] 解决蓝牙流水线问题
Merge pull request !10021 from 权力/myfeature2
上级
8c23485f
cdcc5522
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
183 addition
and
241 deletion
+183
-241
communication/bluetooth_gatt/src/main/js/test/BtBleManager.test.js
...tion/bluetooth_gatt/src/main/js/test/BtBleManager.test.js
+1
-0
communication/bluetooth_gatt/src/main/js/test/BtBleService.test.js
...tion/bluetooth_gatt/src/main/js/test/BtBleService.test.js
+4
-1
communication/bluetooth_gatt/src/main/js/test/BtGattService.test.js
...ion/bluetooth_gatt/src/main/js/test/BtGattService.test.js
+120
-164
communication/bluetooth_gatt/src/main/js/test/BtManagerGattManager.test.js
...etooth_gatt/src/main/js/test/BtManagerGattManager.test.js
+15
-31
communication/bluetooth_gatt/src/main/js/test/BtManagerGattService.test.js
...etooth_gatt/src/main/js/test/BtManagerGattService.test.js
+40
-42
communication/bluetooth_gatt/src/main/js/test/List.test.js
communication/bluetooth_gatt/src/main/js/test/List.test.js
+3
-3
未找到文件。
communication/bluetooth_gatt/src/main/js/test/BtBleManager.test.js
浏览文件 @
21fae3ad
...
@@ -69,6 +69,7 @@ describe('btBleManagerTest', function() {
...
@@ -69,6 +69,7 @@ describe('btBleManagerTest', function() {
afterAll
(
async
function
(
done
)
{
afterAll
(
async
function
(
done
)
{
console
.
info
(
'
afterAll called
'
)
console
.
info
(
'
afterAll called
'
)
gattClient
.
close
();
gattClient
.
close
();
gattServer
.
close
();
done
();
done
();
})
})
...
...
communication/bluetooth_gatt/src/main/js/test/BtBleService.test.js
浏览文件 @
21fae3ad
...
@@ -67,9 +67,12 @@ describe('btBleServiceTest', function() {
...
@@ -67,9 +67,12 @@ describe('btBleServiceTest', function() {
afterEach
(
function
()
{
afterEach
(
function
()
{
console
.
info
(
'
afterEach called
'
)
console
.
info
(
'
afterEach called
'
)
})
})
afterAll
(
function
(
)
{
afterAll
(
async
function
(
done
)
{
console
.
info
(
'
afterAll called
'
)
console
.
info
(
'
afterAll called
'
)
gattServer
.
close
();
gattServer
.
close
();
gattClient
.
close
();
await
sleep
(
3000
);
done
();
})
})
...
...
communication/bluetooth_gatt/src/main/js/test/BtGattService.test.js
浏览文件 @
21fae3ad
此差异已折叠。
点击以展开。
communication/bluetooth_gatt/src/main/js/test/BtManagerGattManager.test.js
浏览文件 @
21fae3ad
...
@@ -51,7 +51,9 @@ describe('btManagerGattManagerTest', function() {
...
@@ -51,7 +51,9 @@ describe('btManagerGattManagerTest', function() {
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll called
'
)
console
.
info
(
'
beforeAll called
'
)
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
console
.
info
(
'
[bluetooth_js]bmgm gattServer create info:
'
+
gattServer
);
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
'
92:3A:C0:3A:4C:28
'
);
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
'
92:3A:C0:3A:4C:28
'
);
console
.
info
(
'
[bluetooth_js]bmgm gattClient create info:
'
+
gattClient
);
})
})
beforeEach
(
async
function
(
done
)
{
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
console
.
info
(
'
beforeEach called
'
)
...
@@ -63,10 +65,10 @@ describe('btManagerGattManagerTest', function() {
...
@@ -63,10 +65,10 @@ describe('btManagerGattManagerTest', function() {
})
})
afterAll
(
async
function
(
done
)
{
afterAll
(
async
function
(
done
)
{
console
.
info
(
'
afterAll called
'
)
console
.
info
(
'
afterAll called
'
)
await
sleep
(
6000
);
await
gattServer
.
close
(
);
gattClient
.
close
(
);
console
.
info
(
'
[bluetooth_js]bmgm gattServer close success
'
);
gattServer
.
close
(
);
await
sleep
(
5000
);
done
()
done
()
;
})
})
/**
/**
...
@@ -212,20 +214,14 @@ describe('btManagerGattManagerTest', function() {
...
@@ -212,20 +214,14 @@ describe('btManagerGattManagerTest', function() {
*/
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_GETDEVICENAME_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BTMANAGER_GETDEVICENAME_0100
'
,
0
,
async
function
(
done
)
{
try
{
try
{
gattClient
.
connect
();
let
deviceName
=
gattClient
.
getDeviceName
().
then
((
data
)
=>
{
await
gattClient
.
getDeviceName
().
then
((
data
)
=>
{
console
.
info
(
'
[bluetooth_js] getDeviceName data info:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
[bluetooth_js] getDeviceName data info:
'
+
JSON
.
stringify
(
data
));
})
})
expect
(
true
).
assertEqual
(
deviceName
!=
null
);
done
();
done
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]GetDeviceName_0100 failed, code is
${
error
.
code
}
,message is
${
error
.
message
}
`
);
console
.
error
(
`[bluetooth_js]GetDeviceName_0100 failed, code is
${
error
.
code
}
,message is
${
error
.
message
}
`
);
if
(
error
.
code
==
'
2900099
'
)
{
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
}
else
{
expect
(
error
.
code
).
assertEqual
(
2900099
);
}
}
}
gattClient
.
disconnect
();
done
();
done
();
})
})
...
@@ -238,7 +234,6 @@ describe('btManagerGattManagerTest', function() {
...
@@ -238,7 +234,6 @@ describe('btManagerGattManagerTest', function() {
*/
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_GETDEVICENAME_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BTMANAGER_GETDEVICENAME_0200
'
,
0
,
async
function
(
done
)
{
try
{
try
{
gattClient
.
connect
();
gattClient
.
getDeviceName
((
err
,
data
)
=>
{
gattClient
.
getDeviceName
((
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
getname1 failed
'
);
console
.
error
(
'
getname1 failed
'
);
...
@@ -261,19 +256,12 @@ describe('btManagerGattManagerTest', function() {
...
@@ -261,19 +256,12 @@ describe('btManagerGattManagerTest', function() {
*/
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_GETSERVICE_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BTMANAGER_GETSERVICE_0100
'
,
0
,
async
function
(
done
)
{
try
{
try
{
gattClient
.
connect
();
let
services
=
gattClient
.
getServices
().
then
(
result
=>
{
gattClient
.
getServices
().
then
(
result
=>
{
console
.
info
(
"
getServices successfully:
"
+
JSON
.
stringify
(
result
));
console
.
info
(
"
getServices successfully:
"
+
JSON
.
stringify
(
result
));
done
(
);
expect
(
true
).
assertEqual
(
services
!=
null
);
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]GetService_0100 failed, code is
${
error
.
code
}
,message is
${
error
.
message
}
`
);
console
.
error
(
`[bluetooth_js]GetService_0100 failed, code is
${
error
.
code
}
,message is
${
error
.
message
}
`
);
// expect(true).assertEqual(error.code == '2900099' || error.code == 2900099);
if
(
error
.
code
==
'
2900099
'
)
{
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
}
else
{
expect
(
error
.
code
).
assertEqual
(
2900099
);
}
}
}
done
();
done
();
})
})
...
@@ -287,7 +275,7 @@ describe('btManagerGattManagerTest', function() {
...
@@ -287,7 +275,7 @@ describe('btManagerGattManagerTest', function() {
*/
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_GETSERVICE_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BTMANAGER_GETSERVICE_0200
'
,
0
,
async
function
(
done
)
{
try
{
try
{
gattClient
.
connect
();
//
gattClient.connect();
gattClient
.
getServices
((
code
,
data
)
=>
{
gattClient
.
getServices
((
code
,
data
)
=>
{
if
(
code
.
code
==
0
)
{
if
(
code
.
code
==
0
)
{
console
.
info
(
"
bluetooth services size is
"
,
data
.
length
);
console
.
info
(
"
bluetooth services size is
"
,
data
.
length
);
...
@@ -912,19 +900,15 @@ describe('btManagerGattManagerTest', function() {
...
@@ -912,19 +900,15 @@ describe('btManagerGattManagerTest', function() {
*/
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_GATTCLOSE_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BTMANAGER_GATTCLOSE_0100
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
gattClients
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
11:22:33:44:55:66
"
);
await
gattClient
.
close
();
gattClients
.
close
();
console
.
info
(
'
[bluetooth_js]bmgm gattClient close success
'
);
done
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]GattClose_0100 failed, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]GattClose_0100 failed, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
true
).
assertFalse
();
expect
(
true
).
assertFalse
();
done
()
}
}
done
();
})
})
})
})
}
}
\ No newline at end of file
communication/bluetooth_gatt/src/main/js/test/BtManagerGattService.test.js
浏览文件 @
21fae3ad
...
@@ -16,14 +16,11 @@
...
@@ -16,14 +16,11 @@
import
bluetooth
from
'
@ohos.bluetoothManager
'
;
import
bluetooth
from
'
@ohos.bluetoothManager
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
let
SppOption
=
{
uuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
secure
:
true
,
type
:
bluetooth
.
SppType
.
SPP_RFCOMM
};
export
default
function
btManagerGattServiceTest
()
{
export
default
function
btManagerGattServiceTest
()
{
describe
(
'
btManagerGattServiceTest
'
,
function
()
{
describe
(
'
btManagerGattServiceTest
'
,
function
()
{
let
gattServer
=
null
;
let
gattServer
=
null
;
let
gattClient
=
null
;
function
sleep
(
delay
)
{
function
sleep
(
delay
)
{
return
new
Promise
(
resovle
=>
setTimeout
(
resovle
,
delay
))
return
new
Promise
(
resovle
=>
setTimeout
(
resovle
,
delay
))
}
}
...
@@ -56,7 +53,7 @@ describe('btManagerGattServiceTest', function() {
...
@@ -56,7 +53,7 @@ describe('btManagerGattServiceTest', function() {
console
.
info
(
'
beforeAll called
'
)
console
.
info
(
'
beforeAll called
'
)
await
tryToEnableBt
()
await
tryToEnableBt
()
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
11:22:33:44:55:66
"
);
console
.
info
(
'
[bluetooth_js]bmgs gattServer create info:
'
+
gattServer
);
done
()
done
()
})
})
beforeEach
(
async
function
(
done
)
{
beforeEach
(
async
function
(
done
)
{
...
@@ -67,9 +64,12 @@ describe('btManagerGattServiceTest', function() {
...
@@ -67,9 +64,12 @@ describe('btManagerGattServiceTest', function() {
afterEach
(
function
()
{
afterEach
(
function
()
{
console
.
info
(
'
afterEach called
'
)
console
.
info
(
'
afterEach called
'
)
})
})
afterAll
(
function
(
)
{
afterAll
(
async
function
(
done
)
{
console
.
info
(
'
afterAll called
'
)
console
.
info
(
'
afterAll called
'
)
gattServer
.
close
();
await
gattServer
.
close
();
console
.
info
(
'
[bluetooth_js]bmgs gattServer close success
'
);
await
sleep
(
5000
);
done
();
})
})
...
@@ -89,10 +89,9 @@ describe('btManagerGattServiceTest', function() {
...
@@ -89,10 +89,9 @@ describe('btManagerGattServiceTest', function() {
+
'
deviceId:
'
+
deviceId
+
'
status:
'
+
status
);
+
'
deviceId:
'
+
deviceId
+
'
status:
'
+
status
);
expect
(
true
).
assertEqual
(
BLEConnectChangedState
!=
null
);
expect
(
true
).
assertEqual
(
BLEConnectChangedState
!=
null
);
}
}
await
gattServer
.
on
(
"
connectStateChange
"
,
Connected
);
gattServer
.
on
(
"
connectStateChange
"
,
Connected
);
gattClient
.
connect
();
await
sleep
(
1000
);
await
sleep
(
2000
);
gattServer
.
off
(
"
connectStateChange
"
);
await
gattServer
.
off
(
"
connectStateChange
"
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]Connect_0100 failed, code is
${
error
.
code
}
,message is
${
error
.
message
}
`
);
console
.
error
(
`[bluetooth_js]Connect_0100 failed, code is
${
error
.
code
}
,message is
${
error
.
message
}
`
);
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
...
@@ -123,7 +122,6 @@ describe('btManagerGattServiceTest', function() {
...
@@ -123,7 +122,6 @@ describe('btManagerGattServiceTest', function() {
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
done
()
done
()
}
}
})
})
/**
/**
...
@@ -161,7 +159,7 @@ describe('btManagerGattServiceTest', function() {
...
@@ -161,7 +159,7 @@ describe('btManagerGattServiceTest', function() {
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]AddService2 failed, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]AddService2 failed, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
true
).
assertFalse
();
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
done
()
done
()
}
}
})
})
...
@@ -205,7 +203,7 @@ describe('btManagerGattServiceTest', function() {
...
@@ -205,7 +203,7 @@ describe('btManagerGattServiceTest', function() {
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]AddService3 failed, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]AddService3 failed, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
true
).
assertFalse
();
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
done
()
done
()
}
}
...
@@ -280,7 +278,7 @@ describe('btManagerGattServiceTest', function() {
...
@@ -280,7 +278,7 @@ describe('btManagerGattServiceTest', function() {
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]AddService5 failed, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]AddService5 failed, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
true
).
assertFalse
();
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
done
()
done
()
}
}
...
@@ -327,7 +325,7 @@ describe('btManagerGattServiceTest', function() {
...
@@ -327,7 +325,7 @@ describe('btManagerGattServiceTest', function() {
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]AddService6 failed, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]AddService6 failed, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
true
).
assertFalse
();
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
done
()
done
()
}
}
})
})
...
@@ -367,7 +365,7 @@ describe('btManagerGattServiceTest', function() {
...
@@ -367,7 +365,7 @@ describe('btManagerGattServiceTest', function() {
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]AddService7 failed, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]AddService7 failed, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
true
).
assertFalse
();
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
done
()
done
()
}
}
...
@@ -408,7 +406,7 @@ describe('btManagerGattServiceTest', function() {
...
@@ -408,7 +406,7 @@ describe('btManagerGattServiceTest', function() {
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]AddService8 failed, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]AddService8 failed, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
true
).
assertFalse
();
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
done
()
done
()
}
}
...
@@ -818,37 +816,37 @@ describe('btManagerGattServiceTest', function() {
...
@@ -818,37 +816,37 @@ describe('btManagerGattServiceTest', function() {
* @tc.level Level 3
* @tc.level Level 3
*/
*/
it
(
'
SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0100
'
,
0
,
async
function
(
done
)
{
let
descriptors
=
[];
let
arrayBuffer
=
new
ArrayBuffer
(
8
);
let
descV
=
new
Uint8Array
(
arrayBuffer
);
descV
[
0
]
=
11
;
let
descriptor
=
{
serviceUuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
characteristicUuid
:
'
00001820-0000-1000-8000-00805F9B34FB
'
,
descriptorUuid
:
'
00002902-0000-1000-8000-00805F9B34FB
'
,
descriptorValue
:
arrayBuffer
};
descriptors
[
0
]
=
descriptor
;
let
characteristics
=
[];
let
arrayBufferC
=
new
ArrayBuffer
(
8
);
let
cccV
=
new
Uint8Array
(
arrayBufferC
);
cccV
[
0
]
=
1
;
let
characteristic
=
{
serviceUuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
characteristicUuid
:
'
00001820-0000-1000-8000-00805F9B34FB
'
,
characteristicValue
:
arrayBufferC
,
descriptors
:
descriptors
};
characteristics
[
0
]
=
characteristic
;
let
gattService
=
{
serviceUuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
isPrimary
:
true
,
characteristics
:
characteristics
,
includeServices
:[]};
let
gattService1
=
{
serviceUuid
:
'
00001888-0000-1000-8000-00805f9b34fb
'
,
isPrimary
:
false
,
characteristics
:
characteristics
,
includeServices
:[]};
gattServer
.
addService
(
gattService
);
await
sleep
(
1000
);
gattServer
.
addService
(
gattService1
);
try
{
try
{
let
descriptors
=
[];
let
arrayBuffer
=
new
ArrayBuffer
(
8
);
let
descV
=
new
Uint8Array
(
arrayBuffer
);
descV
[
0
]
=
11
;
let
descriptor
=
{
serviceUuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
characteristicUuid
:
'
00001820-0000-1000-8000-00805F9B34FB
'
,
descriptorUuid
:
'
00002902-0000-1000-8000-00805F9B34FB
'
,
descriptorValue
:
arrayBuffer
};
descriptors
[
0
]
=
descriptor
;
let
characteristics
=
[];
let
arrayBufferC
=
new
ArrayBuffer
(
8
);
let
cccV
=
new
Uint8Array
(
arrayBufferC
);
cccV
[
0
]
=
1
;
let
characteristic
=
{
serviceUuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
characteristicUuid
:
'
00001820-0000-1000-8000-00805F9B34FB
'
,
characteristicValue
:
arrayBufferC
,
descriptors
:
descriptors
};
characteristics
[
0
]
=
characteristic
;
let
gattService
=
{
serviceUuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
isPrimary
:
true
,
characteristics
:
characteristics
,
includeServices
:[]};
let
gattService1
=
{
serviceUuid
:
'
00001888-0000-1000-8000-00805f9b34fb
'
,
isPrimary
:
false
,
characteristics
:
characteristics
,
includeServices
:[]};
gattServer
.
addService
(
gattService
);
await
sleep
(
1000
);
gattServer
.
addService
(
gattService1
);
await
sleep
(
1000
);
await
sleep
(
1000
);
gattServer
.
removeService
(
'
00001810-0000-1000-8000-00805F9B34FB
'
);
gattServer
.
removeService
(
'
00001810-0000-1000-8000-00805F9B34FB
'
);
done
();
done
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]removeService1 failed, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]removeService1 failed, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
true
).
assertFalse
(
);
expect
(
error
.
code
).
assertEqual
(
'
401
'
);
done
()
done
()
}
}
...
...
communication/bluetooth_gatt/src/main/js/test/List.test.js
浏览文件 @
21fae3ad
...
@@ -22,12 +22,12 @@ import btManagerGattServiceTest from './BtManagerGattService.test.js'
...
@@ -22,12 +22,12 @@ import btManagerGattServiceTest from './BtManagerGattService.test.js'
import
btBleManagerTest
from
'
./BtBleManager.test.js
'
import
btBleManagerTest
from
'
./BtBleManager.test.js
'
import
btBleServiceTest
from
'
./BtBleService.test.js
'
import
btBleServiceTest
from
'
./BtBleService.test.js
'
export
default
function
testsuite
()
{
export
default
function
testsuite
()
{
btManagerGattServiceTest
()
btBleManagerTest
()
btBleManagerTest
()
btBleServiceTest
()
btBleServiceTest
()
btManagerGattManagerTest
()
btManagerGattServiceTest
()
btGattServiceTest
()
btGattManagerTest
()
btGattManagerTest
()
btGattServiceTest
()
btManagerGattAdvertTest
()
btManagerGattAdvertTest
()
btGattAdvertTest
()
btGattAdvertTest
()
btManagerGattManagerTest
()
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录