File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/adb/command/host-serial Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,17 @@ import Protocol from '../../protocol';
33import Bluebird from 'bluebird' ;
44
55export default class ForwardCommand extends Command < boolean > {
6- execute ( serial : string , local : string , remote : string ) : Bluebird < boolean > {
6+ execute ( serial : string , local : string , remote : string ) : Bluebird < number > {
77 this . _send ( `host-serial:${ serial } :forward:${ local } ;${ remote } ` ) ;
88 return this . parser . readAscii ( 4 ) . then ( ( reply ) => {
99 switch ( reply ) {
1010 case Protocol . OKAY :
1111 return this . parser . readAscii ( 4 ) . then ( ( reply ) => {
1212 switch ( reply ) {
1313 case Protocol . OKAY :
14- return true ;
14+ return this . parser . readValue ( ) . then ( ( buffer ) => {
15+ return Number ( buffer . toString ( ) ) ;
16+ } ) . catch ( _ => 0 ) ;
1517 case Protocol . FAIL :
1618 return this . parser . readError ( ) ;
1719 default :
You can’t perform that action at this time.
0 commit comments