From: <gb...@us...> - 2008-06-23 18:47:56
|
Revision: 204 http://gearbox.svn.sourceforge.net/gearbox/?rev=204&view=rev Author: gbiggs Date: 2008-06-23 11:47:22 -0700 (Mon, 23 Jun 2008) Log Message: ----------- Minor changes for Alex Brooks' comments Modified Paths: -------------- gearbox/trunk/submitted/flexiport/flexiport.h gearbox/trunk/submitted/flexiport/logreaderport.h gearbox/trunk/submitted/flexiport/test/example.readme gearbox/trunk/submitted/flexiport/test/serial_example.cpp gearbox/trunk/submitted/urg_nz/test/example.readme Modified: gearbox/trunk/submitted/flexiport/flexiport.h =================================================================== --- gearbox/trunk/submitted/flexiport/flexiport.h 2008-06-23 02:26:41 UTC (rev 203) +++ gearbox/trunk/submitted/flexiport/flexiport.h 2008-06-23 18:47:22 UTC (rev 204) @@ -4,17 +4,17 @@ * Copyright (c) 2008 Geoffrey Biggs * * flexiport flexible hardware data communications library. - * - * This distribution is licensed to you under the terms described in the LICENSE file included in + * + * This distribution is licensed to you under the terms described in the LICENSE file included in * this distribution. * * This work is a product of the National Institute of Advanced Industrial Science and Technology, * Japan. Registration number: ___ - * + * * This file is part of flexiport. * * flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU - * Lesser General Public License as published by the Free Software Foundation, either version 3 of + * Lesser General Public License as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without @@ -87,8 +87,7 @@ /** @brief Overloaded factory function. Accepts options as a string. -This overload accepts the options as a string, similar in format to command-line options. For -example: +This overload accepts the options as a string. For example: "type=serial device=/dev/ttyS0 baudrate=4800 readwrite" Options may be separated by any of: spaces, tabs, new lines or commas. Do not put whitespace around an equals sign. Modified: gearbox/trunk/submitted/flexiport/logreaderport.h =================================================================== --- gearbox/trunk/submitted/flexiport/logreaderport.h 2008-06-23 02:26:41 UTC (rev 203) +++ gearbox/trunk/submitted/flexiport/logreaderport.h 2008-06-23 18:47:22 UTC (rev 204) @@ -4,17 +4,17 @@ * Copyright (c) 2008 Geoffrey Biggs * * flexiport flexible hardware data communications library. - * - * This distribution is licensed to you under the terms described in the LICENSE file included in + * + * This distribution is licensed to you under the terms described in the LICENSE file included in * this distribution. * * This work is a product of the National Institute of Advanced Industrial Science and Technology, * Japan. Registration number: ___ - * + * * This file is part of flexiport. * * flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU - * Lesser General Public License as published by the Free Software Foundation, either version 3 of + * Lesser General Public License as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without @@ -43,7 +43,7 @@ class LogFile; /** @brief Simulated port using a log file. - + Uses a log file created by the @ref LogWriterPort port type to simulate the data transfer over a @ref Port object. @@ -51,7 +51,7 @@ @par Options - file <string> - - File name to save the log to. Two files will be created using this name and a suffix. + - File name to read the log from. Two files will be created using this name and a suffix. - Default: port.log - ignoretimes - Ignore time stamps in the log files. This means that all readable data is available instantly. Modified: gearbox/trunk/submitted/flexiport/test/example.readme =================================================================== --- gearbox/trunk/submitted/flexiport/test/example.readme 2008-06-23 02:26:41 UTC (rev 203) +++ gearbox/trunk/submitted/flexiport/test/example.readme 2008-06-23 18:47:22 UTC (rev 204) @@ -45,3 +45,11 @@ a timeout. e.g.: tcp_example -o timeout=1,debug=3 + +Note for Windows users +---------------------- + +Because Windows lacks a readily-available implementation of getopt, command line +options are not available for the examples on this platform. Hard-coded options +will be used instead; change them in the source file and recompile if you need +to change the port options. Modified: gearbox/trunk/submitted/flexiport/test/serial_example.cpp =================================================================== --- gearbox/trunk/submitted/flexiport/test/serial_example.cpp 2008-06-23 02:26:41 UTC (rev 203) +++ gearbox/trunk/submitted/flexiport/test/serial_example.cpp 2008-06-23 18:47:22 UTC (rev 204) @@ -4,17 +4,17 @@ * Copyright (c) 2008 Geoffrey Biggs * * flexiport flexible hardware data communications library. - * - * This distribution is licensed to you under the terms described in the LICENSE file included in + * + * This distribution is licensed to you under the terms described in the LICENSE file included in * this distribution. * * This work is a product of the National Institute of Advanced Industrial Science and Technology, * Japan. Registration number: ___ - * + * * This file is part of flexiport. * * flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU - * Lesser General Public License as published by the Free Software Foundation, either version 3 of + * Lesser General Public License as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without @@ -58,11 +58,10 @@ string portOptions = "type=serial,device=/dev/ttyS0,timeout=1"; #if defined (WIN32) - device = "COM1"; - portOptions = "timeout=1"; + portOptions = "type=serial,device=COM1,timeout=1"; #else // Get some options from the command line - while ((opt = getopt (argc, argv, "d:o:")) != -1) + while ((opt = getopt (argc, argv, "o:")) != -1) { switch (opt) { @@ -92,7 +91,7 @@ port->Open (); port->Flush (); cout << port->GetStatus (); - + cout << "Writing data to port, should read same data back." << endl; string stringMessage = "Message #1"; cout << "Writing 'Message #1' using WriteString()" << endl; @@ -217,7 +216,7 @@ cout << "Writing 'Finally, message #6\\n'" << endl; char charMessage4[] = "Finally, message #6\n"; - if (port->Write (charMessage4, strlen (charMessage4)) != static_cast<int> (strlen (charMessage4))) + if (port->Write (charMessage4, strlen (charMessage4)) != static_cast<int> (strlen (charMessage4))) { cout << "Test failed: did not write enough bytes." << endl; return 1; Modified: gearbox/trunk/submitted/urg_nz/test/example.readme =================================================================== --- gearbox/trunk/submitted/urg_nz/test/example.readme 2008-06-23 02:26:41 UTC (rev 203) +++ gearbox/trunk/submitted/urg_nz/test/example.readme 2008-06-23 18:47:22 UTC (rev 204) @@ -38,3 +38,11 @@ See the LogReaderPort object documentation for more options that can be used with log file pairs. See the LogWriterPort object documentation for details on how to make your own log file pair for testing your programs. + +Note for Windows users +---------------------- + +Because Windows lacks a readily-available implementation of getopt, command line +options are not available for the example on this platform. Hard-coded options +will be used instead; change them in the source file and recompile if you need +to change the port options. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |