Lines Matching refs:gattServer

62 3. 连接gattServer
63 4. 读取gattServer的特征值和描述符。
64 5. 向gattServer写入特征值和描述符。
359 2. 创建gattServer实例对象。
361 4. 当向gattServer写入特征值通知gattClient。
363 6. 注销gattServer实例。
374 gattServer: ble.GattServer | undefined = undefined;
416 if (!this.gattServer) {
417 console.error(TAG, 'no gattServer');
421 this.gattServer.on('connectionStateChange', (stateInfo: ble.BLEConnectionChangeState) => {
460 this.gattServer = ble.createGattServer(); // 2.1 构造gattServer,后续的交互都需要使用该实例
462 this.gattServer.addService(gattService);
470 if (!this.gattServer) {
471 console.error(TAG, 'no gattServer');
477 this.gattServer.on('characteristicRead', (charReq: ble.CharacteristicReadRequest) => {
495 this.gattServer.sendResponse(serverResponse);
507 if (!this.gattServer) {
508 console.error(TAG, 'no gattServer');
514 this.gattServer.on('characteristicWrite', (charReq: ble.CharacteristicWriteRequest) => {
532 this.gattServer.sendResponse(serverResponse);
544 if (!this.gattServer) {
545 console.error(TAG, 'no gattServer');
551 this.gattServer.on('descriptorRead', (desReq: ble.DescriptorReadRequest) => {
569 this.gattServer.sendResponse(serverResponse);
581 if (!this.gattServer) {
582 console.error(TAG, 'no gattServer');
588 this.gattServer.on('descriptorWrite', (desReq: ble.DescriptorWriteRequest) => {
606 this.gattServer.sendResponse(serverResponse);
618 if (!this.gattServer) {
619 console.error(TAG, 'no gattServer');
625 this.gattServer.removeService(this.myServiceUuid); // 7.1 删除服务
626 …this.gattServer.off('connectionStateChange', (stateInfo: ble.BLEConnectionChangeState) => { // 7.2…
628 this.gattServer.close() // 7.3 如果不再使用此gattServer,则需要close