Added support for transmitting a string.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Mon, 22 Jun 2009 08:06:27 +0000 (08:06 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Mon, 22 Jun 2009 08:06:27 +0000 (08:06 +0000)
There's no termination, instead the length is transmitted.

git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@49 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

firmware/goodfet.c
firmware/lib/command.c

index a8d5b7a..d993167 100644 (file)
@@ -65,8 +65,10 @@ int main(void)
   \r
   init();\r
   \r
   \r
   init();\r
   \r
+  \r
   //Ready\r
   //Ready\r
-  txdata(MONITOR,OK,0);\r
+  //txdata(MONITOR,OK,0);\r
+  txstring(MONITOR,OK,"http://goodfet.sf.net/");\r
   \r
   //Command loop.  There's no end!\r
   while(1){\r
   \r
   //Command loop.  There's no end!\r
   while(1){\r
index cc6e687..c572a1d 100644 (file)
@@ -2,6 +2,18 @@
 
 unsigned char cmddata[256];
 
 
 unsigned char cmddata[256];
 
+//! Transmit a string.
+void txstring(unsigned char app,
+             unsigned char verb,
+             const char *str){
+  unsigned char len=strlen(str);
+  serial_tx(app);
+  serial_tx(verb);
+  serial_tx(len);
+  while(len--)
+    serial_tx(*(str++));
+}
+
 //! Transmit data.
 void txdata(unsigned char app,
            unsigned char verb,
 //! Transmit data.
 void txdata(unsigned char app,
            unsigned char verb,