libdrmconf 0.13.3
A library to program DMR radios.
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenGD77BaseCodeplug::SatelliteElement Class Reference

Encodes a satellite for the OpenGD77 devices. More...

#include <opengd77base_codeplug.hh>

Inheritance diagram for OpenGD77BaseCodeplug::SatelliteElement:
Inheritance graph
[legend]
Collaboration diagram for OpenGD77BaseCodeplug::SatelliteElement:
Collaboration graph
[legend]

Classes

struct  Limit
 Some limits for the zone bank. More...
 
struct  Offset
 Some internal offsets within the element. More...
 

Public Member Functions

 SatelliteElement (uint8_t *ptr)
 Constructor.
 
void clear ()
 Abstract method to reset the element within the codeplug.
 
virtual void setName (const QString &name)
 Sets the name of the element.
 
virtual void setEpoch (const ::OrbitalElement::Epoch &epoch)
 Sets the epoch.
 
virtual void setMeanMotion (double mm)
 Sets the first derivative of mean motion.
 
virtual void setMeanMotionDerivative (double dmm)
 Sets the first derivative of mean motion.
 
virtual void setInclination (double incl)
 Sets the inclination.
 
virtual void setAscension (double asc)
 Right ascension of the ascending node.
 
virtual void setEccentricity (double ecc)
 Sets eccentricity.
 
virtual void setPerigee (double arg)
 Sets argument of perigee.
 
virtual void setMeanAnomaly (double ma)
 Set the mean anomaly.
 
virtual void setRevolutionNumber (unsigned int num)
 Sets the revolution number at epoch.
 
void setFMDownlink (const Frequency &f)
 Sets the downlink frequency.
 
void setFMUplink (const Frequency &f)
 Sets the uplink frequency.
 
void setCTCSS (const SelectiveCall &call)
 Sets the CTCSS tone.
 
void setAPRSDownlink (const Frequency &f)
 Sets the APRS downlink frequency.
 
void setAPRSUplink (const Frequency &f)
 Sets the APRS uplink frequency.
 
void setBeacon (const Frequency &f)
 Sets the beacon frequency.
 
void setAPRSPath (const QString &path)
 Sets the APRS path.
 
virtual bool encode (const Satellite &sat, const ErrorStack &err=ErrorStack())
 Encodes a satellite.
 
- Public Member Functions inherited from Codeplug::Element
 Element (const Element &other)
 Copy constructor.
 
virtual ~Element ()
 Destructor.
 
Elementoperator= (const Element &other)
 Copy assignment.
 
virtual bool isValid () const
 Returns true if the pointer is not null.
 
bool fill (uint8_t value, unsigned offset=0, int size=-1)
 Fills the memsets the entire element to the given value.
 
bool getBit (const Offset::Bit &offset) const
 Reads a specific bit at the given byte-offset.
 
bool getBit (unsigned offset, unsigned bit) const
 Reads a specific bit at the given byte-offset.
 
void setBit (const Offset::Bit &offset, bool value=true)
 Sets a specific bit at the given byte-offset.
 
void setBit (unsigned offset, unsigned bit, bool value=true)
 Sets a specific bit at the given byte-offset.
 
void clearBit (unsigned offset, unsigned bit)
 Clears a specific bit at the given byte-offset.
 
void clearBit (const Offset::Bit &offset)
 Clears a specific bit.
 
uint8_t getUInt2 (const Offset::Bit &offset) const
 Reads a 2bit unsigned integer at the given bit-offset.
 
uint8_t getUInt2 (unsigned offset, unsigned bit) const
 Reads a 2bit unsigned integer at the given byte- and bit-offset.
 
void setUInt2 (const Offset::Bit &offset, uint8_t value)
 Stores a 2bit unsigned integer at the given bit-offset.
 
void setUInt2 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 2bit unsigned integer at the given byte- and bit-offset.
 
uint8_t getUInt3 (const Offset::Bit &offset) const
 Reads a 3bit unsigned integer at the given bit-offset.
 
uint8_t getUInt3 (unsigned offset, unsigned bit) const
 Reads a 3bit unsigned integer at the given byte- and bit-offset.
 
void setUInt3 (const Offset::Bit &offset, uint8_t value)
 Stores a 3bit unsigned integer at the given bit-offset.
 
void setUInt3 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 3bit unsigned integer at the given byte- and bit-offset.
 
uint8_t getUInt4 (const Offset::Bit &offset) const
 Reads a 4bit unsigned integer at the given bit-offset.
 
uint8_t getUInt4 (unsigned offset, unsigned bit) const
 Reads a 4bit unsigned integer at the given byte- and bit-offset.
 
