Jan Breuer
2015-04-22 a5a84c429ac548eafd1d3903225a4ce72104201f
examples/test-tcp/main.c
@@ -44,6 +44,7 @@
#include <sys/ioctl.h>
#include <errno.h>
#include <arpa/inet.h>
#include <unistd.h>
#include "scpi/scpi.h"
#include "../common/scpi-def.h"
@@ -56,21 +57,23 @@
    return 0;
}
int SCPI_Error(scpi_t * context, int_fast16_t err) {
    (void) context;
    // BEEP
    fprintf(stderr, "**ERROR: %d, \"%s\"\r\n", (int32_t) err, SCPI_ErrorTranslate(err));
    return 0;
}
scpi_result_t SCPI_Srq(scpi_t * context) {
    scpi_reg_val_t stb = SCPI_RegGet(context, SCPI_REG_STB);
    fprintf(stderr, "**SRQ: 0x%X (%d)\r\n", stb, stb);
scpi_result_t SCPI_Flush(scpi_t * context) {
    return SCPI_RES_OK;
}
scpi_result_t SCPI_Test(scpi_t * context) {
    fprintf(stderr, "**Test\r\n");
int SCPI_Error(scpi_t * context, int_fast16_t err) {
    (void) context;
    // BEEP
    fprintf(stderr, "**ERROR: %d, \"%s\"\r\n", (int16_t) err, SCPI_ErrorTranslate(err));
    return 0;
}
scpi_result_t SCPI_Control(scpi_t * context, scpi_ctrl_name_t ctrl, scpi_reg_val_t val) {
    if (SCPI_CTRL_SRQ == ctrl) {
        fprintf(stderr, "**SRQ: 0x%X (%d)\r\n", val, val);
    } else {
        fprintf(stderr, "**CTRL %02x: 0x%X (%d)\r\n", ctrl, val, val);
    }
    return SCPI_RES_OK;
}
@@ -79,6 +82,9 @@
    return SCPI_RES_OK;
}
scpi_result_t SCPI_SystemCommTcpipControlQ(scpi_t * context) {
    return SCPI_RES_ERR;
}
static int createServer(int port) {
    int fd;