Caution! Keep the function consistent with dump_csv_name and set_channel_data! */
| 552 | |
| 553 | /* Caution! Keep the function consistent with dump_csv_name and set_channel_data! */ |
| 554 | int dump_csv_chan(RIG *rig, |
| 555 | vfo_t vfo, |
| 556 | channel_t **chan_pp, |
| 557 | int channel_num, |
| 558 | const chan_t *chan_list, |
| 559 | rig_ptr_t arg) |
| 560 | { |
| 561 | FILE *f = arg; |
| 562 | static channel_t chan; |
| 563 | static int first_time = 1; |
| 564 | const channel_cap_t *mem_caps = &chan_list->mem_caps; |
| 565 | |
| 566 | if (first_time) |
| 567 | { |
| 568 | dump_csv_name(mem_caps, f); |
| 569 | first_time = 0; |
| 570 | } |
| 571 | |
| 572 | if (*chan_pp == NULL) |
| 573 | { |
| 574 | /* |
| 575 | * Hamlib frontend demand application an allocated |
| 576 | * channel_t pointer for next round. |
| 577 | */ |
| 578 | *chan_pp = &chan; |
| 579 | |
| 580 | return RIG_OK; |
| 581 | } |
| 582 | |
| 583 | fprintf(f, "%d%c", chan.channel_num, csv_sep); |
| 584 | |
| 585 | if (mem_caps->bank_num) |
| 586 | { |
| 587 | fprintf(f, "%d%c", chan.bank_num, csv_sep); |
| 588 | } |
| 589 | |
| 590 | if (mem_caps->channel_desc) |
| 591 | { |
| 592 | fprintf(f, "%s%c", chan.channel_desc, csv_sep); |
| 593 | } |
| 594 | |
| 595 | if (mem_caps->vfo) |
| 596 | { |
| 597 | fprintf(f, "%s%c", rig_strvfo(chan.vfo), csv_sep); |
| 598 | } |
| 599 | |
| 600 | if (mem_caps->ant) |
| 601 | { |
| 602 | fprintf(f, "%u%c", chan.ant, csv_sep); |
| 603 | } |
| 604 | |
| 605 | if (mem_caps->freq) |
| 606 | { |
| 607 | fprintf(f, "%"PRIfreq"%c", chan.freq, csv_sep); |
| 608 | } |
| 609 | |
| 610 | if (mem_caps->mode) |
| 611 | { |
nothing calls this directly
no test coverage detected