BtManagerGattService.test.js 80.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * Copyright (C) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import bluetooth from '@ohos.bluetoothManager';
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};

Q
quanli 已提交
22 23
export default function btManagerGattServiceTest() {
describe('btManagerGattServiceTest', function() {
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76

    let gattServer = null;
    let gattClient = null;
    function sleep(delay) {
        return new Promise(resovle => setTimeout(resovle, delay))
    }

    async function tryToEnableBt() {
        let sta = bluetooth.getState();
        switch(sta){
            case 0:
                console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta));
                bluetooth.enableBluetooth();
                await sleep(10000);
                break;
            case 1:
                console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta));
                await sleep(3000);
                break;
            case 2:
                console.info('[bluetooth_js] bt turn on:'+ JSON.stringify(sta));
                break;
            case 3:
                console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta));
                bluetooth.enableBluetooth();
                await sleep(10000);
                break;
            default:
                console.info('[bluetooth_js] enable success');
        }
    }
    beforeAll(async function (done) {
        console.info('beforeAll called')
        await tryToEnableBt()
        gattServer = bluetooth.BLE.createGattServer();
        gattClient = bluetooth.BLE.createGattClientDevice("11:22:33:44:55:66");
        done()
    })
    beforeEach(async function(done) {
        console.info('beforeEach called')
        await tryToEnableBt()
        done()
    })
    afterEach(function () {
        console.info('afterEach called')
    })
    afterAll(function () {
        console.info('afterAll called')
        gattServer.close();
    })


    /**
Q
quanli 已提交
77
     * @tc.number SUB_COMMUNICATION_BTMANAGER_GATTSERCONNECT_0100
78 79 80 81 82
     * @tc.name test Server connectStateChange
     * @tc.desc Test on and off api .
     * @tc.type Function
     * @tc.level Level 2
     */
Q
quanli 已提交
83
    it('SUB_COMMUNICATION_BTMANAGER_GATTSERCONNECT_0100', 0, async function (done) {
84 85 86 87 88 89 90 91 92 93 94 95 96
        try {
            function Connected(BLEConnectChangedState) {
                let deviceId = BLEConnectChangedState.deviceId;
                let status = BLEConnectChangedState.state;
                console.info("[bluetooth_js] connectStateChange jsondata:"
                 +'deviceId:' + deviceId + 'status:' + status);
                expect(true).assertEqual(BLEConnectChangedState !=null);
              }
            await gattServer.on("connectStateChange", Connected);
            gattClient.connect();
            await sleep(2000);
            await gattServer.off("connectStateChange");
        } catch (error) {
Q
quanli 已提交
97 98
            console.error(`[bluetooth_js]Connect_0100 failed, code is ${error.code},message is ${error.message}`);
              expect(error.code).assertEqual('2900099');
99
        }
Q
quanli 已提交
100
        done();
101 102 103
    })

    /**
Q
quanli 已提交
104
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0100
105 106 107 108 109
     * @tc.name testAddService
     * @tc.desc Test api 401 - characteristics of service is null.
     * @tc.type Function
     * @tc.level Level 2
     */
Q
quanli 已提交
110
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0100', 0, async function (done) { 
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
        try {
            let service = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB',
            isPrimary: true, includeServices: []};
            gattServer.addService(service);
            await sleep(1000);
            expect(true).assertFalse();
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error('[bluetooth_js]AddService1 failed, error.code:'+JSON.stringify(error.code)
            +'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');  
            done()
        }
        
    })

    /**
Q
quanli 已提交
130
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0200
131 132 133 134 135
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
136
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0200', 0, async function (done) {
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
        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:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error(`[bluetooth_js]AddService2 failed, code is ${error.code},
                  message is ${error.message}`);
            expect(true).assertFalse();
            done()
        }       
    })

    /**
Q
quanli 已提交
170
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0300
171 172 173 174 175
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
176
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0300', 0, async function (done) {
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
        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};
            let characteristicN = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB',
            characteristicUuid: '00001821-0000-1000-8000-00805F9B34FB', 
            characteristicValue: arrayBufferC, descriptors:descriptors};
            characteristics[0] = characteristic;
            characteristics[1] = characteristicN;
            let gattService = {serviceUuid:'00001810-0000-1000-8000-00805F9B34FB', isPrimary: true,
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error(`[bluetooth_js]AddService3 failed, code is ${error.code},
            message is ${error.message}`);
            expect(true).assertFalse();
            done()
        }
       
    })

    /**
Q
quanli 已提交
215
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0400
216 217 218 219 220
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
221
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0400', 0, async function (done) {
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
        try {
            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};
            characteristics[0] = characteristic;
            let gattService = {serviceUuid:'00001810-0000-1000-8000-00805F9B34FB', isPrimary: true,
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            expect(true).assertFalse();
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error('[bluetooth_js]AddService4 failed, error.code:'+JSON.stringify(error.code)
            +'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }
       
    })
 
    /**
Q
quanli 已提交
249
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0500
250 251 252 253 254
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 2
     */
