sdr::POCSAG::Message Class Reference
Data handling nodes.

A pocsag message. More...

`#include <pocsag.hh>`

## Public Member Functions

| Message ()
| Empty constructor. More...
| Message (uint32_t addr, uint8_t func)
| Constructor from address and function. More...
| Message (const Message &other)
| Copy constructor. More...
Message & | operator= (const Message &other)
| Assignment operator. More...
bool | isEmpty () const
| Retruns `true` if the message is empty (has no address). More...
uint32_t | address () const
| Returns the address of the message. More...
uint8_t | function () const
| Returns the function of the message. More...
uint32_t | bits () const
| Returns the number of data bits. More...
void | addPayload (uint32_t word)
| Adds some payload from the given POGSAC word. More...
int | estimateText () const
| Retruns the "likelihood" that the message is a text message (actually a log-likelihood). More...
int | estimateNumeric () const
| Retruns the "likelihood" that the message is a numeric message (actually a log-likelihood). More...
std::string | asText () const
| Decodes the message as a text message. More...
std::string | asNumeric () const
| Decodes the message as a numeric message. More...
std::string | asHex () const
| Dumps the payload. More...

## Protected Attributes

uint32_t | _address
| The address of the message. More...
uint8_t | _function
| The function of the message. More...
bool | _empty
| If `true` the message is empty. More...
uint32_t | _bits
| The number of payload bits in the message. More...
std::vector< uint8_t > | _payload
| The actual payload. More...

## Detailed Description

A pocsag message.

A pocsag message can be either a numeric message (i.e. phone numbers) or a text message. The transmitter knows which type a certain receiver expects, hence there is no information embedded into the actual message that determines the type. Hence a heuristic needs to be used in order to select the message type by the contents of the message. This is done using the `estimateText` and `estimateNumeric` functions. They return a weight in favor of one of the types. I.e. if estimateText() > estimateNumeric(), the message is likely to be a text message. Like any heuristic, this approach may fail. The message text is returned by `asText()` and the numeric data is returned by `asNumeric()`. Both methods return a `std::string` as the numeric message may also contain a very limited set of non-number symbols.

## Constructor & Destructor Documentation

POCSAG::Message::Message | ( |  | ) |

Empty constructor.

POCSAG::Message::Message | ( | uint32_t | addr,
|  | uint8_t | func
| ) |  |

Constructor from address and function.

POCSAG::Message::Message | ( | const Message & | other | ) |

Copy constructor.

## Member Function Documentation

void POCSAG::Message::addPayload | ( | uint32_t | word | ) |

Adds some payload from the given POGSAC word.

uint32_t sdr::POCSAG::Message::address | ( |  | ) | const

inline

Returns the address of the message.

std::string POCSAG::Message::asHex | ( |  | ) | const

Dumps the payload.

std::string POCSAG::Message::asNumeric | ( |  | ) | const

Decodes the message as a numeric message.

std::string POCSAG::Message::asText | ( |  | ) | const

Decodes the message as a text message.

uint32_t sdr::POCSAG::Message::bits | ( |  | ) | const

inline

Returns the number of data bits.

int POCSAG::Message::estimateNumeric | ( |  | ) | const

Retruns the "likelihood" that the message is a numeric message (actually a log-likelihood).

int POCSAG::Message::estimateText | ( |  | ) | const

Retruns the "likelihood" that the message is a text message (actually a log-likelihood).

uint8_t sdr::POCSAG::Message::function | ( |  | ) | const

inline

Returns the function of the message.

bool sdr::POCSAG::Message::isEmpty | ( |  | ) | const

inline

Retruns `true` if the message is empty (has no address).

POCSAG::Message & POCSAG::Message::operator= | ( | const Message & | other | ) |

Assignment operator.

## Member Data Documentation

uint32_t sdr::POCSAG::Message::_address

protected

The address of the message.

uint32_t sdr::POCSAG::Message::_bits

protected

The number of payload bits in the message.

bool sdr::POCSAG::Message::_empty

protected

If `true` the message is empty.

uint8_t sdr::POCSAG::Message::_function

protected

The function of the message.

std::vector<uint8_t> sdr::POCSAG::Message::_payload

protected

The actual payload.

The documentation for this class was generated from the following files:

- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/pocsag.hh
- /Users/hannes/Uni/Elektronik/sdr/libsdr/src/pocsag.cc