Main Page | Data Structures | Directories | File List | Data Fields | Globals

cframe.c File Reference

#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "debug.h"
#include <cartcomm/cframe.h>
#include <cartcomm/nmea.h>
#include <cartcomm/comm.h>

Include dependency graph for cframe.c:

Include dependency graph

Go to the source code of this file.

Defines

#define DEBUG_LEVEL   1
#define APPEND(fmt, val)   sprintf(field, fmt, val); strcat(msg, field);
#define PRINT()   fprintf(file, "\t" __VA_ARGS__); fputc('\n', file);

Functions

int parse_msg (cframe_t *cf, char *msg)
int cartcomm_encode_msg (cframe_t *cf, char *outMsg)
 Encode the control frame as a message string.
int cartcomm_decode_msg (cframe_t *cf, char *inMsg)
 Decode the message into a control frame.
void print_cframe (FILE *file, cframe_t *cf)
 Print a control frame in a human readable form.


Define Documentation

#define APPEND fmt,
val   )     sprintf(field, fmt, val); strcat(msg, field);
 

Referenced by cartcomm_encode_msg().

#define DEBUG_LEVEL   1
 

Definition at line 8 of file cframe.c.

 
#define PRINT  )     fprintf(file, "\t" __VA_ARGS__); fputc('\n', file);
 

Referenced by print_cframe().


Function Documentation

int cartcomm_decode_msg cframe_t cf,
char *  inMsg
 

Decode the message into a control frame.

Parameters:
cf control frame to decode into
inMsg buffer to decode
Return values:
0 success
-1 failure

Definition at line 126 of file cframe.c.

References cframe_t, cframe::checksum, DEBUG2, DEBUG3, cframe::msg_len, and parse_msg().

Referenced by cartcomm_encode_msg(), cartcomm_synchronize(), and drive().

Here is the call graph for this function:

int cartcomm_encode_msg cframe_t cf,
char *  outMsg
 

Encode the control frame as a message string.

Parameters:
cf control frame to encode
outMsg buffer to encode into
Return values:
0 success
-1 failure

Definition at line 43 of file cframe.c.

References APPEND, ASSERT_EQUAL, cartcomm_decode_msg(), cframe_t, cframe::cmd_irad, cframe::cmd_mode, cframe::cmd_speed, cframe::cur_irad, cframe::cur_mode, cframe::cur_speed, cframe::cur_throttle, DEBUG3, deg_to_nmea(), cframe::error_code, cframe::gps_epe, cframe::gps_lat, cframe::gps_lon, cframe::gps_speed_east, cframe::gps_speed_north, cframe::gps_status, cframe::seqno, cframe::speed_limit_error, cframe::status, cframe::steer_limit_error, and cframe::timestamp.

Referenced by drive().

Here is the call graph for this function:

int parse_msg cframe_t cf,
char *  msg
 

Definition at line 1741 of file cframe_parser.c.

References cframe_delete_buffer(), cframe_scan_string(), cframe_t, YY_BUFFER_STATE, and yyparse.

Referenced by cartcomm_decode_msg().

Here is the call graph for this function:

void print_cframe FILE *  file,
cframe_t cf
 

Print a control frame in a human readable form.

Parameters:
file file handle to output towards
cf control frame to output

Definition at line 161 of file cframe.c.

References cframe_t, cframe::cmd_irad, cframe::cmd_mode, cframe::cmd_speed, cframe::cur_irad, cframe::cur_mode, cframe::cur_speed, cframe::cur_throttle, cframe::error_code, cframe::gps_epe, cframe::gps_lat, cframe::gps_lon, cframe::gps_speed_east, cframe::gps_speed_north, cframe::gps_status, PRINT, cframe::seqno, cframe::speed_limit_error, cframe::status, cframe::steer_limit_error, and cframe::timestamp.


Generated on Thu Sep 6 13:13:13 2007 for driver by  doxygen 1.3.9.1