Jan Breuer
2013-04-28 929b7b909a37181407336af0d602b608a5161bd8
examples/test-LwIP-netconn/scpi_server.c
@@ -54,6 +54,13 @@
#define SCPI_THREAD_PRIO (tskIDLE_PRIORITY + 2)
#define SCPI_MSG_TEST                   1
#define SCPI_MSG_IO_LISTEN              2
#define SCPI_MSG_CONTROL_IO_LISTEN      3
#define SCPI_MSG_IO                     4
#define SCPI_MSG_CONTROL_IO             5
#define SCPI_MSG_SET_ESE_REQ            6
typedef struct {
    struct netconn *io_listen;
    struct netconn *control_io_listen;
@@ -71,7 +78,6 @@
    .control_io = NULL,
    .evtQueue = 0,
};   
size_t SCPI_Write(scpi_t * context, const char * data, size_t len) {
    if (context->user_context != NULL) {
@@ -98,9 +104,16 @@
    (void) context;
    // BEEP
    iprintf("**ERROR: %ld, \"%s\"\r\n", (int32_t) err, SCPI_ErrorTranslate(err));
    if (err != 0) {
      /* New error */
        /* Beep */
      /* Error LED ON */
    } else {
      /* No more errors in the queue */
        /* Error LED OFF */
    }
    return 0;
}
scpi_result_t SCPI_Control(scpi_t * context, scpi_ctrl_name_t ctrl, scpi_reg_val_t val) {
    char b[16];
@@ -139,19 +152,19 @@
}
#define SCPI_MSG_TEST                   1
#define SCPI_MSG_IO_LISTEN              2
#define SCPI_MSG_CONTROL_IO_LISTEN      3
#define SCPI_MSG_IO                     4
#define SCPI_MSG_CONTROL_IO             5
#define SCPI_MSG_SET_ESE_REQ            6
static void setEseReq(void) {
    SCPI_RegSetBits(&scpi_context, SCPI_REG_ESR, ESR_REQ);
}
void SCPI_RequestControl(void) {
    uint32_t msg = SCPI_MSG_SET_ESE_REQ;
   /* Avoid sending evtQueue message if ESR_REQ is already set
   if((SCPI_RegGet(&scpi_context, SCPI_REG_ESR) & ESR_REQ) == 0) {
       xQueueSend(user_data.evtQueue, &msg, 1000);
   }
   */
    xQueueSend(user_data.evtQueue, &msg, 1000);
}
@@ -207,7 +220,6 @@
    return rc;
}
static int processIoListen(user_data_t * user_data) {
    struct netconn *newconn;