Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

common.c File Reference


Detailed Description

Communicate with serial device.

Author:
Author
jayhawk_hokie
Version:
Revision
1.6
Date:
Date
2007/08/02 23:18:28

Definition in file common.c.

#include "satctl.h"
#include "common.h"

Include dependency graph for common.c:

Include dependency graph

Go to the source code of this file.

Functions

int init_serial (char *portfn, speed_t brate, int *portfd)
 Initialize serial port
The presumption was that we'd always be talking exclusively to devices in 8N1. Now, to use 2 stop bits, we had to use a define to avoid rewriting all the code that uses init_serial as it is already written. Any major version change should incorporate an option for doing this properly in the code.
int say (int fd, char *str)
 Send data string to serial port.
int hear (int fd, char *str, int maxlen, int minlen, int maxbtime, char term)
 hear function reads data from serial port


Function Documentation

int hear int  fd,
char *  str,
int  maxlen,
int  minlen,
int  maxbtime,
char  term
 

hear function reads data from serial port

Parameters:
fd file descriptor for port
*str pointer to return string
maxlen maximum length of return string
minlen minimum length of return string ( 0 = end string at character return, !0 = minimum length)
maxbtime maximum blocking time for select function (select function looks for ports to read)
term termination character to search for if minlen = 0
Returns:
int 0 if successful

Definition at line 115 of file common.c.

Referenced by Magnetometer::AsciiParser(), Magnetometer::BinaryParser(), PhysicalMomentumWheel::ChangeBaud(), Magnetometer::ContinuousDataConfiguration(), Magnetometer::DefaultConfiguration(), PhysicalControlMomentGyro::FindLimits(), PhysicalMomentumWheel::GetAmps(), PhysicalTiltSensor::GetAngles(), PhysicalMomentumWheel::GetVolts(), PhysicalLinearActuator::Initialize(), PhysicalTiltSensor::Initialize(), main(), Magnetometer::PolledDataConfiguration(), Magnetometer::QuerryConfiguration(), PhysicalControlMomentGyro::QueryAngle(), PhysicalLinearActuator::QueryCurrentPosition(), PhysicalControlMomentGyro::QueryWheelSpeed(), QueryWheelSpeed(), PhysicalControlMomentGyro::QueryWheelTorque(), PhysicalMomentumWheel::QueryWheelTorque(), Magnetometer::ReEnterOffConfiguration(), Magnetometer::ReEnterOnConfiguration(), Magnetometer::SetAsciiConfiguration(), Magnetometer::SetAveragingOffConfiguration(), Magnetometer::SetAveragingOnConfiguration(), Magnetometer::SetBaud19200Configuration(), Magnetometer::SetBinaryConfiguration(), Magnetometer::SetResetOffConfiguration(), Magnetometer::SetResetOnConfiguration(), Magnetometer::SetSampleRateConfiguration(), PhysicalLinearActuator::StartJog(), and Magnetometer::~Magnetometer().

int init_serial char *  portfn,
speed_t  brate,
int *  portfd
 

Initialize serial port
The presumption was that we'd always be talking exclusively to devices in 8N1. Now, to use 2 stop bits, we had to use a define to avoid rewriting all the code that uses init_serial as it is already written. Any major version change should incorporate an option for doing this properly in the code.

Parameters:
*portfn pointer to port file name
brate 
*portfd pointer to port file descripter
Returns:
int 0 if successful

Definition at line 27 of file common.c.

Referenced by _daq(), Magnetometer::Initialize(), PhysicalControlMomentGyro::Initialize(), PhysicalLinearActuator::Initialize(), PhysicalMomentumWheel::Initialize(), PhysicalTiltSensor::Initialize(), and main().

int say int  fd,
char *  str
 

Send data string to serial port.

Parameters:
fd file descriptor for port
*str pointer to return string
Returns:
int 0 if successful

Definition at line 74 of file common.c.

Referenced by Magnetometer::AsciiParser(), Magnetometer::BinaryParser(), PhysicalMomentumWheel::ChangeBaud(), PhysicalControlMomentGyro::CommandAngle(), PhysicalControlMomentGyro::CommandGimbalRate(), PhysicalMomentumWheel::CommandSystemTorque(), PhysicalControlMomentGyro::CommandWheelSpeed(), PhysicalControlMomentGyro::CommandWheelTorque(), Magnetometer::ContinuousDataConfiguration(), Magnetometer::DefaultConfiguration(), PhysicalMomentumWheel::EchoOff(), PhysicalMomentumWheel::EchoOn(), PhysicalMomentumWheel::EnableTorqueMode(), PhysicalControlMomentGyro::FindLimits(), PhysicalMomentumWheel::GetAmps(), PhysicalTiltSensor::GetAngles(), PhysicalMomentumWheel::GetVolts(), PhysicalControlMomentGyro::GoCommand(), PhysicalControlMomentGyro::Initialize(), PhysicalLinearActuator::Initialize(), PhysicalTiltSensor::Initialize(), main(), Magnetometer::PolledDataConfiguration(), Magnetometer::QuerryConfiguration(), PhysicalControlMomentGyro::QueryAngle(), PhysicalLinearActuator::QueryCurrentPosition(), PhysicalControlMomentGyro::QueryWheelSpeed(), QueryWheelSpeed(), PhysicalControlMomentGyro::QueryWheelTorque(), PhysicalMomentumWheel::QueryWheelTorque(), Magnetometer::ReEnterOffConfiguration(), Magnetometer::ReEnterOnConfiguration(), PhysicalMomentumWheel::Reset(), Magnetometer::SetAsciiConfiguration(), Magnetometer::SetAveragingOffConfiguration(), Magnetometer::SetAveragingOnConfiguration(), Magnetometer::SetBaud19200Configuration(), Magnetometer::SetBinaryConfiguration(), Magnetometer::SetResetOffConfiguration(), Magnetometer::SetResetOnConfiguration(), Magnetometer::SetSampleRateConfiguration(), PhysicalLinearActuator::SetVelocity(), PhysicalLinearActuator::StartJog(), PhysicalLinearActuator::Stop(), PhysicalMomentumWheel::TorqueCommand(), PhysicalLinearActuator::TravelDistance(), PhysicalLinearActuator::TravelPosition(), and Magnetometer::~Magnetometer().


Generated on Wed Sep 5 12:54:29 2007 for DSACSS Operational Code by  doxygen 1.3.9.1