@@ -35,12 +35,11 @@ function RawSerialInNode(n) {
3535 if ( this . splitc == '\\n' ) this . splitc = "\n" ;
3636 if ( this . splitc == '\\r' ) this . splitc = "\r" ;
3737 if ( ! isNaN ( parseInt ( this . splitc ) ) ) { this . splitc = parseInt ( this . splitc ) ; }
38- console . log ( "Split is" , this . out , this . splitc ) ;
3938 var node = this ;
4039
4140 var setupSerial = function ( ) {
4241 node . inp = fs . createReadStream ( pre + node . port ) ;
43- node . log ( "opened " + pre + node . port ) ;
42+ node . log ( "open " + pre + node . port ) ;
4443 node . tout = null ;
4544 var line = "" ;
4645 var buf = new Buffer ( 32768 ) ;
@@ -83,14 +82,14 @@ function RawSerialInNode(n) {
8382 } ) ;
8483 //node.inp.on('end', function (error) {console.log("End", error);});
8584 node . inp . on ( 'close' , function ( error ) {
86- util . log ( "[rawserial] " + node . port + " closed" ) ;
85+ node . log ( node . port + " closed" ) ;
8786 node . tout = setTimeout ( function ( ) {
8887 setupSerial ( ) ;
8988 } , settings . serialReconnectTime ) ;
9089 } ) ;
9190 node . inp . on ( 'error' , function ( error ) {
92- if ( error . code == "ENOENT" ) { util . log ( "[rawserial] port " + node . port + " not found" ) ; }
93- else { util . log ( "[rawserial] " + node . port + " error " + error ) ; }
91+ if ( error . code == "ENOENT" ) { node . log ( node . port + " not found" ) ; }
92+ else { node . log ( node . port + " error " + error ) ; }
9493 node . tout = setTimeout ( function ( ) {
9594 setupSerial ( ) ;
9695 } , settings . serialReconnectTime ) ;
@@ -119,18 +118,18 @@ function RawSerialOutNode(n) {
119118 node . oup . write ( msg . payload ) ;
120119 }
121120 } ) ;
122- node . oup . on ( 'open' , function ( error ) { util . log ( "[rawserial] opened " + node . port ) ; } ) ;
123- node . oup . on ( 'end' , function ( error ) { console . log ( "End" , error ) ; } ) ;
121+ node . oup . on ( 'open' , function ( error ) { node . log ( "opened " + node . port ) ; } ) ;
122+ node . oup . on ( 'end' , function ( error ) { node . log ( "end :" + error ) ; } ) ;
124123 node . oup . on ( 'close' , function ( error ) {
125- util . log ( "[rawserial] " + node . port + " closed" ) ;
124+ node . log ( node . port + " closed" ) ;
126125 node . tout = setTimeout ( function ( ) {
127126 setupSerial ( ) ;
128127 } , settings . serialReconnectTime ) ;
129128 } ) ;
130129 node . oup . on ( 'error' , function ( error ) {
131- if ( error . code == "EACCES" ) { util . log ( "[rawserial] can't access port " + node . port ) ; }
132- else if ( error . code == "EIO" ) { util . log ( "[rawserial] can't write to port " + node . port ) ; }
133- else { util . log ( "[rawserial] " + node . port + " error " + error ) ; }
130+ if ( error . code == "EACCES" ) { node . log ( "can't access port " + node . port ) ; }
131+ else if ( error . code == "EIO" ) { node . log ( "can't write to port " + node . port ) ; }
132+ else { node . log ( node . port + " error " + error ) ; }
134133 node . tout = setTimeout ( function ( ) {
135134 setupSerial ( ) ;
136135 } , settings . serialReconnectTime ) ;
0 commit comments