From 9bd3d075105a074148997ca892daa42ddb22bf70 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 23 Apr 2009 09:02:06 +0000 Subject: [PATCH] implemented slip_arch_writeb() function --- platform/cooja/dev/rs232.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/platform/cooja/dev/rs232.c b/platform/cooja/dev/rs232.c index 15de5b200..3eb25b1a9 100644 --- a/platform/cooja/dev/rs232.c +++ b/platform/cooja/dev/rs232.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: rs232.c,v 1.3 2009/03/26 16:23:48 fros4943 Exp $ + * $Id: rs232.c,v 1.4 2009/04/23 09:02:06 fros4943 Exp $ */ #include "lib/sensors.h" @@ -68,6 +68,12 @@ rs232_print(char *message) printf("%s", message); } /*-----------------------------------------------------------------------------------*/ +void +slip_arch_writeb(unsigned char c) +{ + simlog_char(c); +} +/*-----------------------------------------------------------------------------------*/ static void doInterfaceActionsBeforeTick(void) { @@ -83,19 +89,19 @@ doInterfaceActionsBeforeTick(void) return; } - /* Notify rs232 handler */ + /* Notify specified rs232 handler */ if(input_handler != NULL) { for (i=0; i < simSerialReceivingLength; i++) { input_handler(simSerialReceivingData[i]); } + } else { + /* Notify serial process */ + for (i=0; i < simSerialReceivingLength; i++) { + serial_line_input_byte(simSerialReceivingData[i]); + } + serial_line_input_byte(0x0a); } - /* Notify serial process */ - for (i=0; i < simSerialReceivingLength; i++) { - serial_line_input_byte(simSerialReceivingData[i]); - } - serial_line_input_byte(0x0a); - simSerialReceivingLength = 0; simSerialReceivingFlag = 0; }