#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdlib.h>
#include <math.h>
#include <unistd.h>
#include <stdint.h>
#include "di194.h"
Go to the source code of this file.
Functions | |
| int | socket_make (void) |
| Create server socket, ready for accept(). | |
| void | sighandler (int signal) |
| Control-break handler. Sets global flag to indicate exit request. | |
| int | daq_loop (const int CLIENT_SOCKET, const int USEC_DELAY) |
| Read data, convert to ASCII, send out over port. | |
| void | main_loop (const int usec_delay) |
| Setup a socket, wait for a connection, send data and close. | |
| int | main (int argc, char *argv[]) |
| Driver / test routine to exercise the DI code. | |
Variables | |
| const int | SRV_PORT = 51307 |
| TCP server port. | |
| const int | QUEUE_LENGTH = 64 |
| TCP connection queue length. | |
| bool | do_exit |
| Global boolean set by signal handler to force exit. | |
Supposed to read a single LM35CAZ on channel zero.
A client connects to the socket, and this triggers a read of channel zero. This is converted to ASCII (fixed format, 5.2f) and printed out to the socket. A purpose-built hack of di_source used for remote monitoring.
Definition in file di_tempd.c.
|
||||||||||||
|
Read data, convert to ASCII, send out over port.
Definition at line 153 of file di_tempd.c. References daq_reading_t::analog, di_close(), di_daq_sync(), di_open(), di_read(), and di_start(). Referenced by main_loop(). |
|
||||||||||||
|
Driver / test routine to exercise the DI code.
Too: -p port parsing, will need for USB serial. getopt!
Definition at line 305 of file di_tempd.c. References do_exit, main_loop(), and sighandler(). |
|
|
Setup a socket, wait for a connection, send data and close.
Definition at line 227 of file di_tempd.c. Referenced by main(). |
|
|
Control-break handler. Sets global flag to indicate exit request. Assumes Installed in interrupt chain by someone else
Definition at line 135 of file di_tempd.c. References do_exit. |
|
|
Create server socket, ready for accept().
Definition at line 46 of file di_tempd.c. References QUEUE_LENGTH, and SRV_PORT. |
|
|
Global boolean set by signal handler to force exit.
Definition at line 36 of file di_tempd.c. |
|
|
TCP connection queue length.
Definition at line 34 of file di_tempd.c. |
|
|
TCP server port.
Definition at line 32 of file di_tempd.c. |
1.3