@@ -35,12 +35,11 @@ function RawSerialInNode(n) {
35
35
if ( this . splitc == '\\n' ) this . splitc = "\n" ;
36
36
if ( this . splitc == '\\r' ) this . splitc = "\r" ;
37
37
if ( ! isNaN ( parseInt ( this . splitc ) ) ) { this . splitc = parseInt ( this . splitc ) ; }
38
- console . log ( "Split is" , this . out , this . splitc ) ;
39
38
var node = this ;
40
39
41
40
var setupSerial = function ( ) {
42
41
node . inp = fs . createReadStream ( pre + node . port ) ;
43
- node . log ( "opened " + pre + node . port ) ;
42
+ node . log ( "open " + pre + node . port ) ;
44
43
node . tout = null ;
45
44
var line = "" ;
46
45
var buf = new Buffer ( 32768 ) ;
@@ -83,14 +82,14 @@ function RawSerialInNode(n) {
83
82
} ) ;
84
83
//node.inp.on('end', function (error) {console.log("End", error);});
85
84
node . inp . on ( 'close' , function ( error ) {
86
- util . log ( "[rawserial] " + node . port + " closed" ) ;
85
+ node . log ( node . port + " closed" ) ;
87
86
node . tout = setTimeout ( function ( ) {
88
87
setupSerial ( ) ;
89
88
} , settings . serialReconnectTime ) ;
90
89
} ) ;
91
90
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 ) ; }
94
93
node . tout = setTimeout ( function ( ) {
95
94
setupSerial ( ) ;
96
95
} , settings . serialReconnectTime ) ;
@@ -119,18 +118,18 @@ function RawSerialOutNode(n) {
119
118
node . oup . write ( msg . payload ) ;
120
119
}
121
120
} ) ;
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 ) ; } ) ;
124
123
node . oup . on ( 'close' , function ( error ) {
125
- util . log ( "[rawserial] " + node . port + " closed" ) ;
124
+ node . log ( node . port + " closed" ) ;
126
125
node . tout = setTimeout ( function ( ) {
127
126
setupSerial ( ) ;
128
127
} , settings . serialReconnectTime ) ;
129
128
} ) ;
130
129
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 ) ; }
134
133
node . tout = setTimeout ( function ( ) {
135
134
setupSerial ( ) ;
136
135
} , settings . serialReconnectTime ) ;
0 commit comments