COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
txrstruc Struct Reference

Transmitter information. More...

#include <jsondef.h>

Collaboration diagram for txrstruc:

Public Member Functions

json11::Json to_json () const
 Convert class contents to JSON object. More...
 
void from_json (const string &s)
 Set class contents from JSON string. More...
 

Public Attributes

uint16_t opmode = 0
 Operating mode. More...
 
uint16_t modulation = 0
 Data modulation. More...
 
uint16_t rssi = 0
 RSSI. More...
 
uint16_t pktsize = 0
 Packet Size. More...
 
double freq = 0.
 Input Frequency. More...
 
double maxfreq = 0.
 Maximum frequency allowed. More...
 
double minfreq = 0.
 Minimum frequency allowed. More...
 
float powerin = 0.f
 Current RX Power. More...
 
float powerout = 0.f
 Current TX Power. More...
 
float maxpower = 0.f
 Output Power limit. More...
 
float band = 0.f
 Input Filter bandpass. More...
 
float squelch_tone = 0.f
 repeater squelch tone frequency More...
 
double goodratio = 0.
 Good Packet Percentage. More...
 
double txutc = 0.
 Last TX time. More...
 
double uptime = 10.
 Connection Uptime. More...
 

Detailed Description

Transmitter information.

This structure holds the information concerning transmitters.

Member Function Documentation

json11::Json txrstruc::to_json ( ) const
inline

Convert class contents to JSON object.

Returns a json11 JSON object of the class

Returns
A json11 JSON object containing every member variable within the class
2444  {
2445  return json11::Json::object {
2446  { "opmode" , opmode },
2447  { "modulation" , modulation },
2448  { "rssi" , rssi },
2449  { "pktsize", pktsize },
2450  { "freq" , freq },
2451  { "maxfreq", maxfreq },
2452  { "minfreq", minfreq },
2453  { "powerin", powerin },
2454  { "powerout" , powerout },
2455  { "maxpower" , maxpower },
2456  { "band" , band },
2457  { "squelch_tone", squelch_tone },
2458  { "goodratio", goodratio },
2459  { "txutc" , txutc },
2460  { "uptime" , uptime }
2461  };
2462  }
float powerin
Current RX Power.
Definition: jsondef.h:2424
std::map< std::string, Json > object
Definition: json11.hpp:88
double minfreq
Minimum frequency allowed.
Definition: jsondef.h:2422
float band
Input Filter bandpass.
Definition: jsondef.h:2430
double goodratio
Good Packet Percentage.
Definition: jsondef.h:2434
double freq
Input Frequency.
Definition: jsondef.h:2418
uint16_t pktsize
Packet Size.
Definition: jsondef.h:2416
uint16_t modulation
Data modulation.
Definition: jsondef.h:2412
double uptime
Connection Uptime.
Definition: jsondef.h:2438
uint16_t rssi
RSSI.
Definition: jsondef.h:2414
float powerout
Current TX Power.
Definition: jsondef.h:2426
float squelch_tone
repeater squelch tone frequency
Definition: jsondef.h:2432
double txutc
Last TX time.
Definition: jsondef.h:2436
float maxpower
Output Power limit.
Definition: jsondef.h:2428
uint16_t opmode
Operating mode.
Definition: jsondef.h:2410
double maxfreq
Maximum frequency allowed.
Definition: jsondef.h:2420
void txrstruc::from_json ( const string &  s)
inline

Set class contents from JSON string.

Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()

Parameters
sJSON-formatted string to set class contents to
Returns
n/a
2470  {
2471  string error;
2472  json11::Json parsed = json11::Json::parse(s,error);
2473  if(error.empty()) {
2474  if(!parsed["opmode"].is_null()) { opmode = parsed["opmode"].int_value(); }
2475  if(!parsed["modulation"].is_null()) { modulation = parsed["modulation"].int_value(); }
2476  if(!parsed["rssi"].is_null()) { rssi = parsed["rssi"].int_value(); }
2477  if(!parsed["pktsize"].is_null()) { pktsize = parsed["pktsize"].int_value(); }
2478  if(!parsed["freq"].is_null()) { freq = parsed["freq"].number_value(); }
2479  if(!parsed["maxfreq"].is_null()) { maxfreq = parsed["maxfreq"].number_value(); }
2480  if(!parsed["minfreq"].is_null()) { minfreq = parsed["minfreq"].number_value(); }
2481  if(!parsed["powerin"].is_null()) { powerin = parsed["powerin"].number_value(); }
2482  if(!parsed["powerout"].is_null()) { powerout = parsed["powerout"].number_value(); }
2483  if(!parsed["maxpower"].is_null()) { maxpower = parsed["maxpower"].number_value(); }
2484  if(!parsed["band"].is_null()) { band = parsed["band"].number_value(); }
2485  if(!parsed["squelch_tone"].is_null()) { squelch_tone = parsed["squelch_tone"].number_value(); }
2486  if(!parsed["goodratio"].is_null()) { goodratio = parsed["goodratio"].number_value(); }
2487  if(!parsed["txutc"].is_null()) { txutc = parsed["txutc"].number_value(); }
2488  if(!parsed["uptime"].is_null()) { uptime = parsed["uptime"].number_value(); }
2489  } else {
2490  cerr<<"ERROR: <"<<error<<">"<<endl;
2491  }
2492  return;
2493  }
float powerin
Current RX Power.
Definition: jsondef.h:2424
double minfreq
Minimum frequency allowed.
Definition: jsondef.h:2422
Definition: json11.hpp:79
float band
Input Filter bandpass.
Definition: jsondef.h:2430
double goodratio
Good Packet Percentage.
Definition: jsondef.h:2434
double freq
Input Frequency.
Definition: jsondef.h:2418
uint16_t pktsize
Packet Size.
Definition: jsondef.h:2416
uint16_t modulation
Data modulation.
Definition: jsondef.h:2412
double uptime
Connection Uptime.
Definition: jsondef.h:2438
uint16_t rssi
RSSI.
Definition: jsondef.h:2414
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
float powerout
Current TX Power.
Definition: jsondef.h:2426
float squelch_tone
repeater squelch tone frequency
Definition: jsondef.h:2432
double txutc
Last TX time.
Definition: jsondef.h:2436
float maxpower
Output Power limit.
Definition: jsondef.h:2428
uint16_t opmode
Operating mode.
Definition: jsondef.h:2410
int int_value() const
Definition: json11.cpp:281
double maxfreq
Maximum frequency allowed.
Definition: jsondef.h:2420
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

uint16_t txrstruc::opmode = 0

Operating mode.

uint16_t txrstruc::modulation = 0

Data modulation.

uint16_t txrstruc::rssi = 0

RSSI.

uint16_t txrstruc::pktsize = 0

Packet Size.

double txrstruc::freq = 0.

Input Frequency.

double txrstruc::maxfreq = 0.

Maximum frequency allowed.

double txrstruc::minfreq = 0.

Minimum frequency allowed.

float txrstruc::powerin = 0.f

Current RX Power.

float txrstruc::powerout = 0.f

Current TX Power.

float txrstruc::maxpower = 0.f

Output Power limit.

float txrstruc::band = 0.f

Input Filter bandpass.

float txrstruc::squelch_tone = 0.f

repeater squelch tone frequency

double txrstruc::goodratio = 0.

Good Packet Percentage.

double txrstruc::txutc = 0.

Last TX time.

double txrstruc::uptime = 10.

Connection Uptime.


The documentation for this struct was generated from the following file: