The handling of ports in rest-python takes on several forms depending on the IDL defining the port. Devices, Components, and Waveforms provide a ports list. The URL to each of those entities should be substituted for the PARENT_PATH listed in this document.

NOTE: Not all port types support providing extra information. The ones that do are detailed here.

HTTP GET

/ PARENT_PATH / ports / PORT_NAME

{
    "name":     "portName",
    "repId":    "IDL:<namespace>/<type>:<version>",
    "direction": "Uses", /* or Provides */
    "idl": {
        "namespace":    "BULKIO", /* or FRONTEND */
        "version":      ":<version>",
        "type":         "<type>"
    }
}

Every port supports this interface, at a minimum. Many of these fields can be used by the client to determine what additional features are exposed.

WEBSOCKET READ

/ PARENT_PATH / ports / PORT_NAME / bulkio

Required Properties:

  • idl.namespace == "BULKIO"
  • idl.type == any("dataFloat", "dataDouble", "dataOctet", "dataShort")
  • direction == "Uses"

This socket provides both JSON and binary data. The JSON data is a representation of the SRI:

{
    "hversion": "hversion",
    "xstart":   0,
    "xdelta":   1.0,
    "xunits":   5,
    "subsize":  0,
    "ystart":   0,
    "ydelta":   1.0,
    "yunits":   "yunits",
    "mode":     "mode",
    "streamID": "streamID",
    "blocking": "blocking",
    "keywords": {
        "keywordID1": "keywordValue1",
        "keywordID2": "keywordValue2"
    }
}

The binary data is a vector of the appropriate type of information.

NOTE: Those familiar with REDHAWK can see there is no stream ID to marry the SRI with the binary stream. At this time multiple streams on a socket will be interleaved in such a way that re-joining the SRI with the data may be impossible. This will be resolved in a future release when this interface transmits only binary as a Google Protobuf structure.

HTTP GET

/ PARENT_PATH / ports / ...Tuner...

Required Properties:

  • idl.namespace == "FRONTEND"
  • idl.type == any("DigitalTuner", "AnalogTuner")
  • direction == "Provides"
  • "Tuner" in name
{
    "direction": "Provides",
    "name": "DigitalTuner_in",
    "active_allocation_ids": [
        /* List of Allocation IDs (strings) */
    ],
    "idl": {
        "namespace": "FRONTEND",
        "version": ":1.0",
        "type": "DigitalTuner"
    },
    "allocations": [
        /* Empty unless an allocation ID is provided */
    ],
    "repId": "IDL:FRONTEND/DigitalTuner:1.0",
    "tuner_statuses": [
        /* Lists of FRONTEND::tuner_status::* properties for each tuner */
    ]
}

The tuner statuses list is in essence the FRONTEND::tuner_status::* property list, as defined by the IDL. It is not reproduced here.

HTTP GET

/ PARENT_PATH / ports / ...Tuner... / ALLOCATION_ID

