Lines Matching refs:gattClient
63 2. Create a **gattClient** instance.
67 6. Disconnect from the server and destroy the **gattClient** instance.
80 gattClient: ble.GattClientDevice = undefined;
164 if (!this.gattClient) {
165 console.error(TAG, 'no gattClient');
169 … this.gattClient.on('BLEConnectionStateChange', (stateInfo: ble.BLEConnectionChangeState) => {
206 … // 2.1 Use device to construct gattClient. This instance is used for subsequent interactions.
207 this.gattClient = ble.createGattClientDevice(peerDevice);
210 this.gattClient.connect(); // 2.3 Initiate a connection.
218 if (!this.gattClient) {
219 console.info(TAG, 'no gattClient');
224 this.gattClient.getServices().then((result: Array<ble.GattService>) => {
235 … if (!this.gattClient || this.connectState != constant.ProfileConnectionState.STATE_CONNECTED) {
236 console.error(TAG, 'no gattClient or not connected');
247 … this.gattClient.readCharacteristicValue(characteristic).then((outData: ble.BLECharacteristic) => {
257 … if (!this.gattClient || this.connectState != constant.ProfileConnectionState.STATE_CONNECTED) {
258 console.error(TAG, 'no gattClient or not connected');
269 … this.gattClient.writeCharacteristicValue(characteristic, ble.GattWriteType.WRITE, (err) => {
283 … if (!this.gattClient || this.connectState != constant.ProfileConnectionState.STATE_CONNECTED) {
284 console.error(TAG, 'no gattClient or not connected');
296 this.gattClient.readDescriptorValue(descriptor).then((outData: ble.BLEDescriptor) => {
306 … if (!this.gattClient || this.connectState != constant.ProfileConnectionState.STATE_CONNECTED) {
307 console.error(TAG, 'no gattClient or not connected');
322 this.gattClient.writeDescriptorValue(descriptor, (err) => {
336 … if (!this.gattClient || this.connectState != constant.ProfileConnectionState.STATE_CONNECTED) {
337 console.error(TAG, 'no gattClient or not connected');
343 this.gattClient.disconnect (); // 8.1 Disconnect from the server.
344 … this.gattClient.off('BLEConnectionStateChange', (stateInfo: ble.BLEConnectionChangeState) => {
346 this.gattClient.close () // 8.2 Close this gattClient if it is no longer required.
472 // 3. Subscribe to the characteristic read requests from the gattClient.
509 // 4. Subscribe to the characteristic write requests from the gattClient.
546 // 5. Subscribe to the descriptor read requests from the gattClient.
583 // 6. Subscribe to the descriptor write requests from the gattClient.