diff --git a/src/plugins/bluetoothserial.ts b/src/plugins/bluetoothserial.ts index 5a784de760..4bec47e625 100644 --- a/src/plugins/bluetoothserial.ts +++ b/src/plugins/bluetoothserial.ts @@ -16,29 +16,27 @@ export class BluetoothSerial { /** * Connect to a Bluetooth device + * Returns an Observable. Subscribe to connect, unsubscribe to disconnect. * @param macAddress_or_uuid Identifier of the remote device */ @Cordova({ - platforms: ['Android', 'iOS', 'Windows Phone'] + platforms: ['Android', 'iOS', 'Windows Phone'], + observable: true, + clearFunction: 'disconnect' }) - static connect (macAddress_or_uuid: string): Promise {return; } + static connect (macAddress_or_uuid: string): Observable {return; } /** * Connect insecurely to a Bluetooth device + * Returns an Observable. Subscribe to connect, unsubscribe to disconnect. * @param macAddress Identifier of the remote device */ @Cordova({ - platforms: ['Android'] - }) - static connectInsecure (macAddress: string): Promise {return; } - - /** - * Disconnect - */ - @Cordova({ - platforms: ['Android', 'iOS', 'Windows Phone'] + platforms: ['Android'], + observable: true, + clearFunction: 'disconnect' }) - static disconnect (): Promise {return; } + static connectInsecure (macAddress: string): Observable {return; } /** * Writes data to the serial port