221 if (static_cast<string>(
"ic9100") == argv[3])
228 else if (static_cast<string>(
"astrodev") == argv[3])
233 else if (static_cast<string>(
"ic9100") == argv[3])
240 else if (static_cast<string>(
"ic9100") == argv[3])
245 if (static_cast<string>(
"txr") == argv[4])
249 else if (static_cast<string>(
"rxr") == argv[4])
253 else if (static_cast<string>(
"tcv") == argv[4])
257 freq = atof(argv[5]);
258 band = atof(argv[6]);
259 if (static_cast<string>(
"am") == argv[7])
263 else if (static_cast<string>(
"amd") == argv[7])
267 else if (static_cast<string>(
"fm") == argv[7])
271 else if (static_cast<string>(
"fmd") == argv[7])
275 else if (static_cast<string>(
"lsb") == argv[7])
279 else if (static_cast<string>(
"lsbd") == argv[7])
283 else if (static_cast<string>(
"usb") == argv[7])
287 else if (static_cast<string>(
"usbd") == argv[7])
291 else if (static_cast<string>(
"dv") == argv[7])
295 else if (static_cast<string>(
"dvd") == argv[7])
299 else if (static_cast<string>(
"cw") == argv[7])
303 else if (static_cast<string>(
"cwr") == argv[7])
307 else if (static_cast<string>(
"rtty") == argv[7])
311 else if (static_cast<string>(
"rttyr") == argv[7])
321 printf(
"Usage: agent->radio radioname [nodename [ic9100/astrodev/usrp txr/rxr/tcv frequency bandwidth mode device:addr]]");
431 if ((iretn=
agent->
add_request(
"set_opmode",
request_set_opmode,
"{am, amd, fm, fmd, dv, dvd, cw, cwr}",
"sets the radio operating mode")))
433 if ((iretn=
agent->
add_request(
"set_modulation",
request_set_modulation,
"{ask, bpsk1200, bpsk2400, bpsk4800, bpsk9600, afsk, gfsk1200, gfsk2400, gfsk4800, gfsk9600}",
"sets the radio modulation")))
494 std::cout<<
"Exiting " <<
radioname <<
" for Node: " <<
nodename <<
" no radio found." << std::endl;
504 sprintf(sohstring,
"{\"device_txr_freq_%03lu\",\"device_txr_maxpower_%03lu\",\"device_txr_power_%03lu\",\"device_txr_opmode_%03lu\",\"device_txr_modulation_%03lu\"}",
radioindex,
radioindex,
radioindex,
radioindex,
radioindex);
507 sprintf(sohstring,
"{\"device_rxr_freq_%03lu\",\"device_rxr_power_%03lu\",\"device_rxr_band_%03lu\",\"device_rxr_opmode_%03lu\",\"device_rxr_modulation_%03lu\"}",
radioindex,
radioindex,
radioindex,
radioindex,
radioindex);
510 sprintf(sohstring,
"{\"device_tcv_freq_%03lu\",\"device_tcv_powerin_%03lu\",\"device_tcv_powerout_%03lu\",\"device_tcv_maxpower_%03lu\",\"device_tcv_band_%03lu\",\"device_tcv_opmode_%03lu\",\"device_tcv_modulation_%03lu\"}",
radioindex,
radioindex,
radioindex,
radioindex,
radioindex,
radioindex,
radioindex);
int32_t request_set_repeater_squelch(string &request, string &response, Agent *)
Definition: agent_radio.cpp:751
Radio Receiver.
Definition: jsondef.h:508
float powerout
Definition: ic9100_lib.h:89
Definition: jsondef.h:575
Definition: jsondef.h:650
Definition: jsondef.h:561
vector< portstruc > port
Vector of all ports known to node.
Definition: jsondef.h:4244
int32_t finish_active_loop()
Definition: agentclass.cpp:355
static size_t radioindex
Definition: agent_radio.cpp:158
int32_t request_get_state(string &request, string &response, Agent *)
Definition: agent_radio.cpp:714
static float freq
Definition: agent_radio.cpp:170
uint16_t opmode
Operating mode.
Definition: jsondef.h:2502
Definition: jsondef.h:585
static uint8_t target_record
Definition: agent_radio.cpp:179
int32_t ic9100_set_repeater_squelch(ic9100_handle &handle, float frequency)
Definition: ic9100_lib.cpp:1499
static string port
Definition: agent_radio.cpp:166
int32_t ic9100_set_frequency(ic9100_handle &handle, double frequency)
Definition: ic9100_lib.cpp:868
Definition: jsondef.h:584
int32_t request_get_powerout(string &request, string &response, Agent *)
Definition: agent_radio.cpp:779
uint16_t modulation
Data modulation.
Definition: jsondef.h:2504
vector< uint16_t > rxr
Definition: jsondef.h:3914
int i
Definition: rw_test.cpp:37
static tcvstruc target
Definition: agent_radio.cpp:180
Definition: jsondef.h:581
int32_t ic9100_get_repeater_squelch(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1551
int32_t usrp_set_frequency(usrp_handle &handle, double frequency)
Definition: usrp_lib.cpp:226
uint8_t record
Definition: usrp_lib.h:69
Not a Component.
Definition: jsondef.h:556
Definition: jsondef.h:574
int iretn
Definition: rw_test.cpp:37
Definition: jsondef.h:576
static std::string nodename
Definition: agent_radio.cpp:155
uint16_t tcv_cnt
Definition: jsondef.h:3888
Definition: jsondef.h:567
Definition: jsondef.h:579
int32_t set_sohstring(string list)
Set Limited SOH string.
Definition: agentclass.cpp:641
static uint8_t opmode
Definition: agent_radio.cpp:172
float maxpower
Definition: ic9100_lib.h:90
uint8_t opmode
Definition: ic9100_lib.h:86
vector< uint16_t > txr
Definition: jsondef.h:3925
static float band
Definition: agent_radio.cpp:171
static float freqoffset
Definition: agent_radio.cpp:164
int32_t request_set_moreoffset(string &request, string &response, Agent *)
Definition: agent_radio.cpp:797
vector< devicestruc > device
Vector of all general (common) information for devices (components) in node.
Definition: jsondef.h:4238
static tcvstruc actual
Definition: agent_radio.cpp:181
int32_t ic9100_get_frequency(ic9100_handle &handle)
Definition: ic9100_lib.cpp:778
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
Definition: jsondef.h:651
static string sohstring
Definition: agent_cpu-2-0.cpp:72
Definition: jsondef.h:572
int32_t connect_radio()
Definition: agent_radio.cpp:927
static bool radioconnected
Definition: agent_radio.cpp:161
int32_t request_get_frequency(string &request, string &response, Agent *)
Definition: agent_radio.cpp:731
Radio Transceiver.
Definition: jsondef.h:512
Definition: jsondef.h:583
uint16_t txr_cnt
Definition: jsondef.h:3893
double freq
Input Frequency.
Definition: jsondef.h:2510
int32_t request_get_repeater_squelch(string &request, string &response, Agent *)
Definition: agent_radio.cpp:745
int32_t ic9100_get_bandpass(ic9100_handle &handle)
Definition: ic9100_lib.cpp:510
int32_t request_set_bandpass(string &request, string &response, Agent *)
Definition: agent_radio.cpp:765
static uint16_t radioaddr
Definition: agent_radio.cpp:160
vector< uint16_t > tcv
Definition: jsondef.h:3920
int32_t request_set_offset(string &request, string &response, Agent *)
Definition: agent_radio.cpp:791
static bool radioenabled
Definition: agent_radio.cpp:162
int32_t add_request(string token, external_request_function function, string synopsis="", string description="")
Add internal request to Agent request list with description and synopsis.
Definition: agentclass.cpp:312
int32_t request_set_opmode(string &request, string &response, Agent *)
Definition: agent_radio.cpp:809
float powerin
Definition: ic9100_lib.h:88
Definition: agentclass.h:139
static Agent * agent
Definition: agent_radio.cpp:154
int32_t request_set_modulation(string &request, string &response, Agent *)
Definition: agent_radio.cpp:911
float squelch_tone
repeater squelch tone frequency
Definition: jsondef.h:2524
int32_t request_get_powerin(string &request, string &response, Agent *)
Definition: agent_radio.cpp:773
int32_t usrp_get_frequency(usrp_handle &handle)
Definition: usrp_lib.cpp:148
Definition: jsondef.h:580
float band
Input Filter bandpass.
Definition: jsondef.h:2522
int32_t usrp_get_record(usrp_handle &handle)
Definition: usrp_lib.cpp:306
int32_t shutdown()
Shutdown agent gracefully.
Definition: agentclass.cpp:366
int32_t disconnect_radio()
Definition: agent_radio.cpp:1050
int32_t request_enable(string &request, string &response, Agent *)
Definition: agent_radio.cpp:702
static usrp_handle usrp
Definition: agent_radio.cpp:177
int32_t ic9100_set_mode(ic9100_handle &handle, uint8_t opmode)
Definition: ic9100_lib.cpp:974
double frequency
Definition: usrp_lib.h:93
int32_t ic9100_get_smeter(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1202
static std::string radioname
Definition: agent_radio.cpp:156
int32_t ic9100_get_rfmeter(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1243
int32_t request_disable(string &request, string &response, Agent *)
Definition: agent_radio.cpp:708
int32_t usrp_set_record(usrp_handle &handle, uint8_t record)
Definition: usrp_lib.cpp:322
int32_t request_set_frequency(string &request, string &response, Agent *)
Definition: agent_radio.cpp:737
int32_t ic9100_set_bandpass(ic9100_handle &handle, double bandpass)
Definition: ic9100_lib.cpp:362
static ic9100_handle ic9100
Definition: agent_radio.cpp:176
Definition: jsondef.h:582
int32_t request_get_opmode(string &request, string &response, Agent *)
Definition: agent_radio.cpp:803
int32_t request_set_maxpower(string &request, string &response, Agent *)
Definition: agent_radio.cpp:785
static uint16_t radiotype
Definition: agent_radio.cpp:169
static size_t deviceindex
Definition: agent_radio.cpp:157
static uint16_t model
Definition: agent_radio.cpp:168
Definition: jsondef.h:573
vector< agentstruc > agent
Single entry vector for agent information.
Definition: jsondef.h:4247
float bandpass
Definition: ic9100_lib.h:87
int32_t ic9100_get_rfpower(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1162
int32_t ic9100_get_mode(ic9100_handle &handle)
Definition: ic9100_lib.cpp:810
int32_t request_get_modulation(string &request, string &response, Agent *)
Definition: agent_radio.cpp:905
vector< piecestruc > pieces
Vector of all pieces in node.
Definition: jsondef.h:4232
uint16_t rxr_cnt
Definition: jsondef.h:3881
Definition: jsondef.h:645
int32_t start_active_loop()
Definition: agentclass.cpp:347
int32_t json_createpiece(cosmosstruc *cinfo, string name, DeviceType ctype, double emi, double abs, double hcap, double hcon, double density)
Create new piece.
Definition: jsonlib.cpp:722
cosmosstruc * cinfo
Definition: agentclass.h:346
int32_t request_set_record(string &request, string &response, Agent *)
Definition: agent_radio.cpp:920
Definition: jsondef.h:568
#define AGENT_ERROR_JSON_CREATE
Definition: cosmos-errno.h:105
devspecstruc devspec
Structure for devices (components) special data in node, by type.
Definition: jsondef.h:4241
double frequency
Definition: ic9100_lib.h:92
int32_t request_get_bandpass(string &request, string &response, Agent *)
Definition: agent_radio.cpp:759
Definition: jsondef.h:560
float repeater_squelch
Definition: ic9100_lib.h:91
Radio Transmitter.
Definition: jsondef.h:510
Definition: jsondef.h:565
Definition: jsondef.h:578
static std::string radiodevice
Definition: agent_radio.cpp:159
Definition: jsondef.h:562
static float morefreqoffset
Definition: agent_radio.cpp:165
Definition: jsondef.h:577
int32_t json_createport(cosmosstruc *cinfo, string name, PORT_TYPE type)
Definition: jsonlib.cpp:1086