Required Properties:

  • idl.namespace == "FRONTEND"
  • idl.type == any("DigitalTuner", "AnalogTuner")
  • direction == "Provides"
  • "Tuner" in name
{
    "direction": "Provides",
    "name": "DigitalTuner_in",
    "active_allocation_ids": [
        /* List of Allocation IDs (strings) */
    ],
    "idl": {
        "namespace": "FRONTEND",
        "version": ":1.0",
        "type": "DigitalTuner"
    },
    "allocations": [
        {
            "id":   "allocationId",
            "value": [
                { "id": "tuner_agc_enable",         "value": true }, 
                { "id": "tuner_control",            "value": "RX_DIGITIZER" }, 
                { "id": "tuner_reference_source",   "value": "NOT_SUPPORTED" }, 
                { "id": "tuner_bandwidth",          "value": 2000000.0 }, 
                { "id": "tuner_output_sample_rate", "value": 2000000.0 }, 
                { "id": "tuner_rf_flow_id",         "value": "RTL_FLOW_ID_NOT_SET" }, 
                { "id": "tuner_enable",             "value": true }, 
                { "id": "tuner_device_control",     "value": true }, 
                { "id": "tuner_gain",               "value": 0.0 }, 
                { "id": "tuner_group_id",           "value": "" }, 
                { "id": "tuner_center_frequency",   "value": 89500000.0 },
                { "id": "tuner_status",             "value" : [ 
                        /* FRONTEND::tuner_status* properties list */ 
                    ],
            ]   
        }
    ],
    "repId": "IDL:FRONTEND/DigitalTuner:1.0",
    "tuner_statuses": [
        /* Lists of FRONTEND::tuner_status::* properties for each tuner */
    ]
}

The tuner statuses list is in essence the FRONTEND::tuner_status::* property list, as defined by the IDL. It is not reproduced here.

HTTP PUT

/ PARENT_PATH / ports / ...Tuner... / ALLOCATION_ID

Required Properties:

  • idl.namespace == "FRONTEND"
  • idl.type == any("DigitalTuner", "AnalogTuner")
  • direction == "Provides"
  • "Tuner" in name

By providing the allocation ID, one can PUT tuner properties directly to the port to use the IDL-defined methods (similar to calling configure, etc.). The structure of properties to use is as follows:

{
    "properties": [
        /* Analog or Digital */
        { "id": "tuner_agc_enable",         "value": true }, 
        { "id": "tuner_center_frequency",   "value": 0.0 },
        { "id": "tuner_reference_source",   "value": "source" }, 
        { "id": "tuner_bandwidth",          "value": 0.0 }, 
        { "id": "tuner_enable",             "value": true },
        { "id": "tuner_gain",               "value": 0.0 },

        /* Digital ONLY */
        { "id": "tuner_output_sample_rate", "value": 0.0 }
    ]
}
HTTP GET

/ PARENT_PATH / ports / RFInfo...

Required Properties:

  • idl.namespace == "FRONTEND"
  • idl.type == "RFInfo"
  • direction == "Provides"
  • name begins "RFInfo"
{
    "type":         "RFInfo", 
    "name":         "RFInfo_in", 
    "idl": {
        "namespace":    "FRONTEND", 
        "version":      ":1.0", 
        "type":         "RFInfo"
    }, 
    "direction": "Provides", 
    "repId": "IDL:FRONTEND/RFInfo:1.0", 

    "rf_flow_id":   "FLOW_ID_NOT_SET", 
    "rfinfo_pkt": {
        "spectrum_inverted":    false, 
        "rf_center_freq":       50000000000.0, 
        "if_center_freq":       0.0, 
        "capabilities": {
            "bw_range":     { "max_val": 0.0, "values": [], "min_val": 0.0 }, 
            "freq_range":   { "max_val": 0.0, "values": [], "min_val": 0.0 }
        }, 
        "ext_path_delays":  [], 
        "rf_bandwidth":     100000000000.0, 
        "rf_flow_id":       "FLOW_ID_NOT_SET", 
        "sensor": {
            "feed": {
                "polarization": "", 
                "name":         "", 
                "freq_range": {
                    "max_val":  0.0, 
                    "values":   [], 
                    "min_val":  0.0
                }
            }, 
            "collector":    "", 
            "rx":           "", 
            "mission":      "", 
            "antenna": {
                "size":         "", 
                "type":         "", 
                "description":  "", 
                "name":         ""
            }
        },
        "additional_info":  [
            /* Properties list */
        ]
    }
}
HTTP GET

/ PARENT_PATH / ports / RFSource...

Required Properties:

  • idl.namespace == "FRONTEND"
  • idl.type == "RFSource"
  • direction == "Provides"
  • name begins "RFSource"
{
    "type":         "RFSource", 
    "name":         "RFSource_in", 
    "idl": {
        "namespace":    "FRONTEND", 
        "version":      ":1.0", 
        "type":         "RFSource"
    }, 
    "direction": "Provides", 
    "repId": "IDL:FRONTEND/RFSource:1.0", 
    
    "available_rf_inputs":  [
        /* List of RFInfoPkt structures */
    ],
    "current_rf_input": {
        /* RFInfoPkt Structure */
    }
}

The RFInfoPkt structure is as follows:

{
    "spectrum_inverted":    false, 
    "rf_center_freq":       50000000000.0, 
    "if_center_freq":       0.0, 
    "capabilities": {
        "bw_range":     { "max_val": 0.0, "values": [], "min_val": 0.0 }, 
        "freq_range":   { "max_val": 0.0, "values": [], "min_val": 0.0 }
    }, 
    "ext_path_delays":  [], 
    "rf_bandwidth":     100000000000.0, 
    "rf_flow_id":       "FLOW_ID_NOT_SET", 
    "sensor": {
        "feed": {
            "polarization": "", 
            "name":         "", 
            "freq_range": {
                "max_val":  0.0, 
                "values":   [], 
                "min_val":  0.0
            }
        }, 
        "collector":    "", 
        "rx":           "", 
        "mission":      "", 
        "antenna": {
            "size":         "", 
            "type":         "", 
            "description":  "", 
            "name":         ""
        }
    },
    "additional_info":  []
}
HTTP GET

/ PARENT_PATH / ports / GPS...

Required Properties:

  • idl.namespace == "FRONTEND"
  • idl.type == "GPS"
  • direction == "Provides"
  • name begins "GPS"
{
    "name": "GPS", 
    "idl": {
        "namespace":    "FRONTEND", 
        "version":      ":1.0", 
        "type":         "GPS"
    }, 
    "direction": "Provides", 
    "repId": "IDL:FRONTEND/GPS:1.0", 

    "gps_info": {
        "freq_offset":  1.9684361882823442e-316, 
        "timestamp": {
            "tcmode":   -6960, 
            "tfsec":    9.6441614068211325e-321, 
            "toff":     2.1219957904712067e-314, 
            "tcstatus": 607, 
            "twsec":    5.7311614917584599e-322
        }, 
        "tfom":             39841168, 
        "freq_variance":    0.0, 
        "rf_flow_id":       "", 
        "snr":              0.0, 
        "mode":             "", 
        "time_variance":    6.9223758361948688e-310, 
        "fom":              39839632, 
        "source_id":        "", 
        "satellite_count":  49, 
        "time_offset":      1.9683401419207926e-316, 
        "status_message":   "", 
        "additional_info":  [], 
        "datumID":          39841280
    }, 
    "gps_time_pos": {
        "position": {
            "lat":      1.968344489698476e-316, 
            "datum":    "", 
            "alt":      0.0, 
            "valid":    true, 
            "lon":      6.9223758306637051e-310
        }, 
        "timestamp": {
            "tcmode":   449, 
            "tfsec":    2.1219957904712067e-314, 
            "toff":     1.9683393514157593e-316, 
            "tcstatus": 0, 
            "twsec":    1.2858049178971268e-312
        }
    }
}
HTTP GET

/ PARENT_PATH / ports / NavData...

Required Properties:

  • idl.namespace == "FRONTEND"
  • idl.type == "NavData"
  • direction == "Provides"
  • name begins "NavData"
{
    "name": "NavData", 
    "idl": {
        "namespace":    "FRONTEND", 
        "version":      ":1.0", 
        "type":         "NavData"
    }, 
    "direction": "Provides", 
    "repId": "IDL:FRONTEND/NavData:1.0", 

    "nav_packet": {
        "position": {
            "valid":    true, 
            "datum":    "DATUM_WGS84", 
            "lat":      1.968344489698476e-316, 
            "alt":      0.0, 
            "lon":      6.9223758306637051e-310
        }, 
        "cposition": {
            "valid":    true,
            "datum":    "DATUM_WGS84",
            "lat":      1.968344489698476e-316, 
            "alt":      0.0, 
            "lon":      6.9223758306637051e-310
        },
        "velocity": {
            "valid":                true,
            "datum":                "DATUM_WGS84",
            "coordinate_system":    "CS_ECF",    /** Values: CS_ECF, CS_ENU, CS_NED **/
            "x":                    0.0,
            "y":                    0.0,
            "z":                    0.0
        },
        "acceleration": {
            "valid":                true,
            "datum":                "DATUM_WGS84",
            "coordinate_system":    "CS_ECF",    /** Values: CS_ECF, CS_ENU, CS_NED **/
            "x":                    0.0,
            "y":                    0.0,
            "z":                    0.0
        },
        "attitude": {
            "valid":    true,
            "pitch":    0.0,
            "yaw":      0.0,
            "roll":     0.0
        }
        "timestamp": {
            "tcmode":   -6960, 
            "tfsec":    9.6441614068211325e-321, 
            "toff":     2.1219957904712067e-314, 
            "tcstatus": 607, 
            "twsec":    5.7311614917584599e-322
        }, 
        "additional_info":  [
            /* Properties list */
        ],
    }
}