Skip to content

Commit

Permalink
fix(Bluetooth): make connect function an observable to maintain full …
Browse files Browse the repository at this point in the history
…functionality

closes #154
  • Loading branch information
ihadeed committed May 13, 2016
1 parent ddbd64d commit 58e3f0b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/plugins/bluetoothserial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> {return; }
static connect (macAddress_or_uuid: string): Observable<any> {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<any> {return; }

/**
* Disconnect
*/
@Cordova({
platforms: ['Android', 'iOS', 'Windows Phone']
platforms: ['Android'],
observable: true,
clearFunction: 'disconnect'
})
static disconnect (): Promise<any> {return; }
static connectInsecure (macAddress: string): Observable<any> {return; }

/**
* Writes data to the serial port
Expand Down

0 comments on commit 58e3f0b

Please sign in to comment.