Patch: Add ECHO DLCI to sercomm

Christian Vogel vogelchr at vogel.cx
Tue Apr 13 19:49:42 UTC 2010


Hi,

this patch adds a new DLCI, Numbered 11, which just echoes
whatever it recveices on the mobile back to the PC. It is
very useful for debugging serial port problems.

	Chris
-------------- next part --------------
commit 787a9f109aa5f9d9e089c179ac02651035a158bc
Author: Christian Vogel <vogelchr at vogel.cx>
Date:   Tue Apr 13 21:18:32 2010 +0200

    Added a ECHO DLCI that just sends all the data back from the mobile to the PC.

diff --git a/src/target/firmware/comm/sercomm.c b/src/target/firmware/comm/sercomm.c
index 505de70..b6bda50 100644
--- a/src/target/firmware/comm/sercomm.c
+++ b/src/target/firmware/comm/sercomm.c
@@ -85,6 +85,11 @@ void sercomm_init(void)
 
 	sercomm.rx.msg = NULL;
 	sercomm.initialized = 1;
+
+#ifndef HOST_BUILD
+       /* Enable sending back ECHO only on the target! */
+       sercomm_register_rx_cb(SC_DLCI_ECHO,&sercomm_sendmsg);
+#endif
 }
 
 int sercomm_initialized(void)
diff --git a/src/target/firmware/include/comm/sercomm.h b/src/target/firmware/include/comm/sercomm.h
index 45a1e99..c8963a3 100644
--- a/src/target/firmware/include/comm/sercomm.h
+++ b/src/target/firmware/include/comm/sercomm.h
@@ -21,6 +21,7 @@ enum sercomm_dlci {
 	SC_DLCI_L1A_L23 = 5,
 	SC_DLCI_LOADER  = 9,
 	SC_DLCI_CONSOLE = 10,
+	SC_DLCI_ECHO = 11,
 	_SC_DLCI_MAX
 };
 


More information about the baseband-devel mailing list