Skip to content

Commit

Permalink
fix(serial): Serial.requestPermission() options are optional (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkem authored and ihadeed committed Mar 2, 2017
1 parent 0c466d9 commit da72500
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/plugins/serial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ export interface SerialOpenOptions {
* ```
* import { Serial } from 'ionic-native';
*
* Serial.requestPermission({
* vid: '0403',
* pid: '6001',
* driver: 'FtdiSerialDriver'
* }).then(() => {
* Serial.requestPermission().then(() => {
* Serial.open({
* baudRate: 38400
* baudRate: 9800
* }).then(() => {
* console.log('Serial connection opened');
* });
Expand All @@ -49,11 +45,11 @@ export class Serial {
/**
* Request permission to connect to a serial device
*
* @param options {SerialPermissionOptions} Options used to request serial permissions
* @param options {SerialPermissionOptions} Options used to request serial permissions for an unknown device
* @return {Promise<any>} Returns a promise that resolves when permissions are granted
*/
@Cordova()
static requestPermission(options: SerialPermissionOptions): Promise<any> { return; }
static requestPermission(options?: SerialPermissionOptions): Promise<any> { return; }

/**
* Open connection to a serial device
Expand Down

0 comments on commit da72500

Please sign in to comment.