INTRODUCTION
Overview
Download and Install
Documentation
Publications
REPOSITORY
Libraries
DEVELOPER
Dev Guide
Dashboard
PEOPLE
Contributors
Users
Project
Download
Mailing lists
src
gbxnovatelacfr
gbxnovatelutilacfr
serialconnectivity.h
1
/*
2
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
3
* http://gearbox.sf.net/
4
* Copyright (c) 2004-2010 Michael Moser
5
*
6
* This distribution is licensed to you under the terms described in
7
* the LICENSE file included in this distribution.
8
*
9
*/
10
namespace
gbxserialacfr
{
11
class
Serial;
12
}
13
14
// test connectivity to a [serial] device at a [baudrate];
15
// Assumes that you can figure out a [challenge] (command ...) to
16
// which the device will answer with a unique [ack] in [timeOutMsec] milliseconds.
17
// If [successThresh] or more [challenge]es are answered by an [ack]
18
//
19
// Limitations: amount of data expected before timeOutMsec should be
20
// reasonably small
21
//
22
// returns true for Success; false for failure
23
namespace
gbxnovatelutilacfr{
24
bool
testConnectivity(
25
std::string &challenge,
26
std::string &ack,
27
gbxserialacfr::Serial
& serial,
28
int
timeOutMsec,
29
int
numTry,
30
int
successThresh,
31
int
baudrate);
32
33
// send a [challenge] (command ...) to
34
// which the device will answer with a unique [ack] in [timeOutMsec] milliseconds.
35
//
36
// Limitations: amount of data expected before timeOutMsec should be
37
// reasonably small
38
//
39
// returns true for Success (i.e. ack received in time),
40
// false for failure, in case of failure errorResponse contains the reply from the receiver
41
bool
sendCmdWaitForResponse(
42
std::string &challenge,
43
std::string &ack,
44
std::string &errorResponse,
45
gbxserialacfr::Serial
& serial,
46
int
timeOutMsec);
47
}
gbxserialacfr::Serial
Encapsulates a serial port.
Definition
serial.h:44
gbxserialacfr
Simple serial port interface.
Definition
gbxnovatelacfr/driver.h:21
Generated for GearBox by
1.4.5