Q
quanli 已提交
255
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0500', 0, async function (done) {
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
        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:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error(`[bluetooth_js]AddService5 failed, code is ${error.code},
            message is ${error.message}`);
            expect(true).assertFalse();
            done()
        }
       
    })

    /**
Q
quanli 已提交
290
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0600
291 292 293 294 295
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
296
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0600', 0, async function (done) {
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
        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};
            
            let descriptor1 = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB',
            characteristicUuid: '00001821-0000-1000-8000-00805F9B34FB',
            descriptorUuid: '00001830-0000-1000-8000-00805F9B34FB', descriptorValue: arrayBuffer};
    
            descriptors[0] = descriptor;
            descriptors[1] = descriptor1;
            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:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error(`[bluetooth_js]AddService6 failed, code is ${error.code},
            message is ${error.message}`);
            expect(true).assertFalse();
            done()
        }      
    })

    /**
Q
quanli 已提交
336
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0700
337 338 339 340 341
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
342
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0700', 0, async function (done) {
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
        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:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error(`[bluetooth_js]AddService7 failed, code is ${error.code},
            message is ${error.message}`);
            expect(true).assertFalse();
            done()
        }
        
    })

    /**
Q
quanli 已提交
377
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0800
378 379 380 381 382
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
383
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0800', 0, async function (done) {
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
        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: false,
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error(`[bluetooth_js]AddService8 failed, code is ${error.code},
            message is ${error.message}`);
            expect(true).assertFalse();
            done()
        }
        
    })

    /**
Q
quanli 已提交
418
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0900
419 420 421 422 423
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
424
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_0900', 0, async function (done) {
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459
        try {
            let descriptors = [];
            let arrayBuffer = new ArrayBuffer(8);
            let descV = new Uint8Array(arrayBuffer);
            descV[0] = 11;
            let descriptor = {serviceUuid: '',
            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: '',
            characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', 
            characteristicValue: arrayBufferC, descriptors:descriptors};
            characteristics[0] = characteristic;
            let gattService = {serviceUuid:'', isPrimary: true,
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            expect(true).assertFalse();
            await sleep(1000);
            gattServer.removeService('');
            await sleep(1000);
            done();
        } catch (error) {
            console.error('[bluetooth_js]AddService9 failed, error.code:'+JSON.stringify(error.code)
            +'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }
        
    })

    /**
Q
quanli 已提交
460
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1000
461 462 463 464 465
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
466
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1000', 0, async function (done) {
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
        try {
            let descriptors = [];
            let arrayBuffer = new ArrayBuffer(8);
            let descV = new Uint8Array(arrayBuffer);
            descV[0] = 11;
            let descriptor = {serviceUuid: '123@ad',
            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: '123@ad',
            characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', 
            characteristicValue: arrayBufferC, descriptors:descriptors};
            characteristics[0] = characteristic;
            let gattService = {serviceUuid:'123@ad', isPrimary: true,
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            expect(true).assertFalse();
            gattServer.removeService('123@ad');
            await sleep(1000);
            done();
        } catch (error) {
            console.error('[bluetooth_js]AddService10 failed, error.code:'+JSON.stringify(error.code)
            +'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }
        
    })

    /**
Q
quanli 已提交
502
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1100
503 504 505 506 507
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
508
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1100', 0, async function (done) {
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
        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', descriptors:descriptors};
            characteristics[0] = characteristic;
            let gattService = {serviceUuid:'00001810-0000-1000-8000-00805F9B34FB', isPrimary: true,
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            expect(true).assertFalse();
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            done();
        } catch (error) {
            console.error('[bluetooth_js]AddService11 failed, error.code:'+JSON.stringify(error.code)
            +'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }
        
    })

    /**
Q
quanli 已提交
542
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1200
543 544 545 546 547
     * @tc.name testAddService
     * @tc.desc Test AddService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
548
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_1200', 0, async function (done) {
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582
        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'};
            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:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            expect(true).assertFalse();
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            done();
        } catch (error) {
            console.error('[bluetooth_js]AddService12 failed, error.code:'+JSON.stringify(error.code)
            +'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }
       
    })

    /**
Q
quanli 已提交
583
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2000
584 585 586 587 588
     * @tc.name testAddService
     * @tc.desc Test api 401 - null gattService parameters.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
589
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2000', 0, async function (done) {
590 591 592 593 594 595 596 597 598 599 600 601 602 603
        try {
            gattServer.addService();
            expect(true).assertFalse();
            await sleep(1000);
            done();
        } catch (error) {
            console.error('[bluetooth_js]addService20 error.code:'+JSON.stringify(error.code)+
                   'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }       
    })

    /**
Q
quanli 已提交
604
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2100
605 606 607 608 609
     * @tc.name testAddService
     * @tc.desc Test api 401 -  parameters is null.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
610
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2100', 0, async function (done) {
611 612 613 614 615 616 617 618 619 620 621 622 623 624
        try {
            gattServer.addService(null);
            expect(true).assertFalse();
            await sleep(1000);
            done();
        } catch (error) {
            console.error('[bluetooth_js]addService21 error.code:'+JSON.stringify(error.code)+
            'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }       
    })

    /**
Q
quanli 已提交
625
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2200
626 627 628 629 630
     * @tc.name testAddService
     * @tc.desc Test api 401 - serviceUuid of gattService is null.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
631
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2200', 0, async function (done) {
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665
        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 = {isPrimary: true,
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]addService22 error.code:'+JSON.stringify(error.code)+
            'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }       
    })

    /**
Q
quanli 已提交
666
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2300
667 668 669 670 671
     * @tc.name testAddService
     * @tc.desc Test api 401 - serviceUuid of gattService is error type.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
672
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2300', 0, async function (done) {
673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706
        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:123123, isPrimary: true,
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]addService23 error.code:'+JSON.stringify(error.code)+
            'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }       
    })

    /**
Q
quanli 已提交
707
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2400
708 709 710 711 712
     * @tc.name testAddService
     * @tc.desc Test api 401 - isPrimary of gattService is null.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
713
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2400', 0, async function (done) {
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747
        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',
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]addService24 error.code:'+JSON.stringify(error.code)+
            'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }       
    })

    /**
Q
quanli 已提交
748
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2500
749 750 751 752 753
     * @tc.name testAddService
     * @tc.desc Test api 401 - isPrimary of gattService is error type.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
754
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2500', 0, async function (done) {
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788
        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: '123S123',
            characteristics:characteristics, includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]addService25 error.code:'+JSON.stringify(error.code)+
            'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }       
    })

    /**
Q
quanli 已提交
789
     * @tc.number SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2600
790 791 792 793 794
     * @tc.name testAddService
     * @tc.desc Test api 401 - characteristics of gattService is error type.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
795
    it('SUB_COMMUNICATION_BTMANAGER_ADDSERVICE_2600', 0, async function (done) {
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813
        try {
            let gattService = {serviceUuid:'00001810-0000-1000-8000-00805F9B34FB', isPrimary: true,
            characteristics:"123sss",includeServices:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]addService26 error.code:'+JSON.stringify(error.code)+
            'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }       
    })

    /**
Q
quanli 已提交
814
     * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0100
815 816 817 818 819
     * @tc.name testRemoveService
     * @tc.desc Test RemoveService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
820
    it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0100', 0, async function (done) {
821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857
        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);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            done();
        } catch (error) {
            console.error(`[bluetooth_js]removeService1 failed, code is ${error.code},
            message is ${error.message}`);
            expect(true).assertFalse();
            done()
        }
        
    })

    /**
Q
quanli 已提交
858
     * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0200
859 860 861 862 863
     * @tc.name testRemoveService
     * @tc.desc Test RemoveService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
864
    it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0200', 0, async function (done) {
865 866 867 868 869 870 871 872 873 874 875 876 877 878
        try {
            gattServer.removeService('00001800-0000-1000-8000-00805f9b3442');
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error(`[bluetooth_js]removeService2 failed, code is ${error.code},
            message is ${error.message}`);
            expect(error.code).assertEqual('401');
            done()
        }
       
    })

    /**
Q
quanli 已提交
879
     * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0300
880 881 882 883 884
     * @tc.name testRemoveService
     * @tc.desc Test RemoveService api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
885
    it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0300', 0, async function (done) {
886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920
        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:[]};
            gattServer.addService(gattService);
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            gattServer.removeService('00001810-0000-1000-8000-00805F9B34FB');
            await sleep(1000);
            done();
        } catch (error) {
            console.error(`[bluetooth_js]removeService3 failed, code is ${error.code},
            message is ${error.message}`);
            expect(error.code).assertEqual('401');
            done()
        }
    })
 
    /**
Q
quanli 已提交
921
     * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0400
922 923 924 925 926
     * @tc.name testRemoveService
     * @tc.desc Test RemoveService 401-null parameter.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
927
      it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0400', 0, async function (done) {
928 929 930 931 932 933 934 935 936 937 938 939 940 941
        try {
            gattServer.removeService();
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error(`[bluetooth_js]removeService4 failed, code is ${error.code},
            message is ${error.message}`);
            expect(error.code).assertEqual('401');
            done()
        }
       
    })

    /**
Q
quanli 已提交
942
     * @tc.number SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0500
943 944 945 946 947
     * @tc.name testRemoveService
     * @tc.desc Test RemoveService 401-error parameter.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
948
    it('SUB_COMMUNICATION_BTMANAGER_REMOVESERVICE_0500', 0, async function (done) {
949 950 951 952 953 954 955 956 957 958 959 960 961
        try {
            gattServer.removeService("sss");
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error(`[bluetooth_js]removeService5 failed, code is ${error.code},
            message is ${error.message}`);
            expect(error.code).assertEqual('401');
            done()
        }   
    })

    /**
Q
quanli 已提交
962
     * @tc.number SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0100
963 964 965 966 967
     * @tc.name testNotifyCharacteristicChanged
     * @tc.desc Test NotifyCharacteristicChanged api.
     * @tc.type Function
     * @tc.level Level 2
     */
Q
quanli 已提交
968
    it('SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0100', 0, async function (done) {
969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997
        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: descV};
            descriptors[0] = descriptor;
            let arrayBufferC = new ArrayBuffer(8);
            let characteristic = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB',
            characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', characteristicValue:
            arrayBufferC, descriptors:descriptors};
            let NotifyCharacteristic = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB',
            characteristicUuid: '00001821-0000-1000-8000-00805F9B34FB', characteristicValue: 
            characteristic.characteristicValue, confirm: false};
            gattServer.notifyCharacteristicChanged('00:11:22:33:44:55', NotifyCharacteristic);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]notifyCharacteristicChanged1 failed, code:'
            +JSON.stringify(error.code)+'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }
        
    })

    /**
Q
quanli 已提交
998
     * @tc.number SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0200
999 1000 1001 1002 1003
     * @tc.name testNotifyCharacteristicChanged
     * @tc.desc Test NotifyCharacteristicChanged api.
     * @tc.type Function
     * @tc.level Level 2
     */
Q
quanli 已提交
1004
    it('SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0200', 0, async function (done) {
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033
        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: descV};
            descriptors[0] = descriptor;
            let arrayBufferC = new ArrayBuffer(8);
            let characteristic = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB',
            characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', characteristicValue:
            arrayBufferC, descriptors:descriptors};
            let notifyCharacteristic = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB',
            characteristicUuid: '00001821-0000-1000-8000-00805F9B34FB', characteristicValue: 
            characteristic.characteristicValue, confirm: false};
            gattServer.notifyCharacteristicChanged('00:11:22:33:44:55', notifyCharacteristic);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]notifyCharacteristicChanged2 failed, code:'
            +JSON.stringify(error.code)+'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }
        
    })

    /**
Q
quanli 已提交
1034
     * @tc.number SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0300
1035 1036 1037 1038 1039
     * @tc.name testNotifyCharacteristicChanged
     * @tc.desc Test NotifyCharacteristicChanged api.
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
1040
    it('SUB_COMMUNICATION_BTMANAGER_NOTIFYCHARACTERISTIC_0300', 0, async function (done) {
1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
        try {
            console.info('[bluetooth_js] COMMUNICATION_BLUETOOTH_BLE_notifyCharacteristic_0200');
            gattServer.notifyCharacteristicChanged('00:11:22:33:44:55', null);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]notifyCharacteristicChanged3 failed, code:'
            +JSON.stringify(error.code)+'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');  
            done()
        }
       
    })

    /**
Q
quanli 已提交
1056
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0100
1057 1058 1059 1060 1061
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse api.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1062
    it('SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0100', 0, async function (done) {
1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081
        try {
            let arrayBuffer = new ArrayBuffer(8);
            let value =  new Uint8Array(arrayBuffer);
            value[0] = 1;
            let ServerResponse = {deviceId: '00:11:22:33:44:55', transId: 1,
                status: 0, offset: 0, value: arrayBuffer};
            gattServer.sendResponse(ServerResponse);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error(`[bluetooth_js]sendResponse1 failed, code is ${error.code},
            message is ${error.message}`);
            expect(error.code).assertEqual('2900099');
            done()
        }
        
    })

    /**
Q
quanli 已提交
1082
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0200
1083 1084 1085 1086 1087
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse api.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1088
    it('SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0200', 0, async function (done) {
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107
        try {
            let arrayBuffer = new ArrayBuffer(8);
            let value =  new Uint8Array(arrayBuffer);
            value[0] = 1;
            let ServerResponse = {deviceId: '00:11:22:33:44:55', transId: 1,
                status: -1, offset: 0, value: arrayBuffer};
            gattServer.sendResponse(ServerResponse);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error(`[bluetooth_js]sendResponse2 failed, code is ${error.code},
            message is ${error.message}`);
            expect(error.code).assertEqual('2900099');
            done()
        }
        
    })

    /**
Q
quanli 已提交
1108
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0300
1109 1110 1111 1112 1113
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -null parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1114
    it('SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0300', 0, async function (done) {
1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
        try {
            gattServer.sendResponse();
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error('[bluetooth_js]sendResponse3 error.code:'+JSON.stringify(error.code)+
                   'error.message:'+JSON.stringify(error.message));
            expect(error.code).assertEqual('401');
            done()
        }
        
    })

    /**
Q
quanli 已提交
1129
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0400
1130 1131 1132 1133 1134
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1135
    it('SUB_COMMUNICATION_BTMANAGER_SENDRESPONSE_0400', 0, async function (done) {
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154
        try {
            let arrayBuffer = new ArrayBuffer(8);
            let value =  new Uint8Array(arrayBuffer);
            value[0] = 1;
            let ServerResponse = {transId: 1,
                status: -1, offset: 0, value: arrayBuffer};
            gattServer.sendResponse(ServerResponse);
            expect(true).assertFalse();
            done();
        } catch (error) {
            console.error(`[bluetooth_js]sendResponse4 failed, code is ${error.code},
            message is ${error.message}`);
            expect(error.code).assertEqual('401');
            done()
        }
        
    })

    /**
Q
quanli 已提交
1155
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0333
1156 1157 1158 1159 1160
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1161
    it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0333', 0, async function (done) {
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187
        let STATE_ON = bluetooth.BluetoothState.STATE_ON;
        console.info("[bluetooth_js]STATE_ON : " + JSON.stringify(STATE_ON));
        expect(true).assertTrue(STATE_ON == 2);
        let STATE_OFF = bluetooth.BluetoothState.STATE_OFF;
        console.info("[bluetooth_js]STATE_OFF : " + JSON.stringify(STATE_OFF));
        expect(true).assertTrue(STATE_OFF == 0);
        let STATE_TURNING_ON = bluetooth.BluetoothState.STATE_TURNING_ON;
        console.info("[bluetooth_js]STATE_TURNING_ON : " + JSON.stringify(STATE_TURNING_ON));
        expect(true).assertTrue(STATE_TURNING_ON == 1);
        let STATE_TURNING_OFF = bluetooth.BluetoothState.STATE_TURNING_OFF;
        console.info("[bluetooth_js]STATE_TURNING_OFF : " + JSON.stringify(STATE_TURNING_OFF));
        expect(true).assertTrue(STATE_TURNING_OFF == 3);
        let STATE_BLE_TURNING_ON = bluetooth.BluetoothState.STATE_BLE_TURNING_ON;
        console.info("[bluetooth_js]STATE_BLE_TURNING_ON : " +
        JSON.stringify(STATE_BLE_TURNING_ON));
        expect(true).assertTrue(STATE_BLE_TURNING_ON == 4);
        let STATE_BLE_ON = bluetooth.BluetoothState.STATE_BLE_ON;
        console.info("[bluetooth_js]STATE_BLE_ON : " + JSON.stringify(STATE_BLE_ON));
        expect(true).assertTrue(STATE_BLE_ON == 5);
        let STATE_BLE_TURNING_OFF = bluetooth.BluetoothState.STATE_BLE_TURNING_OFF;
        console.info("[bluetooth_js]STATE_BLE_TURNING_OFF : " + JSON.stringify(STATE_BLE_TURNING_OFF));
        expect(true).assertTrue(STATE_BLE_TURNING_OFF == 6);
        done()
    })

    /**
Q
quanli 已提交
1188
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0555
1189 1190 1191 1192 1193
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1194
    it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0555', 0, async function (done) {
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222
        let SCAN_MODE_NONE = bluetooth.ScanMode.SCAN_MODE_NONE;
        console.info("[bluetooth_js]SCAN_MODE_NONE : " + JSON.stringify(SCAN_MODE_NONE));
        expect(true).assertTrue(SCAN_MODE_NONE == 0);
        let SCAN_MODE_CONNECTABLE = bluetooth.ScanMode.SCAN_MODE_CONNECTABLE;
        console.info("[bluetooth_js]SCAN_MODE_CONNECTABLE : " + JSON.stringify(SCAN_MODE_CONNECTABLE));
        expect(true).assertTrue(SCAN_MODE_CONNECTABLE == 1);
        let SCAN_MODE_GENERAL_DISCOVERABLE = bluetooth.ScanMode.SCAN_MODE_GENERAL_DISCOVERABLE;
        console.info("[bluetooth_js]SCAN_MODE_GENERAL_DISCOVERABLE : " +
        JSON.stringify(SCAN_MODE_GENERAL_DISCOVERABLE));
        expect(true).assertTrue(SCAN_MODE_GENERAL_DISCOVERABLE == 2);
        let SCAN_MODE_LIMITED_DISCOVERABLE = bluetooth.ScanMode.SCAN_MODE_LIMITED_DISCOVERABLE;
        console.info("[bluetooth_js]SCAN_MODE_LIMITED_DISCOVERABLE : " +
        JSON.stringify(SCAN_MODE_LIMITED_DISCOVERABLE));
        expect(true).assertTrue(SCAN_MODE_NONE == 3);
        let SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE =
            bluetooth.ScanMode.SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE;
        console.info("[bluetooth_js]SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE : " +
        JSON.stringify(SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE));
        expect(true).assertTrue(SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE == 4);
        let SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE =
            bluetooth.ScanMode.SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE;
        console.info("[bluetooth_js]SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE : " +
        JSON.stringify(SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE));
        expect(true).assertTrue(SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE == 5);
        done()
    })

    /**
Q
quanli 已提交
1223
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0666
1224 1225 1226 1227 1228
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1229
    it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0666', 0, async function (done) {
1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245
        let STATE_DISCONNECTED = bluetooth.ProfileConnectionState.STATE_DISCONNECTED;
        console.info("[bluetooth_js]STATE_DISCONNECTED : " + JSON.stringify(STATE_DISCONNECTED));
        expect(true).assertTrue(STATE_DISCONNECTED == 0);
        let STATE_CONNECTING = bluetooth.ProfileConnectionState.STATE_CONNECTING;
        console.info("[bluetooth_js]STATE_CONNECTING : " + JSON.stringify(STATE_CONNECTING));
        expect(true).assertTrue(STATE_CONNECTING == 1);
        let STATE_CONNECTED = bluetooth.ProfileConnectionState.STATE_CONNECTED;
        console.info("[bluetooth_js]STATE_CONNECTED : " + JSON.stringify(STATE_CONNECTED));
        expect(true).assertTrue(STATE_CONNECTED == 2);
        let STATE_DISCONNECTING = bluetooth.ProfileConnectionState.STATE_DISCONNECTING;
        console.info("[bluetooth_js]STATE_DISCONNECTING : " + JSON.stringify(STATE_DISCONNECTING));
        expect(true).assertTrue(STATE_DISCONNECTING == 3);
        done()
    })

    /**
Q
quanli 已提交
1246
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0777
1247 1248 1249 1250 1251
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1252
    it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0777', 0, async function (done) {
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266
        let SCAN_MODE_LOW_POWER = bluetooth.ScanDuty.SCAN_MODE_LOW_POWER;
        console.info("[bluetooth_js]STATE_DISCONNECTED : " + JSON.stringify(SCAN_MODE_LOW_POWER));
        expect(true).assertTrue(SCAN_MODE_LOW_POWER == 0);
        let SCAN_MODE_BALANCED = bluetooth.ScanDuty.SCAN_MODE_BALANCED;
        console.info("[bluetooth_js]SCAN_MODE_BALANCED : " + JSON.stringify(SCAN_MODE_BALANCED));
        expect(true).assertTrue(SCAN_MODE_BALANCED == 1);
        let SCAN_MODE_LOW_LATENCY = bluetooth.ScanDuty.SCAN_MODE_LOW_LATENCY;
        console.info("[bluetooth_js]SCAN_MODE_LOW_LATENCY : " + JSON.stringify(SCAN_MODE_LOW_LATENCY));
        expect(true).assertTrue(SCAN_MODE_LOW_LATENCY == 2);
        done()
    })


    /**
Q
quanli 已提交
1267
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0888
1268 1269 1270 1271 1272
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1273
    it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0888', 0, async function (done) {
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290
        let PROFILE_A2DP_SOURCE = bluetooth.ProfileId.PROFILE_A2DP_SOURCE;
        console.info("[bluetooth_js]PROFILE_A2DP_SOURCE : " + JSON.stringify(PROFILE_A2DP_SOURCE));
        expect(true).assertTrue(PROFILE_A2DP_SOURCE == 1);
        let PROFILE_HANDS_FREE_AUDIO_GATEWAY = bluetooth.ProfileId.PROFILE_HANDS_FREE_AUDIO_GATEWAY;
        console.info("[bluetooth_js]PROFILE_HANDS_FREE_AUDIO_GATEWAY : " +
        JSON.stringify(PROFILE_HANDS_FREE_AUDIO_GATEWAY));
        expect(true).assertTrue(PROFILE_HANDS_FREE_AUDIO_GATEWAY == 4);
        let PROFILE_HID_HOST = bluetooth.ProfileId.PROFILE_HID_HOST;
        console.info("[bluetooth_js]PROFILE_HID_HOST : " + JSON.stringify(PROFILE_HID_HOST));
        expect(true).assertTrue(PROFILE_HID_HOST == 6);
        let PROFILE_PAN_NETWORK = bluetooth.ProfileId.PROFILE_PAN_NETWORK;
        console.info("[bluetooth_js]PROFILE_PAN_NETWORK : " + JSON.stringify(PROFILE_PAN_NETWORK));
        expect(true).assertTrue(PROFILE_PAN_NETWORK == 7);
        done()
    })

    /**
Q
quanli 已提交
1291
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0999
1292 1293 1294 1295 1296
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1297
    it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_0999', 0, async function (done) {
1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311
        let STATE_NOT_PLAYING = bluetooth.PlayingState.STATE_NOT_PLAYING;
        console.info("[bluetooth_js]STATE_NOT_PLAYING : " + JSON.stringify(STATE_NOT_PLAYING));
        expect(true).assertTrue(STATE_NOT_PLAYING == 0x0000);
        let STATE_PLAYING = bluetooth.PlayingState.STATE_PLAYING;
        console.info("[bluetooth_js]STATE_PLAYING : " + JSON.stringify(STATE_PLAYING));
        expect(true).assertTrue(STATE_PLAYING == 0x0001);

        let SPP_RFCOMM = bluetooth.SppType.SPP_RFCOMM;
        console.info("[bluetooth_js]SPP_RFCOMM : " + JSON.stringify(SPP_RFCOMM));
        expect(true).assertTrue(SPP_RFCOMM == 0);
        done()
    })

    /**
Q
quanli 已提交
1312
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1111
1313 1314 1315 1316 1317
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1318
    it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1111', 0, async function (done) {
1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355
        let MAJOR_MISC = bluetooth.MajorClass.MAJOR_MISC;
        console.info("[bluetooth_js]MAJOR_MISC : " + JSON.stringify(MAJOR_MISC));
        expect(true).assertTrue(MAJOR_MISC == 0x0000);
        let MAJOR_COMPUTER = bluetooth.MajorClass.MAJOR_COMPUTER;
        console.info("[bluetooth_js]MAJOR_COMPUTER : " + JSON.stringify(MAJOR_COMPUTER));
        expect(true).assertTrue(MAJOR_COMPUTER == 0x0100);
        let MAJOR_PHONE = bluetooth.MajorClass.MAJOR_PHONE;
        console.info("[bluetooth_js]MAJOR_PHONE : " + JSON.stringify(MAJOR_PHONE));
        expect(true).assertTrue(MAJOR_PHONE == 0x0200);
        let MAJOR_NETWORKING = bluetooth.MajorClass.MAJOR_NETWORKING;
        console.info("[bluetooth_js]MAJOR_NETWORKING : " + JSON.stringify(MAJOR_NETWORKING));
        expect(true).assertTrue(MAJOR_NETWORKING == 0x0300);
        let MAJOR_AUDIO_VIDEO = bluetooth.MajorClass.MAJOR_AUDIO_VIDEO;
        console.info("[bluetooth_js]MAJOR_AUDIO_VIDEO : " + JSON.stringify(MAJOR_AUDIO_VIDEO));
        expect(true).assertTrue(MAJOR_AUDIO_VIDEO == 0x0400);
        let MAJOR_PERIPHERAL = bluetooth.MajorClass.MAJOR_PERIPHERAL;
        console.info("[bluetooth_js]MAJOR_PERIPHERAL : " + JSON.stringify(MAJOR_PERIPHERAL));
        expect(true).assertTrue(MAJOR_PERIPHERAL == 0x0500);
        let MAJOR_IMAGING = bluetooth.MajorClass.MAJOR_IMAGING;
        console.info("[bluetooth_js]MAJOR_IMAGING : " + JSON.stringify(MAJOR_IMAGING));
        expect(true).assertTrue(MAJOR_IMAGING == 0x0600);
        let MAJOR_WEARABLE = bluetooth.MajorClass.MAJOR_WEARABLE;
        console.info("[bluetooth_js]MAJOR_WEARABLE : " + JSON.stringify(MAJOR_WEARABLE));
        expect(true).assertTrue(MAJOR_WEARABLE == 0x0700);
        let MAJOR_TOY = bluetooth.MajorClass.MAJOR_TOY;
        console.info("[bluetooth_js]MAJOR_TOY : " + JSON.stringify(MAJOR_TOY));
        expect(true).assertTrue(MAJOR_TOY == 0x0800);
        let MAJOR_HEALTH = bluetooth.MajorClass.MAJOR_HEALTH;
        console.info("[bluetooth_js]MAJOR_HEALTH : " + JSON.stringify(MAJOR_HEALTH));
        expect(true).assertTrue(MAJOR_HEALTH == 0x0900);
        let MAJOR_UNCATEGORIZED = bluetooth.MajorClass.MAJOR_UNCATEGORIZED;
        console.info("[bluetooth_js]MAJOR_UNCATEGORIZED : " + JSON.stringify(MAJOR_UNCATEGORIZED));
        expect(true).assertTrue(MAJOR_UNCATEGORIZED == 0x1F00);
        done()
    })

    /**
Q
quanli 已提交
1356
     * @tc.number SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1112
1357 1358 1359 1360 1361
     * @tc.name testSendResponse success
     * @tc.desc Test SendResponse 401 -error parameter.
     * @tc.type Function
     * @tc.level Level 1
     */
Q
quanli 已提交
1362
    it('SUB_COMMUNICATION_BTMANAGER_SWITCHOFF_1112', 0, async function (done) {
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667
        let COMPUTER_UNCATEGORIZED = bluetooth.MajorMinorClass.COMPUTER_UNCATEGORIZED;
        console.info("[bluetooth_js]COMPUTER_UNCATEGORIZED : " +
        JSON.stringify(COMPUTER_UNCATEGORIZED));
        expect(true).assertTrue(COMPUTER_UNCATEGORIZED == 0x0100);
        let COMPUTER_DESKTOP = bluetooth.MajorMinorClass.COMPUTER_DESKTOP;
        console.info("[bluetooth_js]COMPUTER_DESKTOP : " + JSON.stringify(COMPUTER_DESKTOP));
        expect(true).assertTrue(COMPUTER_DESKTOP == 0x0104);
        let COMPUTER_SERVER = bluetooth.MajorMinorClass.COMPUTER_SERVER;
        console.info("[bluetooth_js]COMPUTER_SERVER : " + JSON.stringify(COMPUTER_SERVER));
        expect(true).assertTrue(COMPUTER_SERVER == 0x0108);
        let COMPUTER_LAPTOP = bluetooth.MajorMinorClass.COMPUTER_LAPTOP;
        console.info("[bluetooth_js]COMPUTER_LAPTOP : " + JSON.stringify(COMPUTER_LAPTOP));
        expect(true).assertTrue(COMPUTER_LAPTOP == 0x010C);
        let COMPUTER_HANDHELD_PC_PDA = bluetooth.MajorMinorClass.COMPUTER_HANDHELD_PC_PDA;
        console.info("[bluetooth_js]COMPUTER_HANDHELD_PC_PDA : " +
        JSON.stringify(COMPUTER_HANDHELD_PC_PDA));
        expect(true).assertTrue(COMPUTER_HANDHELD_PC_PDA == 0x0110);
        let COMPUTER_PALM_SIZE_PC_PDA = bluetooth.MajorMinorClass.COMPUTER_PALM_SIZE_PC_PDA;
        console.info("[bluetooth_js]COMPUTER_PALM_SIZE_PC_PDA : " +
        JSON.stringify(COMPUTER_PALM_SIZE_PC_PDA));
        expect(true).assertTrue(COMPUTER_PALM_SIZE_PC_PDA == 0x0114);
        let COMPUTER_WEARABLE = bluetooth.MajorMinorClass.COMPUTER_WEARABLE;
        console.info("[bluetooth_js]COMPUTER_WEARABLE : " + JSON.stringify(COMPUTER_WEARABLE));
        expect(true).assertTrue(COMPUTER_WEARABLE == 0x0118);
        let COMPUTER_TABLET = bluetooth.MajorMinorClass.COMPUTER_TABLET;
        console.info("[bluetooth_js]COMPUTER_TABLET : " + JSON.stringify(COMPUTER_TABLET));
        expect(true).assertTrue(COMPUTER_TABLET == 0x011C);

        let PHONE_UNCATEGORIZED = bluetooth.MajorMinorClass.PHONE_UNCATEGORIZED;
        console.info("[bluetooth_js]PHONE_UNCATEGORIZED : " +
        JSON.stringify(PHONE_UNCATEGORIZED));
        expect(true).assertTrue(PHONE_UNCATEGORIZED == 0x0200);
        let PHONE_CELLULAR = bluetooth.MajorMinorClass.PHONE_CELLULAR;
        console.info("[bluetooth_js]PHONE_CELLULAR : " + JSON.stringify(PHONE_CELLULAR));
        expect(true).assertTrue(PHONE_CELLULAR == 0x0204);
        let PHONE_CORDLESS = bluetooth.MajorMinorClass.PHONE_CORDLESS;
        console.info("[bluetooth_js]PHONE_CORDLESS : " + JSON.stringify(PHONE_CORDLESS));
        expect(true).assertTrue(PHONE_CORDLESS == 0x0208);
        let PHONE_SMART = bluetooth.MajorMinorClass.PHONE_SMART;
        console.info("[bluetooth_js]PHONE_SMART : " + JSON.stringify(PHONE_SMART));
        expect(true).assertTrue(PHONE_SMART == 0x020C);
        let PHONE_MODEM_OR_GATEWAY = bluetooth.MajorMinorClass.PHONE_MODEM_OR_GATEWAY;
        console.info("[bluetooth_js]PHONE_MODEM_OR_GATEWAY : " +
        JSON.stringify(PHONE_MODEM_OR_GATEWAY));
        expect(true).assertTrue(PHONE_MODEM_OR_GATEWAY == 0x0210);
        let PHONE_ISDN = bluetooth.MajorMinorClass.PHONE_ISDN;
        console.info("[bluetooth_js]PHONE_ISDN : " + JSON.stringify(PHONE_ISDN));
        expect(true).assertTrue(PHONE_ISDN == 0x0214);

        let NETWORK_FULLY_AVAILABLE = bluetooth.MajorMinorClass.NETWORK_FULLY_AVAILABLE;
        console.info("[bluetooth_js]NETWORK_FULLY_AVAILABLE : " +
        JSON.stringify(NETWORK_FULLY_AVAILABLE));
        expect(true).assertTrue(NETWORK_FULLY_AVAILABLE == 0x0300);
        let NETWORK_1_TO_17_UTILIZED = bluetooth.MajorMinorClass.NETWORK_1_TO_17_UTILIZED;
        console.info("[bluetooth_js]NETWORK_1_TO_17_UTILIZED : " +
        JSON.stringify(NETWORK_1_TO_17_UTILIZED));
        expect(true).assertTrue(NETWORK_1_TO_17_UTILIZED == 0x0320);
        let NETWORK_17_TO_33_UTILIZED = bluetooth.MajorMinorClass.NETWORK_17_TO_33_UTILIZED;
        console.info("[bluetooth_js]NETWORK_17_TO_33_UTILIZED : " +
        JSON.stringify(NETWORK_17_TO_33_UTILIZED));
        expect(true).assertTrue(NETWORK_17_TO_33_UTILIZED == 0x0340);
        let NETWORK_33_TO_50_UTILIZED = bluetooth.MajorMinorClass.NETWORK_33_TO_50_UTILIZED;
        console.info("[bluetooth_js]NETWORK_33_TO_50_UTILIZED : " +
        JSON.stringify(NETWORK_33_TO_50_UTILIZED));
        expect(true).assertTrue(NETWORK_33_TO_50_UTILIZED == 0x0360);
        let NETWORK_60_TO_67_UTILIZED = bluetooth.MajorMinorClass.NETWORK_60_TO_67_UTILIZED;
        console.info("[bluetooth_js]NETWORK_60_TO_67_UTILIZED : " +
        JSON.stringify(NETWORK_60_TO_67_UTILIZED));
        expect(true).assertTrue(NETWORK_60_TO_67_UTILIZED == 0x0380);
        let NETWORK_67_TO_83_UTILIZED = bluetooth.MajorMinorClass.NETWORK_67_TO_83_UTILIZED;
        console.info("[bluetooth_js]NETWORK_67_TO_83_UTILIZED : " +
        JSON.stringify(NETWORK_67_TO_83_UTILIZED));
        expect(true).assertTrue(NETWORK_67_TO_83_UTILIZED == 0x03A0);
        let NETWORK_83_TO_99_UTILIZED = bluetooth.MajorMinorClass.NETWORK_83_TO_99_UTILIZED;
        console.info("[bluetooth_js]NETWORK_83_TO_99_UTILIZED : " +
        JSON.stringify(NETWORK_83_TO_99_UTILIZED));
        expect(true).assertTrue(NETWORK_83_TO_99_UTILIZED == 0x03C0);
        let NETWORK_NO_SERVICE = bluetooth.MajorMinorClass.NETWORK_NO_SERVICE;
        console.info("[bluetooth_js]NETWORK_NO_SERVICE : " + JSON.stringify(NETWORK_NO_SERVICE));
        expect(true).assertTrue(NETWORK_NO_SERVICE == 0x03E0);

        let AUDIO_VIDEO_UNCATEGORIZED = bluetooth.MajorMinorClass.AUDIO_VIDEO_UNCATEGORIZED;
        console.info("[bluetooth_js]AUDIO_VIDEO_UNCATEGORIZED : " +
        JSON.stringify(AUDIO_VIDEO_UNCATEGORIZED));
        expect(true).assertTrue(AUDIO_VIDEO_UNCATEGORIZED == 0x0400);
        let AUDIO_VIDEO_WEARABLE_HEADSET = bluetooth.MajorMinorClass.AUDIO_VIDEO_WEARABLE_HEADSET;
        console.info("[bluetooth_js]AUDIO_VIDEO_WEARABLE_HEADSET : " +
        JSON.stringify(AUDIO_VIDEO_WEARABLE_HEADSET));
        expect(true).assertTrue(AUDIO_VIDEO_WEARABLE_HEADSET == 0x0404);
        let AUDIO_VIDEO_HANDSFREE = bluetooth.MajorMinorClass.AUDIO_VIDEO_HANDSFREE;
        console.info("[bluetooth_js]AUDIO_VIDEO_HANDSFREE : " +
        JSON.stringify(AUDIO_VIDEO_HANDSFREE));
        expect(true).assertTrue(AUDIO_VIDEO_HANDSFREE == 0x0408);
        let AUDIO_VIDEO_MICROPHONE = bluetooth.MajorMinorClass.AUDIO_VIDEO_MICROPHONE;
        console.info("[bluetooth_js]AUDIO_VIDEO_MICROPHONE : " + JSON.stringify(AUDIO_VIDEO_MICROPHONE));
        expect(true).assertTrue(AUDIO_VIDEO_MICROPHONE == 0x0410);
        let AUDIO_VIDEO_LOUDSPEAKER = bluetooth.MajorMinorClass.AUDIO_VIDEO_LOUDSPEAKER;
        console.info("[bluetooth_js]AUDIO_VIDEO_LOUDSPEAKER : " + JSON.stringify(AUDIO_VIDEO_LOUDSPEAKER));
        expect(true).assertTrue(AUDIO_VIDEO_LOUDSPEAKER == 0x0414);
        let AUDIO_VIDEO_HEADPHONES = bluetooth.MajorMinorClass.AUDIO_VIDEO_HEADPHONES;
        console.info("[bluetooth_js]AUDIO_VIDEO_HEADPHONES : " + JSON.stringify(AUDIO_VIDEO_HEADPHONES));
        expect(true).assertTrue(AUDIO_VIDEO_HEADPHONES == 0x0418);
        let AUDIO_VIDEO_PORTABLE_AUDIO = bluetooth.MajorMinorClass.AUDIO_VIDEO_PORTABLE_AUDIO;
        console.info("[bluetooth_js]AUDIO_VIDEO_PORTABLE_AUDIO : " +
        JSON.stringify(AUDIO_VIDEO_PORTABLE_AUDIO));
        expect(true).assertTrue(AUDIO_VIDEO_PORTABLE_AUDIO == 0x041C);
        let AUDIO_VIDEO_CAR_AUDIO = bluetooth.MajorMinorClass.AUDIO_VIDEO_CAR_AUDIO;
        console.info("[bluetooth_js]AUDIO_VIDEO_CAR_AUDIO : " + JSON.stringify(AUDIO_VIDEO_CAR_AUDIO));
        expect(true).assertTrue(AUDIO_VIDEO_CAR_AUDIO == 0x0420);
        let AUDIO_VIDEO_SET_TOP_BOX = bluetooth.MajorMinorClass.AUDIO_VIDEO_SET_TOP_BOX;
        console.info("[bluetooth_js]AUDIO_VIDEO_SET_TOP_BOX : " + JSON.stringify(AUDIO_VIDEO_SET_TOP_BOX));
        expect(true).assertTrue(AUDIO_VIDEO_SET_TOP_BOX == 0x0424);
        let AUDIO_VIDEO_HIFI_AUDIO = bluetooth.MajorMinorClass.AUDIO_VIDEO_HIFI_AUDIO;
        console.info("[bluetooth_js]AUDIO_VIDEO_HIFI_AUDIO : " + JSON.stringify(AUDIO_VIDEO_HIFI_AUDIO));
        expect(true).assertTrue(AUDIO_VIDEO_HIFI_AUDIO == 0x0428);
        let AUDIO_VIDEO_VCR = bluetooth.MajorMinorClass.AUDIO_VIDEO_VCR;
        console.info("[bluetooth_js]AUDIO_VIDEO_VCR : " + JSON.stringify(AUDIO_VIDEO_VCR));
        expect(true).assertTrue(AUDIO_VIDEO_VCR == 0x042C);
        let AUDIO_VIDEO_VIDEO_CAMERA = bluetooth.MajorMinorClass.AUDIO_VIDEO_VIDEO_CAMERA;
        console.info("[bluetooth_js]AUDIO_VIDEO_VIDEO_CAMERA : " +
        JSON.stringify(AUDIO_VIDEO_VIDEO_CAMERA));
        expect(true).assertTrue(AUDIO_VIDEO_VIDEO_CAMERA == 0x0430);
        let AUDIO_VIDEO_CAMCORDER = bluetooth.MajorMinorClass.AUDIO_VIDEO_CAMCORDER;
        console.info("[bluetooth_js]AUDIO_VIDEO_CAMCORDER : " + JSON.stringify(AUDIO_VIDEO_CAMCORDER));
        expect(true).assertTrue(AUDIO_VIDEO_CAMCORDER == 0x0434);
        let AUDIO_VIDEO_VIDEO_MONITOR = bluetooth.MajorMinorClass.AUDIO_VIDEO_VIDEO_MONITOR;
        console.info("[bluetooth_js]AUDIO_VIDEO_VIDEO_MONITOR : " +
        JSON.stringify(AUDIO_VIDEO_VIDEO_MONITOR));
        expect(true).assertTrue(AUDIO_VIDEO_VIDEO_MONITOR == 0x0438);
        let AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER =
            bluetooth.MajorMinorClass.AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER;
        console.info("[bluetooth_js]AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER : "
        + JSON.stringify(AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER));
        expect(true).assertTrue(AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER == 0x043C);
        let AUDIO_VIDEO_VIDEO_CONFERENCING = bluetooth.MajorMinorClass.AUDIO_VIDEO_VIDEO_CONFERENCING;
        console.info("[bluetooth_js]AUDIO_VIDEO_VIDEO_CONFERENCING : "
        + JSON.stringify(AUDIO_VIDEO_VIDEO_CONFERENCING));
        expect(true).assertTrue(AUDIO_VIDEO_VIDEO_CONFERENCING == 0x0440);
        let AUDIO_VIDEO_VIDEO_GAMING_TOY = bluetooth.MajorMinorClass.AUDIO_VIDEO_VIDEO_GAMING_TOY;
        console.info("[bluetooth_js]AUDIO_VIDEO_VIDEO_GAMING_TOY : "
        + JSON.stringify(AUDIO_VIDEO_VIDEO_GAMING_TOY));
        expect(true).assertTrue(AUDIO_VIDEO_VIDEO_GAMING_TOY == 0x0448);

        let PERIPHERAL_NON_KEYBOARD_NON_POINTING =
            bluetooth.MajorMinorClass.PERIPHERAL_NON_KEYBOARD_NON_POINTING;
        console.info("[bluetooth_js]PERIPHERAL_NON_KEYBOARD_NON_POINTING : "
        + JSON.stringify(PERIPHERAL_NON_KEYBOARD_NON_POINTING));
        expect(true).assertTrue(PERIPHERAL_NON_KEYBOARD_NON_POINTING == 0x0500);
        let PERIPHERAL_KEYBOARD = bluetooth.MajorMinorClass.PERIPHERAL_KEYBOARD;
        console.info("[bluetooth_js]PERIPHERAL_KEYBOARD : " + JSON.stringify(PERIPHERAL_KEYBOARD));
        expect(true).assertTrue(PERIPHERAL_KEYBOARD == 0x0540);
        let PERIPHERAL_POINTING_DEVICE = bluetooth.MajorMinorClass.PERIPHERAL_POINTING_DEVICE;
        console.info("[bluetooth_js]PERIPHERAL_POINTING_DEVICE : " +
        JSON.stringify(PERIPHERAL_POINTING_DEVICE));
        expect(true).assertTrue(PERIPHERAL_POINTING_DEVICE == 0x0580);
        let PERIPHERAL_KEYBOARD_POINTING = bluetooth.MajorMinorClass.PERIPHERAL_KEYBOARD_POINTING;
        console.info("[bluetooth_js]PERIPHERAL_KEYBOARD_POINTING : " +
        JSON.stringify(PERIPHERAL_KEYBOARD_POINTING));
        expect(true).assertTrue(PERIPHERAL_KEYBOARD_POINTING == 0x05C0);
        let PERIPHERAL_UNCATEGORIZED = bluetooth.MajorMinorClass.PERIPHERAL_UNCATEGORIZED;
        console.info("[bluetooth_js]PERIPHERAL_UNCATEGORIZED : " + JSON.stringify(PERIPHERAL_UNCATEGORIZED));
        expect(true).assertTrue(PERIPHERAL_UNCATEGORIZED == 0x0500);
        let PERIPHERAL_JOYSTICK = bluetooth.MajorMinorClass.PERIPHERAL_JOYSTICK;
        console.info("[bluetooth_js]PERIPHERAL_JOYSTICK : " + JSON.stringify(PERIPHERAL_JOYSTICK));
        expect(true).assertTrue(PERIPHERAL_JOYSTICK == 0x0504);
        let PERIPHERAL_GAMEPAD = bluetooth.MajorMinorClass.PERIPHERAL_GAMEPAD;
        console.info("[bluetooth_js]PERIPHERAL_GAMEPAD : " + JSON.stringify(PERIPHERAL_GAMEPAD));
        expect(true).assertTrue(PERIPHERAL_GAMEPAD == 0x0508);
        let PERIPHERAL_REMOTE_CONTROL = bluetooth.MajorMinorClass.PERIPHERAL_REMOTE_CONTROL;
        console.info("[bluetooth_js]PERIPHERAL_REMOTE_CONTROL : " + JSON.stringify(PERIPHERAL_REMOTE_CONTROL));
        expect(true).assertTrue(PERIPHERAL_REMOTE_CONTROL == 0x05C0);
        let PERIPHERAL_SENSING_DEVICE = bluetooth.MajorMinorClass.PERIPHERAL_SENSING_DEVICE;
        console.info("[bluetooth_js]PERIPHERAL_SENSING_DEVICE : " + JSON.stringify(PERIPHERAL_SENSING_DEVICE));
        expect(true).assertTrue(PERIPHERAL_SENSING_DEVICE == 0x0510);
        let PERIPHERAL_DIGITIZER_TABLET = bluetooth.MajorMinorClass.PERIPHERAL_DIGITIZER_TABLET;
        console.info("[bluetooth_js]PERIPHERAL_DIGITIZER_TABLET : " +
        JSON.stringify(PERIPHERAL_DIGITIZER_TABLET));
        expect(true).assertTrue(PERIPHERAL_DIGITIZER_TABLET == 0x0514);
        let PERIPHERAL_CARD_READER = bluetooth.MajorMinorClass.PERIPHERAL_CARD_READER;
        console.info("[bluetooth_js]PERIPHERAL_CARD_READER : " + JSON.stringify(PERIPHERAL_CARD_READER));
        expect(true).assertTrue(PERIPHERAL_CARD_READER == 0x0518);
        let PERIPHERAL_DIGITAL_PEN = bluetooth.MajorMinorClass.PERIPHERAL_DIGITAL_PEN;
        console.info("[bluetooth_js]PERIPHERAL_DIGITAL_PEN : " + JSON.stringify(PERIPHERAL_DIGITAL_PEN));
        expect(true).assertTrue(PERIPHERAL_DIGITAL_PEN == 0x051C);
        let PERIPHERAL_SCANNER_RFID = bluetooth.MajorMinorClass.PERIPHERAL_SCANNER_RFID;
        console.info("[bluetooth_js]PERIPHERAL_SCANNER_RFID : " + JSON.stringify(PERIPHERAL_SCANNER_RFID));
        expect(true).assertTrue(PERIPHERAL_SCANNER_RFID == 0x0520);
        let PERIPHERAL_GESTURAL_INPUT = bluetooth.MajorMinorClass.PERIPHERAL_GESTURAL_INPUT;
        console.info("[bluetooth_js]PERIPHERAL_GESTURAL_INPUT : " +
        JSON.stringify(PERIPHERAL_GESTURAL_INPUT));
        expect(true).assertTrue(PERIPHERAL_GESTURAL_INPUT == 0x0522);

        let IMAGING_UNCATEGORIZED = bluetooth.MajorMinorClass.IMAGING_UNCATEGORIZED;
        console.info("[bluetooth_js]IMAGING_UNCATEGORIZED : " + JSON.stringify(IMAGING_UNCATEGORIZED));
        expect(true).assertTrue(IMAGING_UNCATEGORIZED == 0x0600);
        let IMAGING_DISPLAY = bluetooth.MajorMinorClass.IMAGING_DISPLAY;
        console.info("[bluetooth_js]IMAGING_DISPLAY : " + JSON.stringify(IMAGING_DISPLAY));
        expect(true).assertTrue(IMAGING_DISPLAY == 0x0610);
        let IMAGING_CAMERA = bluetooth.MajorMinorClass.IMAGING_CAMERA;
        console.info("[bluetooth_js]IMAGING_CAMERA : " + JSON.stringify(IMAGING_CAMERA));
        expect(true).assertTrue(IMAGING_CAMERA == 0x0620);
        let IMAGING_SCANNER = bluetooth.MajorMinorClass.IMAGING_SCANNER;
        console.info("[bluetooth_js]IMAGING_SCANNER : " + JSON.stringify(IMAGING_SCANNER));
        expect(true).assertTrue(IMAGING_SCANNER == 0x0640);
        let IMAGING_PRINTER = bluetooth.MajorMinorClass.IMAGING_PRINTER;
        console.info("[bluetooth_js]IMAGING_PRINTER : " + JSON.stringify(IMAGING_PRINTER));
        expect(true).assertTrue(IMAGING_PRINTER == 0x0680);

        let WEARABLE_UNCATEGORIZED = bluetooth.MajorMinorClass.WEARABLE_UNCATEGORIZED;
        console.info("[bluetooth_js]WEARABLE_UNCATEGORIZED : " + JSON.stringify(WEARABLE_UNCATEGORIZED));
        expect(true).assertTrue(WEARABLE_UNCATEGORIZED == 0x0700);
        let WEARABLE_WRIST_WATCH = bluetooth.MajorMinorClass.WEARABLE_WRIST_WATCH;
        console.info("[bluetooth_js]WEARABLE_WRIST_WATCH : " + JSON.stringify(WEARABLE_WRIST_WATCH));
        expect(true).assertTrue(WEARABLE_WRIST_WATCH == 0x0704);
        let WEARABLE_PAGER = bluetooth.MajorMinorClass.WEARABLE_PAGER;
        console.info("[bluetooth_js]WEARABLE_PAGER : " + JSON.stringify(WEARABLE_PAGER));
        expect(true).assertTrue(WEARABLE_PAGER == 0x0708);
        let WEARABLE_JACKET = bluetooth.MajorMinorClass.WEARABLE_JACKET;
        console.info("[bluetooth_js]WEARABLE_JACKET : " + JSON.stringify(WEARABLE_JACKET));
        expect(true).assertTrue(WEARABLE_JACKET == 0x070C);
        let WEARABLE_HELMET = bluetooth.MajorMinorClass.WEARABLE_HELMET;
        console.info("[bluetooth_js]WEARABLE_HELMET : " + JSON.stringify(WEARABLE_HELMET));
        expect(true).assertTrue(WEARABLE_HELMET == 0x0710);
        let WEARABLE_GLASSES = bluetooth.MajorMinorClass.WEARABLE_GLASSES;
        console.info("[bluetooth_js]WEARABLE_GLASSES : " + JSON.stringify(WEARABLE_GLASSES));
        expect(true).assertTrue(WEARABLE_GLASSES == 0x0714);

        let TOY_UNCATEGORIZED = bluetooth.MajorMinorClass.TOY_UNCATEGORIZED;
        console.info("[bluetooth_js]TOY_UNCATEGORIZED : " + JSON.stringify(TOY_UNCATEGORIZED));
        expect(true).assertTrue(TOY_UNCATEGORIZED == 0x0800);
        let TOY_ROBOT = bluetooth.MajorMinorClass.TOY_ROBOT;
        console.info("[bluetooth_js]TOY_ROBOT : " + JSON.stringify(TOY_ROBOT));
        expect(true).assertTrue(TOY_ROBOT == 0x0804);
        let TOY_VEHICLE = bluetooth.MajorMinorClass.TOY_VEHICLE;
        console.info("[bluetooth_js]TOY_VEHICLE : " + JSON.stringify(TOY_VEHICLE));
        expect(true).assertTrue(TOY_VEHICLE == 0x0808);
        let TOY_DOLL_ACTION_FIGURE = bluetooth.MajorMinorClass.TOY_DOLL_ACTION_FIGURE;
        console.info("[bluetooth_js]TOY_DOLL_ACTION_FIGURE : " + JSON.stringify(TOY_DOLL_ACTION_FIGURE));
        expect(true).assertTrue(TOY_DOLL_ACTION_FIGURE == 0x080C);
        let TOY_CONTROLLER = bluetooth.MajorMinorClass.TOY_CONTROLLER;
        console.info("[bluetooth_js]TOY_CONTROLLER : " + JSON.stringify(TOY_CONTROLLER));
        expect(true).assertTrue(TOY_CONTROLLER == 0x0810);
        let TOY_GAME = bluetooth.MajorMinorClass.TOY_GAME;
        console.info("[bluetooth_js]TOY_GAME : " + JSON.stringify(TOY_GAME));
        expect(true).assertTrue(TOY_GAME == 0x0814);

        let HEALTH_UNCATEGORIZED = bluetooth.MajorMinorClass.HEALTH_UNCATEGORIZED;
        console.info("[bluetooth_js]HEALTH_UNCATEGORIZED : " + JSON.stringify(HEALTH_UNCATEGORIZED));
        expect(true).assertTrue(HEALTH_UNCATEGORIZED == 0x0900);
        let HEALTH_BLOOD_PRESSURE = bluetooth.MajorMinorClass.HEALTH_BLOOD_PRESSURE;
        console.info("[bluetooth_js]HEALTH_BLOOD_PRESSURE : " + JSON.stringify(HEALTH_BLOOD_PRESSURE));
        expect(true).assertTrue(HEALTH_BLOOD_PRESSURE == 0x0904);
        let HEALTH_THERMOMETER = bluetooth.MajorMinorClass.HEALTH_THERMOMETER;
        console.info("[bluetooth_js]HEALTH_THERMOMETER : " + JSON.stringify(HEALTH_THERMOMETER));
        expect(true).assertTrue(HEALTH_THERMOMETER == 0x0908);
        let HEALTH_WEIGHING = bluetooth.MajorMinorClass.HEALTH_WEIGHING;
        console.info("[bluetooth_js]HEALTH_WEIGHING : " + JSON.stringify(HEALTH_WEIGHING));
        expect(true).assertTrue(HEALTH_WEIGHING == 0x090C);
        let HEALTH_GLUCOSE = bluetooth.MajorMinorClass.HEALTH_GLUCOSE;
        console.info("[bluetooth_js]HEALTH_GLUCOSE : " + JSON.stringify(HEALTH_GLUCOSE));
        expect(true).assertTrue(HEALTH_GLUCOSE == 0x0910);
        let HEALTH_PULSE_OXIMETER = bluetooth.MajorMinorClass.HEALTH_PULSE_OXIMETER;
        console.info("[bluetooth_js]HEALTH_PULSE_OXIMETER : " + JSON.stringify(HEALTH_PULSE_OXIMETER));
        expect(true).assertTrue(HEALTH_PULSE_OXIMETER == 0x0914);
        let HEALTH_PULSE_RATE = bluetooth.MajorMinorClass.HEALTH_PULSE_RATE;
        console.info("[bluetooth_js]HEALTH_PULSE_RATE : " + JSON.stringify(HEALTH_PULSE_RATE));
        expect(true).assertTrue(HEALTH_PULSE_RATE == 0x0918);
        let HEALTH_DATA_DISPLAY = bluetooth.MajorMinorClass.HEALTH_DATA_DISPLAY;
        console.info("[bluetooth_js]HEALTH_DATA_DISPLAY : " + JSON.stringify(HEALTH_DATA_DISPLAY));
        expect(true).assertTrue(HEALTH_DATA_DISPLAY == 0x091C);
        let HEALTH_STEP_COUNTER = bluetooth.MajorMinorClass.HEALTH_STEP_COUNTER;
        console.info("[bluetooth_js]HEALTH_STEP_COUNTER : " + JSON.stringify(HEALTH_STEP_COUNTER));
        expect(true).assertTrue(HEALTH_STEP_COUNTER == 0x0920);
        let HEALTH_BODY_COMPOSITION_ANALYZER = bluetooth.MajorMinorClass.HEALTH_BODY_COMPOSITION_ANALYZER;
        console.info("[bluetooth_js]HEALTH_BODY_COMPOSITION_ANALYZER : " +
        JSON.stringify(HEALTH_BODY_COMPOSITION_ANALYZER));
        expect(true).assertTrue(HEALTH_BODY_COMPOSITION_ANALYZER == 0x0924);
        let HEALTH_PEAK_FLOW_MONITOR = bluetooth.MajorMinorClass.HEALTH_PEAK_FLOW_MONITOR;
        console.info("[bluetooth_js]HEALTH_PEAK_FLOW_MONITOR : " + JSON.stringify(HEALTH_PEAK_FLOW_MONITOR));
        expect(true).assertTrue(HEALTH_PEAK_FLOW_MONITOR == 0x0928);
        let HEALTH_MEDICATION_MONITOR = bluetooth.MajorMinorClass.HEALTH_MEDICATION_MONITOR;
        console.info("[bluetooth_js]HEALTH_MEDICATION_MONITOR : " +
        JSON.stringify(HEALTH_MEDICATION_MONITOR));
        expect(true).assertTrue(HEALTH_MEDICATION_MONITOR == 0x092C);
        let HEALTH_KNEE_PROSTHESIS = bluetooth.MajorMinorClass.HEALTH_KNEE_PROSTHESIS;
        console.info("[bluetooth_js]HEALTH_KNEE_PROSTHESIS : " + JSON.stringify(HEALTH_KNEE_PROSTHESIS));
        expect(true).assertTrue(HEALTH_KNEE_PROSTHESIS == 0x0930);
        let HEALTH_ANKLE_PROSTHESIS = bluetooth.MajorMinorClass.HEALTH_ANKLE_PROSTHESIS;
        console.info("[bluetooth_js]HEALTH_ANKLE_PROSTHESIS : " + JSON.stringify(HEALTH_ANKLE_PROSTHESIS));
        expect(true).assertTrue(HEALTH_ANKLE_PROSTHESIS == 0x0934);
        let HEALTH_GENERIC_HEALTH_MANAGER = bluetooth.MajorMinorClass.HEALTH_GENERIC_HEALTH_MANAGER;
        console.info("[bluetooth_js]HEALTH_GENERIC_HEALTH_MANAGER : " +
        JSON.stringify(HEALTH_GENERIC_HEALTH_MANAGER));
        expect(true).assertTrue(HEALTH_GENERIC_HEALTH_MANAGER == 0x0938);
        let HEALTH_PERSONAL_MOBILITY_DEVICE = bluetooth.MajorMinorClass.HEALTH_PERSONAL_MOBILITY_DEVICE;
        console.info("[bluetooth_js]HEALTH_PERSONAL_MOBILITY_DEVICE : " +
        JSON.stringify(HEALTH_PERSONAL_MOBILITY_DEVICE));
        expect(true).assertTrue(HEALTH_PERSONAL_MOBILITY_DEVICE == 0x093C);
        done()
    })

})
}