USBSerial echo example

Dependencies:   mbed USBDevice

Revision:
5:fa2fa6aa36b1
Parent:
4:583cafe16ec7
Child:
7:6372a14f105d
--- a/main.cpp	Thu Nov 17 12:01:32 2011 +0000
+++ b/main.cpp	Thu Nov 17 16:36:00 2011 +0000
@@ -6,17 +6,11 @@
 Serial pc(USBTX, USBRX);
 
 int main(void) {
-    char buf[128];
-    char echo[128];
+    uint8_t buf[128];
     while(1)
     {
         serial.scanf("%s", buf);
-        
-        // build the echo response
-        sprintf(echo, "recv: %s\r\n", buf);
-        
-        //send to the virtual serial port and the mbed serial port
-        serial.print(echo);
-        pc.printf("%s", echo);
+        serial.printf("recv: %s\r\n", buf);
+        pc.printf("recv: %s\r\n", buf);
     }
 }