void setUInt4 (const Offset::Bit &offset, uint8_t value)
 Stores a 4bit unsigned integer at the given bit-offset.
 
void setUInt4 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 4bit unsigned integer at the given byte- and bit-offset.
 
uint8_t getUInt5 (const Offset::Bit &offset) const
 Reads a 5bit unsigned integer at the given byte- and bit-offset.
 
uint8_t getUInt5 (unsigned offset, unsigned bit) const
 Reads a 5bit unsigned integer at the given byte- and bit-offset.
 
void setUInt5 (const Offset::Bit &offset, uint8_t value)
 Stores a 5bit unsigned integer at the given byte- and bit-offset.
 
void setUInt5 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 5bit unsigned integer at the given byte- and bit-offset.
 
uint8_t getUInt6 (const Offset::Bit &offset) const
 Reads a 6bit unsigned integer at the given byte- and bit-offset.
 
uint8_t getUInt6 (unsigned offset, unsigned bit) const
 Reads a 6bit unsigned integer at the given byte- and bit-offset.
 
void setUInt6 (const Offset::Bit &offset, uint8_t value)
 Stores a 6bit unsigned integer at the given byte- and bit-offset.
 
void setUInt6 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 6bit unsigned integer at the given byte- and bit-offset.
 
uint8_t getUInt8 (unsigned offset) const
 Reads a 8bit unsigned integer at the given byte- and bit-offset.
 
void setUInt8 (unsigned offset, uint8_t value)
 Reads a 8bit unsigned integer at the given byte- and bit-offset.
 
int8_t getInt8 (unsigned offset) const
 Reads a 8bit signed integer at the given byte- and bit-offset.
 
void setInt8 (unsigned offset, int8_t value)
 Reads a 8bit signed integer at the given byte- and bit-offset.
 
uint16_t getUInt16_be (unsigned offset) const
 Reads a 16bit big-endian unsigned integer at the given byte-offset.
 
uint16_t getUInt16_le (unsigned offset) const
 Reads a 16bit little-endian unsigned integer at the given byte-offset.
 
void setUInt16_be (unsigned offset, uint16_t value)
 Stores a 16bit big-endian unsigned integer at the given byte-offset.
 
void setUInt16_le (unsigned offset, uint16_t value)
 Stores a 16bit little-endian unsigned integer at the given byte-offset.
 
uint32_t getUInt24_be (unsigned offset) const
 Reads a 24bit big-endian unsigned integer at the given byte-offset.
 
uint32_t getUInt24_le (unsigned offset) const
 Reads a 24bit little-endian unsigned integer at the given byte-offset.
 
void setUInt24_be (unsigned offset, uint32_t value)
 Stores a 24bit big-endian unsigned integer at the given byte-offset.
 
void setUInt24_le (unsigned offset, uint32_t value)
 Stores a 24bit little-endian unsigned integer at the given byte-offset.
 
uint32_t getUInt32_be (unsigned offset) const
 Reads a 32bit big-endian unsigned integer at the given byte-offset.
 
uint32_t getUInt32_le (unsigned offset) const
 Reads a 32bit little-endian unsigned integer at the given byte-offset.
 
void setUInt32_be (unsigned offset, uint32_t value)
 Stores a 32bit big-endian unsigned integer at the given byte-offset.
 
void setUInt32_le (unsigned offset, uint32_t value)
 Stores a 32bit little-endian unsigned integer at the given byte-offset.
 
uint64_t getUInt64_be (unsigned offset) const
 Reads a 64bit big-endian unsigned integer at the given byte-offset.
 
uint64_t getUInt64_le (unsigned offset) const
 Reads a 64bit little-endian unsigned integer at the given byte-offset.
 
void setUInt64_be (unsigned offset, uint64_t value)
 Stores a 64bit big-endian unsigned integer at the given byte-offset.
 
void setUInt64_le (unsigned offset, uint64_t value)
 Stores a 64bit little-endian unsigned integer at the given byte-offset.
 
uint8_t getBCD2 (unsigned offset) const
 Reads a 2-digit (1-byte/8bit) BDC value in big-endian at the given byte-offset.
 
void setBCD2 (unsigned offset, uint8_t value)
 Stores a 2-digit (1-byte/8bit) BDC value in big-endian at the given byte-offset.
 
uint16_t getBCD4_be (unsigned offset) const
 Reads a 4-digit (2-byte/16bit) BDC value in big-endian at the given byte-offset.
 
