]> Git Repo - serial.git/commitdiff
Read has been informally tested to work.
authorWilliam Woodall <[email protected]>
Mon, 21 Mar 2011 13:06:14 +0000 (08:06 -0500)
committerWilliam Woodall <[email protected]>
Mon, 21 Mar 2011 13:06:14 +0000 (08:06 -0500)
src/test_serial.cpp

index a056c0f2e011e457c7b7109829b5cc823a6ae621..321e8339384cf3b8c67dcf74709037318fce17d2 100644 (file)
@@ -27,15 +27,16 @@ int main(int argc, char **argv)
     std::string port("/dev/tty.usbserial-A900cfJA");
     // std::string port("/dev/tty.usbmodemfa141");
     
-    serial = new Serial(port, 9600, 250);
+    serial = new Serial(port, 115200, 250);
     
     int count = 0;
-    while (count != 30) {
-        // serial->write("Testing.");
-        std::string result = serial->read(1);
-        std::cout << ">" << result << std::endl;
+    while (count >= 0) {
+        int bytes_wrote = serial->write("Testing.");
+        std::string result = serial->read(8);
+        if(count % 10 == 0)
+            std::cout << ">" << count << ">" << bytes_wrote << ">" << result << std::endl;
         
-        // count += 1;
+        count += 1;
     }
     
     return 0;
This page took 0.02778 seconds and 4 git commands to generate.