Skip to content

Commit

Permalink
move port number definitions to header
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterHW committed Nov 4, 2021
1 parent 91731b6 commit ab7afae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 3 additions & 7 deletions examples/test-LwIP-netconn/scpi_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@
#include "lwip/tcp.h"
#include "lwip/inet.h"


#define DEVICE_PORT 5025
#define CONTROL_PORT 5026

#define SCPI_THREAD_PRIO (tskIDLE_PRIORITY + 2)

#define SCPI_MSG_TIMEOUT 0
Expand Down Expand Up @@ -152,7 +148,7 @@ scpi_result_t SCPI_Reset(scpi_t * context) {
}

scpi_result_t SCPI_SystemCommTcpipControlQ(scpi_t * context) {
SCPI_ResultInt(context, CONTROL_PORT);
SCPI_ResultInt(context, SCPI_CONTROL_PORT);
return SCPI_RES_OK;
}

Expand Down Expand Up @@ -379,10 +375,10 @@ static void scpi_server_thread(void *arg) {

scpi_context.user_context = &user_data;

user_data.io_listen = createServer(DEVICE_PORT);
user_data.io_listen = createServer(SCPI_DEVICE_PORT);
LWIP_ASSERT("user_data.io_listen != NULL", user_data.io_listen != NULL);

user_data.control_io_listen = createServer(CONTROL_PORT);
user_data.control_io_listen = createServer(SCPI_CONTROL_PORT);
LWIP_ASSERT("user_data.control_io_listen != NULL", user_data.control_io_listen != NULL);

while (1) {
Expand Down
3 changes: 3 additions & 0 deletions examples/test-LwIP-netconn/scpi_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
extern "C" {
#endif

#define SCPI_DEVICE_PORT 5025 // scpi-raw standard port
#define SCPI_CONTROL_PORT 5026 // libscpi control port (not part of the standard)

#include <stdint.h>

void scpi_server_init(void);
Expand Down

0 comments on commit ab7afae

Please sign in to comment.