Hide or remove logging (#523)

* Hide or remove logging

* Remote dmsg
This commit is contained in:
Sam El-Husseini 2018-04-15 19:36:10 -07:00 committed by GitHub
parent be207282e3
commit e43837d358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 33 deletions

View File

@ -48,19 +48,12 @@ namespace pxsim {
let v = "vSIM" let v = "vSIM"
for (let i = 0; i < buf.data.length; ++i) for (let i = 0; i < buf.data.length; ++i)
buf.data[i] = v.charCodeAt(i) || 0 buf.data[i] = v.charCodeAt(i) || 0
console.log("analog read");
console.log(buf.data);
return buf.data.length return buf.data.length
}, },
write: buf => { write: buf => {
console.log("analog write");
console.log(buf);
return 2 return 2
}, },
ioctl: (id, buf) => { ioctl: (id, buf) => {
console.log("analog ioctl");
console.log(id);
console.log(buf);
return 2; return 2;
} }
}) })

View File

@ -85,7 +85,7 @@ namespace pxsim.control {
} }
export function dmesg(s: string) { export function dmesg(s: string) {
console.log("DMESG: " + s) //console.log("DMESG: " + s)
} }
} }

View File

@ -35,21 +35,14 @@ namespace pxsim {
let v = "vSIM" let v = "vSIM"
for (let i = 0; i < buf.data.length; ++i) for (let i = 0; i < buf.data.length; ++i)
buf.data[i] = v.charCodeAt(i) || 0 buf.data[i] = v.charCodeAt(i) || 0
console.log("motor read");
console.log(buf.data);
return buf.data.length return buf.data.length
}, },
write: buf => { write: buf => {
if (buf.data.length == 0) return 2; if (buf.data.length == 0) return 2;
const cmd = buf.data[0]; const cmd = buf.data[0];
console.log("motor write");
console.log(buf);
return 2 return 2
}, },
ioctl: (id, buf) => { ioctl: (id, buf) => {
console.log("motor ioctl");
console.log(id);
console.log(buf);
return 2; return 2;
} }
}); });

View File

@ -38,7 +38,6 @@ namespace pxsim {
switch (cmd) { switch (cmd) {
case DAL.opProgramStart: { case DAL.opProgramStart: {
// init // init
console.log('init');
return 2; return 2;
} }
case DAL.opOutputReset: { case DAL.opOutputReset: {
@ -133,15 +132,9 @@ namespace pxsim {
console.warn('unknown cmd: ' + cmd); console.warn('unknown cmd: ' + cmd);
break; break;
} }
console.log("pwm write");
console.log(buf);
return 2 return 2
}, },
ioctl: (id, buf) => { ioctl: (id, buf) => {
console.log("pwm ioctl");
console.log(id);
console.log(buf);
return 2; return 2;
} }
}); });

View File

@ -101,32 +101,28 @@ namespace pxsim {
let v = "vSIM" let v = "vSIM"
// for (let i = 0; i < buf.data.length; ++i) // for (let i = 0; i < buf.data.length; ++i)
// buf.data[i] = v.charCodeAt(i) || 0 // buf.data[i] = v.charCodeAt(i) || 0
console.log("uart read");
console.log(buf.data);
return buf.data.length return buf.data.length
}, },
write: buf => { write: buf => {
console.log("uart write");
console.log(buf);
return 2 return 2
}, },
ioctl: (id, buf) => { ioctl: (id, buf) => {
switch (id) { switch (id) {
case IO.UART_SET_CONN: { case IO.UART_SET_CONN: {
// Set mode // Set mode
console.log("IO.UART_SET_CONN"); //console.log("IO.UART_SET_CONN");
for (let port = 0; port < DAL.NUM_INPUTS; port++) { for (let port = 0; port < DAL.NUM_INPUTS; port++) {
const connection = buf.data[DevConOff.Connection + port]; // CONN_NONE, CONN_INPUT_UART const connection = buf.data[DevConOff.Connection + port]; // CONN_NONE, CONN_INPUT_UART
const type = buf.data[DevConOff.Type + port]; const type = buf.data[DevConOff.Type + port];
const mode = buf.data[DevConOff.Mode + port]; const mode = buf.data[DevConOff.Mode + port];
console.log(`${port}, mode: ${mode}`) //console.log(`${port}, mode: ${mode}`)
const node = ev3board().getInputNodes()[port]; const node = ev3board().getInputNodes()[port];
if (node) node.setMode(mode); if (node) node.setMode(mode);
} }
return 2; return 2;
} }
case IO.UART_CLEAR_CHANGED: { case IO.UART_CLEAR_CHANGED: {
console.log("IO.UART_CLEAR_CHANGED") //console.log("IO.UART_CLEAR_CHANGED")
for (let port = 0; port < DAL.NUM_INPUTS; port++) { for (let port = 0; port < DAL.NUM_INPUTS; port++) {
const connection = buf.data[DevConOff.Connection + port]; // CONN_NONE, CONN_INPUT_UART const connection = buf.data[DevConOff.Connection + port]; // CONN_NONE, CONN_INPUT_UART
const type = buf.data[DevConOff.Type + port]; const type = buf.data[DevConOff.Type + port];
@ -137,7 +133,7 @@ namespace pxsim {
return 2; return 2;
} }
case IO.UART_READ_MODE_INFO: { case IO.UART_READ_MODE_INFO: {
console.log("IO.UART_READ_MODE_INFO") //console.log("IO.UART_READ_MODE_INFO")
const port = buf.data[UartCtlOff.Port]; const port = buf.data[UartCtlOff.Port];
const mode = buf.data[UartCtlOff.Mode]; const mode = buf.data[UartCtlOff.Mode];
const node = ev3board().getInputNodes()[port]; const node = ev3board().getInputNodes()[port];
@ -145,9 +141,6 @@ namespace pxsim {
return 2; return 2;
} }
} }
console.log("uart ioctl");
console.log(id);
console.log(buf);
return 2; return 2;
} }
}) })