PacketReception

Contains the Packet Reception library. This library (and entire package) was written by Meredith Hunter, so ask her if you have questions.

Packet Receiver Library

Library to receive APRS Packet.

Defines

PACKETRECEIVER_H
struct AX25Packet
#include <PacketReceiver.h>

Contains all packet information in the standard AX.25 protocol.

Public Members

std::string source

Source of packet represented as string.

int source_ssid

SSID for the source.

std::string dest

Packet destination represented as a string.

std::string msg

Message encoded by APRS packet.

class PacketReceiver
#include <PacketReceiver.h>

PacketReceiver Object for APRS.

Public Functions

PacketReceiver(int serial_num, std::string frequency, int port, std::string configfile)

Construct a new Packet Receiver object.

Parameters:
  • serial_num – Serial number

  • frequency – Desired frequency

  • port – TCP Port

  • configfile – Direwolf config file

~PacketReceiver()

Destroy the Packet Receiver object.

void startSDR()

Initializes SDR.

void startSDR(Log &m_log)

Initializes SDR so Log can track it.

Parameters:

m_log – Pointer to the Log object

void stopSDR()

Terminates SDR.

bool packetAvailable()

Checks if APRS Packet is available.

Returns:

true APRS Packet is available

Returns:

false APRS Packet is not available

AX25Packet getPacket()

Get the AX25Packet.

Returns:

The APRS Packet

Private Functions

std::string exec(std::string cmd)

Executes cmd on the command line.

Parameters:

cmd – Command line instruction

Returns:

string representing output from terminal

std::string decodeMicEComment(char *msg, int length)

Decodes Mic-E message.

Parameters:
  • msg – The message

  • length – The length of msg

Returns:

string representing the decoded message

Private Members

int serial_num

RTL-SDR serial number.

std::string frequency

Frequency to tune the SDR to.

int port_num

TCP Port for Direwolf.

std::string configfile

Name of config file for Direwolf.

std::string sdr_script = "sudo ../../runSDR.sh"

Command Line instruction to run SDR script.

bool rtl_active = false

Indicates whether the radio is currently running.

int rtl_pid

Process ID for RTL_FM the last time it was started.

int count = 0

Count the number of times Direwolf has been run.

int sockfd

TCP Port info.

struct sockaddr_in serv_addr

TCP Port info server address.

struct hostent *server

TCP Port info server.

PacketTest

Simply tests if we can receive APRS Packet.

Functions

int main()

Main method to test APRS Packet Reception.

Returns:

int representing exit status

TCPTest

Tests if we can receive APRS Packet through TCP.

Functions

int main()

Main Method to test TCP Port.

Returns:

int representing exit status