src/helpers.h File Reference

Declarations of helper functions for fap.c. More...

#include <time.h>
#include "fap.h"

Include dependency graph for helpers.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int fapint_parse_header (fap_packet_t *packet, short const is_ax25)
 Parses packet->header into source, target and path.
int fapint_parse_mice (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Try to parse given packet body as mic-e packet.
time_t fapint_parse_timestamp (char const *input)
 Returns unixtime based on timestamp in given body.
int fapint_parse_compressed (fap_packet_t *packet, char const *input)
 Try to parse given packet body as compressed position report.
int fapint_parse_normal (fap_packet_t *packet, char const *input)
 Try to parse given packet body as normal position report.
void fapint_parse_comment (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Check given packet body for course, speed PHGR, altitude and comments.
int fapint_parse_nmea (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Parse NMEA packet.
int fapint_parse_object (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Try to parse given packet body as object.
int fapint_parse_item (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Try to parse given packet body as item.
int fapint_parse_message (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Try to parse given packet body as message.
int fapint_parse_capabilities (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Parse capabilities message.
int fapint_parse_status (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Parse status message.
int fapint_parse_wx (fap_packet_t *packet, char const *input, unsigned int const input_len)
 Parse wx report.
int fapint_parse_telemetry (fap_packet_t *packet, char const *input)
 Parse telemetry message.
int fapint_parse_wx_peet_logging (fap_packet_t *packet, char const *input)
 Parses a Peet bros Ultimeter weather logging frame (!! header).
int fapint_parse_wx_peet_packet (fap_packet_t *packet, char const *input)
 Parses a Peet bros Ultimeter weather packet ($ULTW header).
int fapint_parse_dao (fap_packet_t *packet, char input[3])
 Parse given !DAO! extension.
char * fapint_check_kiss_callsign (char *input)
 Validates given KISS-level callsign.
fap_packet_tfapint_create_packet ()
 Creates and initializes an empty packet.


Detailed Description

Declarations of helper functions for fap.c.

Author:
Tapio Aaltonen

Definition in file helpers.h.


Function Documentation

int fapint_parse_header ( fap_packet_t packet,
short const   is_ax25 
)

Parses packet->header into source, target and path.

Returns:
1 on success, 0 on failure.

Definition at line 50 of file helpers.c.

int fapint_parse_mice ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Try to parse given packet body as mic-e packet.

Everything after the mic-e report is also parsed here.

Returns:
1 on success, 0 on failure.

Definition at line 311 of file helpers.c.

time_t fapint_parse_timestamp ( char const *  input  ) 

Returns unixtime based on timestamp in given body.

Returns:
Unixtime if body had valid timestamp, 0 if not.

Definition at line 706 of file helpers.c.

int fapint_parse_compressed ( fap_packet_t packet,
char const *  input 
)

Try to parse given packet body as compressed position report.

Handles only compressed position report from beginning of body. Input is assumed to be null-terminated.

Returns:
1 on success, 0 on failure.

Definition at line 852 of file helpers.c.

int fapint_parse_normal ( fap_packet_t packet,
char const *  input 
)

Try to parse given packet body as normal position report.

Handles only normal position report from beginning of body. Input is assumed to be null-terminated.

Returns:
1 on success, 0 on failure.

Definition at line 1013 of file helpers.c.

void fapint_parse_comment ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Check given packet body for course, speed PHGR, altitude and comments.

Looks for optional fields and can't thus fail.

Definition at line 1189 of file helpers.c.

int fapint_parse_nmea ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Parse NMEA packet.

Returns:
1 on success, 0 on failure.

Definition at line 1365 of file helpers.c.

int fapint_parse_object ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Try to parse given packet body as object.

Returns:
1 on success, 0 on failure.

Definition at line 1954 of file helpers.c.

int fapint_parse_item ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Try to parse given packet body as item.

Returns:
1 on success, 0 on failure.

Definition at line 2056 of file helpers.c.

int fapint_parse_message ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Try to parse given packet body as message.

Returns:
1 on success, 0 on failure.

Definition at line 2154 of file helpers.c.

int fapint_parse_capabilities ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Parse capabilities message.

Returns:
1 on success, 0 on failure.

Definition at line 2326 of file helpers.c.

int fapint_parse_status ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Parse status message.

Returns:
1 on success, 0 on failure.

Definition at line 2466 of file helpers.c.

int fapint_parse_wx ( fap_packet_t packet,
char const *  input,
unsigned int const   input_len 
)

Parse wx report.

Returns:
1 on success, 0 on failure.

Definition at line 2516 of file helpers.c.

int fapint_parse_telemetry ( fap_packet_t packet,
char const *  input 
)

Parse telemetry message.

Returns:
1 on success, 0 on failure.

Definition at line 2940 of file helpers.c.

int fapint_parse_wx_peet_logging ( fap_packet_t packet,
char const *  input 
)

Parses a Peet bros Ultimeter weather logging frame (!! header).

Returns:
1 on success, 0 on failure.

Definition at line 3041 of file helpers.c.

int fapint_parse_wx_peet_packet ( fap_packet_t packet,
char const *  input 
)

Parses a Peet bros Ultimeter weather packet ($ULTW header).

Returns:
1 on success, 0 on failure.

Definition at line 3314 of file helpers.c.

int fapint_parse_dao ( fap_packet_t packet,
char  input[3] 
)

Parse given !DAO! extension.

Parse a possible !DAO! extension (datum and extra lat/lon digits).

Parameters:
packet Results are saved here.
input The 3 bytes between exclamation marks.
Returns:
1 if a valid !DAO! extension was detected in the test subject (and stored in $rethash), 0 if not.

Definition at line 3598 of file helpers.c.

char* fapint_check_kiss_callsign ( char *  input  ) 

Validates given KISS-level callsign.

Checks a callsign for validity and strips trailing spaces out and returns the string.

Returns:
Copy of input at success, NULL when failure occurs.

Definition at line 3680 of file helpers.c.


Generated on Sun Nov 20 09:26:24 2011 for libfap by  doxygen 1.5.6