INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
serialconnectivity.h00001 /* 00002 * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics 00003 * http://gearbox.sf.net/ 00004 * Copyright (c) 2004-2010 Michael Moser 00005 * 00006 * This distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 namespace gbxserialacfr{ 00011 class Serial; 00012 } 00013 00014 // test connectivity to a [serial] device at a [baudrate]; 00015 // Assumes that you can figure out a [challenge] (command ...) to 00016 // which the device will answer with a unique [ack] in [timeOutMsec] milliseconds. 00017 // If [successThresh] or more [challenge]es are answered by an [ack] 00018 // 00019 // Limitations: amount of data expected before timeOutMsec should be 00020 // reasonably small 00021 // 00022 // returns true for Success; false for failure 00023 namespace gbxnovatelutilacfr{ 00024 bool testConnectivity( 00025 std::string &challenge, 00026 std::string &ack, 00027 gbxserialacfr::Serial& serial, 00028 int timeOutMsec, 00029 int numTry, 00030 int successThresh, 00031 int baudrate); 00032 00033 // send a [challenge] (command ...) to 00034 // which the device will answer with a unique [ack] in [timeOutMsec] milliseconds. 00035 // 00036 // Limitations: amount of data expected before timeOutMsec should be 00037 // reasonably small 00038 // 00039 // returns true for Success (i.e. ack received in time), 00040 // false for failure, in case of failure errorResponse contains the reply from the receiver 00041 bool sendCmdWaitForResponse( 00042 std::string &challenge, 00043 std::string &ack, 00044 std::string &errorResponse, 00045 gbxserialacfr::Serial& serial, 00046 int timeOutMsec); 00047 } |