void setBCD4_be (unsigned offset, uint16_t value)
 Stores a 4-digit (2-byte/16bit) BDC value in big-endian at the given byte-offset.
 
uint16_t getBCD4_le (unsigned offset) const
 Reads a 4-digit (2-byte/16bit) BDC value in little-endian at the given byte-offset.
 
void setBCD4_le (unsigned offset, uint16_t value)
 Stores a 4-digit (1-byte/16bit) BDC value in little-endian at the given byte-offset.
 
uint32_t getBCD8_be (unsigned offset) const
 Reads a 8-digit (4-byte/32bit) BDC value in big-endian at the given byte-offset.
 
void setBCD8_be (unsigned offset, uint32_t value)
 Stores a 8-digit (4-byte/32bit) BDC value in big-endian at the given byte-offset.
 
uint32_t getBCD8_le (unsigned offset) const
 Reads a 8-digit (4-byte/32bit) BDC value in little-endian at the given byte-offset.
 
void setBCD8_le (unsigned offset, uint32_t value)
 Stores a 8-digit (4-byte/32bit) BDC value in little-endian at the given byte-offset.
 
QString readASCII (unsigned offset, unsigned maxlen, uint8_t eos=0x00) const
 Reads up to maxlen ASCII chars at the given byte-offset using eos as the string termination char.
 
void writeASCII (unsigned offset, const QString &txt, unsigned maxlen, uint8_t eos=0x00)
 Stores up to maxlen ASCII chars at the given byte-offset using eos as the string termination char.
 
QString readUnicode (unsigned offset, unsigned maxlen, uint16_t eos=0x0000) const
 Reads up to maxlen unicode chars at the given byte-offset using eos as the string termination char.
 
void writeUnicode (unsigned offset, const QString &txt, unsigned maxlen, uint16_t eos=0x0000)
 Stores up to maxlen unicode chars at the given byte-offset using eos as the string termination char.
 

Static Public Member Functions

static constexpr unsigned int size ()
 The size of the element.
 

Protected Member Functions

 SatelliteElement (uint8_t *ptr, size_t size)
 Hidden constructor.
 
void writeFixedPoint (const Offset::Bit &offset, double value, bool sign, unsigned int dec, unsigned int frac)
 Writes a fixed point value as a BCD number.
 
void writeFractional (const Offset::Bit &offset, double value, bool sign, unsigned int frac)
 Writes a fixed point value as a BCD number.
 
void writeInteger (const Offset::Bit &offset, int value, bool sign, unsigned dec)
 Write a fixed digit integer value.
 
void writeDigit (const Offset::Bit &offset, uint8_t digit)
 Writes a single digit at the given offset.
 
- Protected Member Functions inherited from Codeplug::Element
 Element (uint8_t *ptr, size_t size)
 Hidden constructor.
 

Additional Inherited Members

- Protected Attributes inherited from Codeplug::Element
uint8_t * _data
 Holds the pointer to the element.
 
size_t _size
 Holds the size of the element.
 

Detailed Description

Encodes a satellite for the OpenGD77 devices.

That is a set of orbital elements and transponder information.

Member Function Documentation

◆ clear()

void OpenGD77BaseCodeplug::SatelliteElement::clear ( )
virtual

Abstract method to reset the element within the codeplug.

Any device specific element should implement this method.

Reimplemented from Codeplug::Element.

◆ encode()

bool OpenGD77BaseCodeplug::SatelliteElement::encode ( const Satellite sat,
const ErrorStack err = ErrorStack() 
)
virtual

Encodes a satellite.

Bug:
set APRS path

◆ writeFixedPoint()

void OpenGD77BaseCodeplug::SatelliteElement::writeFixedPoint ( const Offset::Bit &  offset,
double  value,
bool  sign,
unsigned int  dec,
unsigned int  frac 
)
protected

Writes a fixed point value as a BCD number.

Using 0-9 as digits, ah as decimal dot and bh as blank.

Parameters
offsetSpecifies, where to write the fixed point value.
valueThe value to write.
signIf true, a sign is written.
decThe number of digits in the integer part.
fracThe number of digits in the fractional part.

◆ writeFractional()

void OpenGD77BaseCodeplug::SatelliteElement::writeFractional ( const Offset::Bit &  offset,
double  value,
bool  sign,
unsigned int  frac 
)
protected

Writes a fixed point value as a BCD number.

Using 0-9 as digits and bh as blank. In contrast to writeFixedPoint, this function expects no integer part.

Parameters
offsetSpecifies, where to write the fixed point value.
valueThe value to write.
signIf true, a sign is written.
fracThe number of digits in the fractional part.

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