import { BLE } from '@ionic-native/ble' ; import { Observable } from 'rxjs/Observable' ; import { Observer } from 'rxjs/Observer' ; export class BLEMock extends BLE { usage param { string [ ] } services param { number } seconds returns { Observable < any > } scan ( services , seconds ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } ; usage param { string [ ] } services returns { Observable < any > } startScan ( services ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } param { string [ ] } services param options { any } returns { Observable < any > } startScanWithOptions ( services , options ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } usage return stopScan ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } usage param deviceId { string } return usage param deviceId { string } return connect ( deviceId ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } usage param deviceId { string } return disconnect ( deviceId ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } ; param { string } deviceId param { string } serviceUUID param { string } characteristicUUID return read ( deviceId , serviceUUID , characteristicUUID ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } ; usage param { string } deviceId param { string } serviceUUID param { string } characteristicUUID param { ArrayBuffer } value return write ( deviceId , serviceUUID , characteristicUUID , value ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } param { string } deviceId param { string } serviceUUID param { string } characteristicUUID param { ArrayBuffer } value return writeWithoutResponse ( deviceId , serviceUUID , characteristicUUID , value ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } usage param { string } deviceId param { string } serviceUUID param { string } characteristicUUID return startNotification ( deviceId , serviceUUID , characteristicUUID ) { return Observable . create ( ( observer ) => { observer . next ( '' ) ; observer . complete ( ) ; } ) ; } param { string } deviceId param { string } serviceUUID param { string } characteristicUUID returns { Promise < any > } stopNotification ( deviceId , serviceUUID , characteristicUUID ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } usage param { string } deviceId returns { Promise < any > } isConnected ( deviceId ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < void > } isEnabled ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } showBluetoothSettings ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } returns { Promise < any > } enable ( ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } static readRSSI ( deviceId ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } }