* the amp may be in amp_init state, but not opened */
| 32 | * the amp may be in amp_init state, but not opened |
| 33 | */ |
| 34 | int dumpcaps_amp(const AMP *amp, FILE *fout) |
| 35 | { |
| 36 | const struct amp_caps *caps; |
| 37 | int backend_warnings = 0; |
| 38 | static char prntbuf[1024]; |
| 39 | |
| 40 | if (!amp || !amp->caps) |
| 41 | { |
| 42 | return -RIG_EINVAL; |
| 43 | } |
| 44 | |
| 45 | caps = amp->caps; |
| 46 | |
| 47 | fprintf(fout, "Caps dump for model:\t%d\n", caps->amp_model); |
| 48 | fprintf(fout, "Model name:\t\t%s\n", caps->model_name); |
| 49 | fprintf(fout, "Mfg name:\t\t%s\n", caps->mfg_name); |
| 50 | fprintf(fout, "Backend version:\t%s\n", caps->version); |
| 51 | fprintf(fout, "Backend copyright:\t%s\n", caps->copyright); |
| 52 | fprintf(fout, "Backend status:\t\t%s\n", rig_strstatus(caps->status)); |
| 53 | fprintf(fout, "Amp type:\t\t"); |
| 54 | |
| 55 | switch (caps->amp_type & AMP_TYPE_MASK) |
| 56 | { |
| 57 | case AMP_TYPE_OTHER: |
| 58 | fprintf(fout, "Other\n"); |
| 59 | break; |
| 60 | |
| 61 | default: |
| 62 | fprintf(fout, "Unknown type=%d\n", caps->amp_type); |
| 63 | backend_warnings++; |
| 64 | } |
| 65 | |
| 66 | fprintf(fout, "Port type:\t\t"); |
| 67 | |
| 68 | switch (caps->port_type) |
| 69 | { |
| 70 | case RIG_PORT_SERIAL: |
| 71 | fprintf(fout, "RS-232\n"); |
| 72 | fprintf(fout, |
| 73 | "Serial speed:\t\t%d..%d baud, %d%c%d, ctrl=%s\n", |
| 74 | caps->serial_rate_min, |
| 75 | caps->serial_rate_max, |
| 76 | caps->serial_data_bits, |
| 77 | caps->serial_parity == RIG_PARITY_NONE ? 'N' : |
| 78 | caps->serial_parity == RIG_PARITY_ODD ? 'O' : |
| 79 | caps->serial_parity == RIG_PARITY_EVEN ? 'E' : |
| 80 | caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S', |
| 81 | caps->serial_stop_bits, |
| 82 | caps->serial_handshake == RIG_HANDSHAKE_NONE ? "NONE" : |
| 83 | (caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS") |
| 84 | ); |
| 85 | break; |
| 86 | |
| 87 | case RIG_PORT_PARALLEL: |
| 88 | fprintf(fout, "Parallel\n"); |
| 89 | break; |
| 90 | |
| 91 | case RIG_PORT_DEVICE: |
no test coverage detected