diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/gpib_server_lin/src/Makefile.in | 4 | ||||
-rw-r--r-- | servers/gpib_server_lin/src/commanalyzer_functions.c | 9 | ||||
-rw-r--r-- | servers/gpib_server_lin/src/commanalyzer_functions.h | 3 | ||||
-rw-r--r-- | servers/gpib_server_lin/src/main_server_lin.c | 12 |
4 files changed, 25 insertions, 3 deletions
diff --git a/servers/gpib_server_lin/src/Makefile.in b/servers/gpib_server_lin/src/Makefile.in index a9deb42..1b9e1d9 100644 --- a/servers/gpib_server_lin/src/Makefile.in +++ b/servers/gpib_server_lin/src/Makefile.in @@ -218,9 +218,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff --git a/servers/gpib_server_lin/src/commanalyzer_functions.c b/servers/gpib_server_lin/src/commanalyzer_functions.c index 7ad705e..0a91731 100644 --- a/servers/gpib_server_lin/src/commanalyzer_functions.c +++ b/servers/gpib_server_lin/src/commanalyzer_functions.c @@ -644,4 +644,13 @@ int commanalyzer_set_spectrum_analyzer_reference_power_level(float desired_refle else { return 1; } +} + +int commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions( char * commanalyzerType, int gpibDevice) { + if ((strcmp("HP8924C", commanalyzerType) == 0)) { + return 8; + } + else { + return -1; + } }
\ No newline at end of file diff --git a/servers/gpib_server_lin/src/commanalyzer_functions.h b/servers/gpib_server_lin/src/commanalyzer_functions.h index 9abd4e0..9c06e4d 100644 --- a/servers/gpib_server_lin/src/commanalyzer_functions.h +++ b/servers/gpib_server_lin/src/commanalyzer_functions.h @@ -46,4 +46,5 @@ int commanalyzer_set_spectrum_analyzer_generator_frequency(float desired_frequen int commanalyzer_spectrum_analyzer_set_generator_sweep_ascending (char * commanalyzerType, int gpibDevice); int commanalyzer_spectrum_analyzer_set_generator_sweep_descending (char * commanalyzerType, int gpibDevice); int commanalyzer_set_spectrum_analyzer_trace_averaging(float desired_avg_samples, char * commanalyzerType, int gpibDevice); -int commanalyzer_set_spectrum_analyzer_reference_power_level(float desired_reflevel, char * commanalyzerType, int gpibDevice);
\ No newline at end of file +int commanalyzer_set_spectrum_analyzer_reference_power_level(float desired_reflevel, char * commanalyzerType, int gpibDevice); +int commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions( char * commanalyzerType, int gpibDevice);
\ No newline at end of file diff --git a/servers/gpib_server_lin/src/main_server_lin.c b/servers/gpib_server_lin/src/main_server_lin.c index 1b32d6e..7184ab4 100644 --- a/servers/gpib_server_lin/src/main_server_lin.c +++ b/servers/gpib_server_lin/src/main_server_lin.c @@ -882,6 +882,8 @@ int mainserver(int fd) { fsync(fd); if (commanalyzer_get_spectrum_analyzer_trace(commanalyzerType, commanalyzer_board_device) == 0) { bytestosend = commanalyzerTraceLength(commanalyzerType)*sizeof(double); + int16_t numbytes = bytestosend; + quiet_write(fd, &numbytes, 2); k=0; while (bytestosend > 0) { return_status = write(fd, commanalyzer_raw_trace_data+k, 1); @@ -1055,6 +1057,16 @@ int mainserver(int fd) { quiet_write(fd, "NCK\r", strlen("NCK\r")); } } + if (readbuf[0] == 62) { // Want the number of vertical divisions available + int16_t divisions = commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions(commanalyzerType, commanalyzer_board_device); + if (divisions >= 0) { + quiet_write(fd, &divisions, 2); + quiet_write(fd, "ACK\r", strlen("ACK\r")); + } + else { + quiet_write(fd, "NCK\r", strlen("NCK\r")); + } + } } break; case 2: // Open the serial port |