|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
#include "mrtklib/mrtk_stream.h"#include <ctype.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "mrtklib/mrtk_rcvraw.h"#include "mrtklib/mrtk_sol.h"#include "mrtklib/mrtk_sys.h"#include "mrtklib/mrtk_time.h"#include "mrtklib/mrtk_version.h"#include <fcntl.h>#include <sys/stat.h>#include <sys/time.h>#include <unistd.h>#include <arpa/inet.h>#include <errno.h>#include <netdb.h>#include <netinet/in.h>#include <netinet/tcp.h>#include <sys/socket.h>#include <termios.h>#include "mrtklib/mrtk_trace.h"#include "ntrip_chunk.h"Go to the source code of this file.
Classes | |
| struct | file_t |
| struct | tcp_t |
| struct | tcpsvr_tag |
| struct | tcpcli_t |
| struct | serial_t |
| struct | ntrip_t |
| struct | ntripc_con_t |
| struct | ntripc_t |
| struct | udp_t |
| struct | ftp_t |
| struct | membuf_t |
Macros | |
| #define | __USE_MISC |
| #define | CRTSCTS 020000000000 |
| #define | TINTACT 200 /* period for stream active (ms) */ |
| #define | SERIBUFFSIZE 4096 /* serial buffer size (bytes) */ |
| #define | TIMETAGH_LEN 64 /* time tag file header length */ |
| #define | MAXCLI 32 /* max client connection for tcp svr */ |
| #define | MAXSTATMSG 32 /* max length of status message */ |
| #define | DEFAULT_MEMBUF_SIZE 4096 /* default memory buffer size (bytes) */ |
| #define | NTRIP_AGENT MRTKLIB_SOFTNAME "/" MRTKLIB_VERSION_STRING |
| #define | NTRIP_CLI_PORT 2101 /* default ntrip-client connection port */ |
| #define | NTRIP_SVR_PORT 80 /* default ntrip-server connection port */ |
| #define | NTRIP_MAXRSP 32768 /* max size of ntrip response */ |
| #define | NTRIP_MAXSTR 256 /* max length of mountpoint string */ |
| #define | NTRIP_RSP_OK_CLI "ICY 200 OK\r\n" /* ntrip response: client */ |
| #define | NTRIP_RSP_OK_SVR "OK\r\n" /* ntrip response: server */ |
| #define | NTRIP_RSP_SRCTBL "SOURCETABLE 200 OK\r\n" /* ntrip response: source table */ |
| #define | NTRIP_RSP_TBLEND "ENDSOURCETABLE" |
| #define | NTRIP_RSP_HTTP "HTTP/" /* ntrip response: http */ |
| #define | NTRIP_RSP_ERROR "ERROR" /* ntrip response: error */ |
| #define | NTRIP_RSP_UNAUTH "HTTP/1.0 401 Unauthorized\r\n" |
| #define | NTRIP_RSP_ERR_PWD "ERROR - Bad Password\r\n" |
| #define | NTRIP_RSP_ERR_MNTP "ERROR - Bad Mountpoint\r\n" |
| #define | FTP_CMD "wget" /* ftp/http command */ |
| #define | FTP_TIMEOUT 30 /* ftp/http timeout (s) */ |
| #define | MIN(x, y) |
| #define | dev_t int |
| #define | socket_t int |
| #define | closesocket close |
| #define | BUFADD(p, rem, ...) |
Typedefs | |
| typedef struct tcpsvr_tag | tcpsvr_t |
Functions | |
| static tcpsvr_t * | opentcpsvr (const char *path, char *msg) |
| static void | closetcpsvr (tcpsvr_t *tcpsvr) |
| static int | writetcpsvr (tcpsvr_t *tcpsvr, uint8_t *buff, int n, char *msg) |
| static serial_t * | openserial (const char *path, int mode, char *msg) |
| static void | closeserial (serial_t *serial) |
| static int | readserial (serial_t *serial, uint8_t *buff, int n, char *msg) |
| static int | writeserial (serial_t *serial, uint8_t *buff, int n, char *msg) |
| static int | stateserial (serial_t *serial) |
| static int | statexserial (serial_t *serial, char *msg) |
| static int | openfile_ (file_t *file, gtime_t time, char *msg) |
| static void | closefile_ (file_t *file) |
| static file_t * | openfile (const char *path, int mode, char *msg) |
| static void | closefile (file_t *file) |
| static void | swapfile (file_t *file, gtime_t time, char *msg) |
| static void | swapclose (file_t *file) |
| static int | statefile (file_t *file) |
| static int | statexfile (file_t *file, char *msg) |
| static int | readfile (file_t *file, uint8_t *buff, int nmax, char *msg) |
| static int | writefile (file_t *file, uint8_t *buff, int n, char *msg) |
| static void | syncfile (file_t *file1, file_t *file2) |
| static void | urldecode (char *str) |
| static void | decodetcppath (const char *path, char *addr, char *port, char *user, char *passwd, char *mntpnt, char *str) |
| static int | errsock (void) |
| static int | setsock (int sock, char *msg) |
| static int | accept_nb (int sock, struct sockaddr *addr, socklen_t *len) |
| static int | connect_nb (int sock, struct sockaddr *addr, socklen_t len) |
| static int | recv_nb (int sock, uint8_t *buff, int n) |
| static int | send_nb (int sock, uint8_t *buff, int n) |
| static int | gentcp (tcp_t *tcp, int type, char *msg) |
| static void | discontcp (tcp_t *tcp, int tcon) |
| static void | updatetcpsvr (tcpsvr_t *tcpsvr, char *msg) |
| static int | accsock (tcpsvr_t *tcpsvr, char *msg) |
| static int | waittcpsvr (tcpsvr_t *tcpsvr, char *msg) |
| static int | readtcpsvr (tcpsvr_t *tcpsvr, uint8_t *buff, int n, char *msg) |
| static int | statetcpsvr (tcpsvr_t *tcpsvr) |
| static int | statextcp (tcp_t *tcp, char *msg) |
| static int | statextcpsvr (tcpsvr_t *tcpsvr, char *msg) |
| static int | consock (tcpcli_t *tcpcli, char *msg) |
| static tcpcli_t * | opentcpcli (const char *path, char *msg) |
| static void | closetcpcli (tcpcli_t *tcpcli) |
| static int | waittcpcli (tcpcli_t *tcpcli, char *msg) |
| static int | readtcpcli (tcpcli_t *tcpcli, uint8_t *buff, int n, char *msg) |
| static int | writetcpcli (tcpcli_t *tcpcli, uint8_t *buff, int n, char *msg) |
| static int | statetcpcli (tcpcli_t *tcpcli) |
| static int | statextcpcli (tcpcli_t *tcpcli, char *msg) |
| static int | encbase64 (char *str, const uint8_t *byte, int n) |
| static int | reqntrip_s (ntrip_t *ntrip, char *msg) |
| static int | reqntrip_c (ntrip_t *ntrip, char *msg) |
| static int | rspntrip_s (ntrip_t *ntrip, char *msg) |
| static int | rspntrip_c (ntrip_t *ntrip, char *msg) |
| static int | waitntrip (ntrip_t *ntrip, char *msg) |
| static int | parse_ntrip_query (char *mntpnt, char *host_override, int host_size) |
| static ntrip_t * | openntrip (const char *path, int type, char *msg) |
| static void | closentrip (ntrip_t *ntrip) |
| static int | readntrip (ntrip_t *ntrip, uint8_t *buff, int n, char *msg) |
| static int | writentrip (ntrip_t *ntrip, uint8_t *buff, int n, char *msg) |
| static int | statentrip (ntrip_t *ntrip) |
| static int | statexntrip (ntrip_t *ntrip, char *msg) |
| static ntripc_t * | openntripc (const char *path, char *msg) |
| static void | closentripc (ntripc_t *ntripc) |
| static void | discon_ntripc (ntripc_t *ntripc, int i) |
| static void | time_str_http (char *buff) |
| static void | send_srctbl (ntripc_t *ntripc, int ver, int sock) |
| static void | send_rsp_ok (int ver, int sock) |
| static void | send_rsp_err (ntripc_t *ntripc, int ver, int err, int sock) |
| static void | rsp_ntripc (ntripc_t *ntripc, int i) |
| static void | wait_ntripc (ntripc_t *ntripc, char *msg) |
| static int | readntripc (ntripc_t *ntripc, uint8_t *buff, int n, char *msg) |
| static int | writentripc (ntripc_t *ntripc, uint8_t *buff, int n, char *msg) |
| static int | statentripc (ntripc_t *ntripc) |
| static int | statexntripc (ntripc_t *ntripc, char *msg) |
| static udp_t * | genudp (int type, int port, const char *saddr, char *msg) |
| static udp_t * | openudpsvr (const char *path, char *msg) |
| static void | closeudpsvr (udp_t *udpsvr) |
| static int | readudpsvr (udp_t *udpsvr, uint8_t *buff, int n, char *msg) |
| static int | stateudpsvr (udp_t *udpsvr) |
| static int | statexudpsvr (udp_t *udpsvr, char *msg) |
| static udp_t * | openudpcli (const char *path, char *msg) |
| static void | closeudpcli (udp_t *udpcli) |
| static int | writeudpcli (udp_t *udpcli, uint8_t *buff, int n, char *msg) |
| static int | stateudpcli (udp_t *udpcli) |
| static int | statexudpcli (udp_t *udpcli, char *msg) |
| static void | decodeftppath (const char *path, char *addr, char *file, char *user, char *passwd, int *topts) |
| static gtime_t | nextdltime (const int *topts, int stat) |
| static void * | ftpthread (void *arg) |
| static ftp_t * | openftp (const char *path, int type, char *msg) |
| static void | closeftp (ftp_t *ftp) |
| static int | readftp (ftp_t *ftp, uint8_t *buff, int n, char *msg) |
| static int | stateftp (ftp_t *ftp) |
| static int | statexftp (ftp_t *ftp, char *msg) |
| static membuf_t * | openmembuf (const char *path, char *msg) |
| static void | closemembuf (membuf_t *membuf) |
| static int | readmembuf (membuf_t *membuf, uint8_t *buff, int n, char *msg) |
| static int | writemembuf (membuf_t *membuf, uint8_t *buff, int n, char *msg) |
| static int | statemembuf (membuf_t *membuf) |
| static int | statexmembuf (membuf_t *membuf, char *msg) |
| void | strinitcom (void) |
| Initialize stream communication system. | |
| void | strinit (stream_t *stream) |
| Initialize stream structure. | |
| int | stropen (stream_t *stream, int type, int mode, const char *path) |
| Open stream. | |
| void | strclose (stream_t *stream) |
| Close stream. | |
| void | strsync (stream_t *stream1, stream_t *stream2) |
| Sync streams. | |
| void | strlock (stream_t *stream) |
| Lock stream. | |
| void | strunlock (stream_t *stream) |
| Unlock stream. | |
| int | strread (stream_t *stream, uint8_t *buff, int n) |
| Read data from stream. | |
| int | strwrite (stream_t *stream, uint8_t *buff, int n) |
| Write data to stream. | |
| int | strstat (stream_t *stream, char *msg) |
| Get stream status. | |
| int | strstatx (stream_t *stream, char *msg) |
| Get stream extended status. | |
| void | strsum (stream_t *stream, uint64_t *inb, int *inr, uint64_t *outb, int *outr) |
| Get stream statistics summary. | |
| void | strsetopt (const int *opt) |
| Set stream options. | |
| void | strsettimeout (stream_t *stream, int toinact, int tirecon) |
| Set stream timeout. | |
| void | strsetdir (const char *dir) |
| Set FTP/HTTP local directory. | |
| void | strsetproxy (const char *addr) |
| Set HTTP/NTRIP proxy address. | |
| void | strsetntripver (int ver) |
| Set default NTRIP version for new connections. | |
| gtime_t | strgettime (stream_t *stream) |
| Get stream time. | |
| void | strsendnmea (stream_t *stream, const sol_t *sol) |
| Send NMEA request to stream. | |
| static int | gen_hex (const char *msg, uint8_t *buff) |
| static int | set_brate (stream_t *str, int brate) |
| void | strsendcmd (stream_t *str, const char *cmd) |
| Send receiver command to stream. | |
Variables | |
| const char * | formatstrs [32] |
| static int | toinact = 10000 |
| static int | ticonnect = 10000 |
| static int | tirate = 1000 |
| static int | buffsize = 32768 |
| static char | localdir [1024] = "" |
| static char | proxyaddr [256] = "" |
| static int | ntrip_ver_default = 0 |
| static uint32_t | tick_master = 0 |
| static int | fswapmargin = 30 |
| #define __USE_MISC |
Definition at line 35 of file mrtk_stream.c.
| #define BUFADD | ( | p, | |
| rem, | |||
| ... ) |
Definition at line 1489 of file mrtk_stream.c.
Referenced by reqntrip_c(), and reqntrip_s().
| #define closesocket close |
Definition at line 105 of file mrtk_stream.c.
Referenced by accsock(), closetcpcli(), closetcpsvr(), closeudpcli(), closeudpsvr(), consock(), discontcp(), gentcp(), genudp(), and setsock().
| #define CRTSCTS 020000000000 |
Definition at line 37 of file mrtk_stream.c.
Referenced by openserial().
| #define DEFAULT_MEMBUF_SIZE 4096 /* default memory buffer size (bytes) */ |
Definition at line 57 of file mrtk_stream.c.
Referenced by openmembuf().
| #define dev_t int |
Definition at line 103 of file mrtk_stream.c.
| #define FTP_CMD "wget" /* ftp/http command */ |
Definition at line 74 of file mrtk_stream.c.
Referenced by ftpthread().
| #define FTP_TIMEOUT 30 /* ftp/http timeout (s) */ |
Definition at line 75 of file mrtk_stream.c.
Referenced by ftpthread().
| #define MAXCLI 32 /* max client connection for tcp svr */ |
Definition at line 55 of file mrtk_stream.c.
Referenced by accsock(), closentripc(), closetcpsvr(), openntripc(), readntripc(), readtcpsvr(), statexntripc(), statextcpsvr(), updatetcpsvr(), wait_ntripc(), writentripc(), and writetcpsvr().
| #define MAXSTATMSG 32 /* max length of status message */ |
Definition at line 56 of file mrtk_stream.c.
Referenced by rspntrip_c(), and rspntrip_s().
| #define MIN | ( | x, | |
| y ) |
Definition at line 77 of file mrtk_stream.c.
| #define NTRIP_AGENT MRTKLIB_SOFTNAME "/" MRTKLIB_VERSION_STRING |
Definition at line 59 of file mrtk_stream.c.
Referenced by reqntrip_c(), and reqntrip_s().
| #define NTRIP_CLI_PORT 2101 /* default ntrip-client connection port */ |
Definition at line 60 of file mrtk_stream.c.
Referenced by openntrip(), and openntripc().
| #define NTRIP_MAXRSP 32768 /* max size of ntrip response */ |
Definition at line 62 of file mrtk_stream.c.
Referenced by openntrip(), openntripc(), readntrip(), rsp_ntripc(), rspntrip_c(), rspntrip_s(), wait_ntripc(), and waitntrip().
| #define NTRIP_MAXSTR 256 /* max length of mountpoint string */ |
Definition at line 63 of file mrtk_stream.c.
Referenced by decodetcppath(), and send_srctbl().
| #define NTRIP_RSP_ERR_MNTP "ERROR - Bad Mountpoint\r\n" |
Definition at line 72 of file mrtk_stream.c.
| #define NTRIP_RSP_ERR_PWD "ERROR - Bad Password\r\n" |
Definition at line 71 of file mrtk_stream.c.
| #define NTRIP_RSP_ERROR "ERROR" /* ntrip response: error */ |
Definition at line 69 of file mrtk_stream.c.
Referenced by rspntrip_s().
| #define NTRIP_RSP_HTTP "HTTP/" /* ntrip response: http */ |
Definition at line 68 of file mrtk_stream.c.
| #define NTRIP_RSP_OK_CLI "ICY 200 OK\r\n" /* ntrip response: client */ |
Definition at line 64 of file mrtk_stream.c.
Referenced by rspntrip_c(), and send_rsp_ok().
| #define NTRIP_RSP_OK_SVR "OK\r\n" /* ntrip response: server */ |
Definition at line 65 of file mrtk_stream.c.
Referenced by rspntrip_s().
| #define NTRIP_RSP_SRCTBL "SOURCETABLE 200 OK\r\n" /* ntrip response: source table */ |
Definition at line 66 of file mrtk_stream.c.
Referenced by rspntrip_c(), and send_srctbl().
| #define NTRIP_RSP_TBLEND "ENDSOURCETABLE" |
Definition at line 67 of file mrtk_stream.c.
Referenced by send_srctbl().
| #define NTRIP_RSP_UNAUTH "HTTP/1.0 401 Unauthorized\r\n" |
Definition at line 70 of file mrtk_stream.c.
Referenced by send_rsp_err().
| #define NTRIP_SVR_PORT 80 /* default ntrip-server connection port */ |
Definition at line 61 of file mrtk_stream.c.
Referenced by openntrip().
| #define SERIBUFFSIZE 4096 /* serial buffer size (bytes) */ |
Definition at line 53 of file mrtk_stream.c.
| #define socket_t int |
Definition at line 104 of file mrtk_stream.c.
Referenced by accept_nb(), accsock(), connect_nb(), gentcp(), genudp(), recv_nb(), send_nb(), send_rsp_err(), send_rsp_ok(), send_srctbl(), and setsock().
| #define TIMETAGH_LEN 64 /* time tag file header length */ |
Definition at line 54 of file mrtk_stream.c.
Referenced by openfile_().
| #define TINTACT 200 /* period for stream active (ms) */ |
Definition at line 52 of file mrtk_stream.c.
Referenced by strstat(), and strstatx().
| typedef struct tcpsvr_tag tcpsvr_t |
|
static |
Definition at line 970 of file mrtk_stream.c.
References socket_t.
Referenced by accsock().
|
static |
Definition at line 1169 of file mrtk_stream.c.
References accept_nb(), tcp_t::addr, tcpsvr_tag::cli, closesocket, errsock(), MAXCLI, tcp_t::saddr, setsock(), tcp_t::sock, socket_t, tcp_t::state, tcpsvr_tag::svr, tcp_t::tact, tickget(), and tracet().
Referenced by waittcpsvr().
|
static |
Definition at line 614 of file mrtk_stream.c.
References closefile_(), file_t::fp, free, and tracet().
Referenced by strclose().
|
static |
Definition at line 527 of file mrtk_stream.c.
References file_t::fp, file_t::fp_tag, file_t::fp_tag_tmp, file_t::fp_tmp, file_t::path, timereset(), and tracet().
Referenced by closefile().
|
static |
Definition at line 2852 of file mrtk_stream.c.
References free, ftp_t::state, and tracet().
Referenced by strclose().
|
static |
Definition at line 2963 of file mrtk_stream.c.
References membuf_t::buf, free, and tracet().
Referenced by strclose().
|
static |
Definition at line 1998 of file mrtk_stream.c.
References closetcpcli(), free, MAXSTRMSG, NTRIP_VER_2, ntrip_t::state, ntrip_t::tcp, tracet(), ntrip_t::type, ntrip_t::ver_neg, and writetcpcli().
Referenced by strclose().
|
static |
Definition at line 2177 of file mrtk_stream.c.
References tcpsvr_tag::cli, closetcpsvr(), ntripc_t::con, free, MAXCLI, send_nb(), tcp_t::sock, ntripc_con_t::state, ntripc_t::state, ntripc_t::tcp, tracet(), and ntripc_con_t::ver.
Referenced by strclose().
|
static |
Definition at line 373 of file mrtk_stream.c.
References closetcpsvr(), serial_t::dev, free, serial_t::tcpsvr, and tracet().
Referenced by strclose().
|
static |
Definition at line 1377 of file mrtk_stream.c.
References closesocket, free, tcp_t::sock, tcpcli_t::svr, and tracet().
Referenced by closentrip(), and strclose().
|
static |
Definition at line 1125 of file mrtk_stream.c.
References tcpsvr_tag::cli, closesocket, free, MAXCLI, tcp_t::sock, tcp_t::state, tcpsvr_tag::svr, and tracet().
Referenced by closentripc(), closeserial(), and strclose().
|
static |
Definition at line 2632 of file mrtk_stream.c.
References closesocket, free, udp_t::sock, and tracet().
Referenced by strclose().
|
static |
Definition at line 2575 of file mrtk_stream.c.
References closesocket, free, udp_t::sock, and tracet().
Referenced by strclose().
|
static |
Definition at line 984 of file mrtk_stream.c.
References errsock(), and socket_t.
Referenced by consock().
|
static |
Definition at line 1325 of file mrtk_stream.c.
References tcp_t::addr, closesocket, connect_nb(), errsock(), tcp_t::saddr, tcp_t::sock, tcp_t::state, tcpcli_t::svr, tcp_t::tact, tcp_t::tcon, tcp_t::tdis, tickget(), and tracet().
Referenced by waittcpcli().
|
static |
Definition at line 2663 of file mrtk_stream.c.
References MAXSTRPATH, and tracet().
Referenced by openftp().
|
static |
Definition at line 874 of file mrtk_stream.c.
References MAXSTRPATH, NTRIP_MAXSTR, tracet(), and urldecode().
Referenced by openntrip(), openntripc(), opentcpcli(), opentcpsvr(), openudpcli(), and openudpsvr().
|
static |
Definition at line 2192 of file mrtk_stream.c.
References ntripc_con_t::buff, tcpsvr_tag::cli, ntripc_t::con, discontcp(), ntripc_con_t::nb, send_nb(), tcp_t::sock, ntripc_con_t::state, ntripc_t::tcp, ticonnect, tracet(), and ntripc_con_t::ver.
Referenced by readntripc(), rsp_ntripc(), wait_ntripc(), and writentripc().
|
static |
Definition at line 1091 of file mrtk_stream.c.
References closesocket, tcp_t::sock, tcp_t::state, tcp_t::tcon, tcp_t::tdis, tickget(), and tracet().
Referenced by discon_ntripc(), readtcpcli(), readtcpsvr(), rspntrip_c(), rspntrip_s(), waittcpcli(), writetcpcli(), and writetcpsvr().
|
static |
Definition at line 1466 of file mrtk_stream.c.
References tracet().
Referenced by reqntrip_c(), reqntrip_s(), and rsp_ntripc().
|
static |
Definition at line 943 of file mrtk_stream.c.
Referenced by accsock(), connect_nb(), consock(), gentcp(), genudp(), readntripc(), readtcpcli(), readtcpsvr(), setsock(), wait_ntripc(), writentripc(), writetcpcli(), and writetcpsvr().
|
static |
Definition at line 2738 of file mrtk_stream.c.
References ftp_t::addr, ftp_t::error, execcmd(), ftp_t::file, FILEPATHSEP, FTP_CMD, FTP_TIMEOUT, ftp_t::local, localdir, ftp_t::passwd, ftp_t::proto, proxyaddr, reppath(), rtk_uncompress(), ftp_t::state, timeadd(), timeget(), ftp_t::topts, tracet(), ftp_t::user, and utc2gpst().
Referenced by readftp().
|
static |
Definition at line 3713 of file mrtk_stream.c.
References trace().
Referenced by strsendcmd().
|
static |
Definition at line 1036 of file mrtk_stream.c.
References tcp_t::addr, closesocket, errsock(), tcp_t::port, tcp_t::saddr, setsock(), tcp_t::sock, socket_t, tcp_t::state, tcp_t::tact, tcp_t::tcon, tcp_t::tdis, tickget(), ticonnect, and tracet().
Referenced by opentcpsvr(), and waittcpcli().
|
static |
Definition at line 2502 of file mrtk_stream.c.
References udp_t::addr, buffsize, closesocket, errsock(), free, malloc, udp_t::port, udp_t::saddr, udp_t::sock, socket_t, udp_t::state, tracet(), and udp_t::type.
Referenced by openudpcli(), and openudpsvr().
|
static |
Definition at line 2714 of file mrtk_stream.c.
References gpst2time(), time2gpst(), timeget(), tracet(), and utc2gpst().
Referenced by readftp().
|
static |
Definition at line 548 of file mrtk_stream.c.
References file_t::fp, file_t::fp_tag, file_t::fp_tag_tmp, file_t::fp_tmp, file_t::fpos_n, free, file_t::lock, malloc, file_t::mode, file_t::offset, openfile_(), file_t::openpath, file_t::path, file_t::repmode, rtk_initlock, file_t::size_fpos, file_t::speed, file_t::start, STR_MODE_R, STR_MODE_W, file_t::swapintv, file_t::tick, file_t::tick_f, file_t::tick_n, file_t::time, timeget(), file_t::timetag, tracet(), utc2gpst(), and file_t::wtime.
Referenced by stropen().
Definition at line 441 of file mrtk_stream.c.
References createdir(), file_t::fp, file_t::fp_tag, file_t::fpos_n, gpst2utc(), MAXSTRPATH, file_t::mode, file_t::openpath, file_t::path, reppath(), gtime_t::sec, STR_MODE_R, STR_MODE_W, file_t::tick, file_t::tick_f, file_t::tick_n, tickget(), file_t::time, gtime_t::time, time_str(), timeget(), timeset(), file_t::timetag, TIMETAGH_LEN, tracet(), utc2gpst(), and file_t::wtime.
Referenced by openfile(), and swapfile().
|
static |
Definition at line 2826 of file mrtk_stream.c.
References ftp_t::addr, decodeftppath(), ftp_t::error, ftp_t::file, ftp_t::local, malloc, ftp_t::passwd, ftp_t::proto, ftp_t::state, ftp_t::thread, timeadd(), timeget(), ftp_t::tnext, ftp_t::topts, tracet(), and ftp_t::user.
Referenced by stropen().
|
static |
Definition at line 2935 of file mrtk_stream.c.
References membuf_t::buf, membuf_t::bufsize, DEFAULT_MEMBUF_SIZE, free, membuf_t::lock, malloc, membuf_t::rp, rtk_initlock, membuf_t::state, tracet(), and membuf_t::wp.
Referenced by stropen().
|
static |
Definition at line 1935 of file mrtk_stream.c.
References ntrip_t::buff, ntrip_t::cdec, chunk_dec_init(), ntrip_t::chunked, decodetcppath(), free, ntrip_t::host, malloc, MAXSTRPATH, ntrip_t::mntpnt, ntrip_t::nb, NTRIP_CLI_PORT, NTRIP_MAXRSP, NTRIP_SVR_PORT, NTRIP_VER_AUTO, opentcpcli(), parse_ntrip_query(), ntrip_t::passwd, proxyaddr, ntrip_t::state, ntrip_t::str, ntrip_t::tcp, tracet(), ntrip_t::type, ntrip_t::url, ntrip_t::user, ntrip_t::v2_tried, ntrip_t::ver, and ntrip_t::ver_neg.
Referenced by stropen().
|
static |
Definition at line 2135 of file mrtk_stream.c.
References ntripc_con_t::buff, ntripc_t::con, decodetcppath(), free, malloc, MAXCLI, MAXSTRPATH, ntripc_t::mntpnt, ntripc_con_t::nb, NTRIP_CLI_PORT, NTRIP_MAXRSP, opentcpsvr(), ntripc_t::passwd, ntripc_t::srctbl, ntripc_con_t::state, ntripc_t::state, ntripc_t::tcp, tracet(), ntripc_t::user, and ntripc_con_t::ver.
Referenced by stropen().
|
static |
Definition at line 250 of file mrtk_stream.c.
References calloc, CRTSCTS, serial_t::dev, free, opentcpsvr(), STR_MODE_R, STR_MODE_W, serial_t::tcpsvr, and tracet().
Referenced by stropen().
|
static |
Definition at line 1354 of file mrtk_stream.c.
References decodetcppath(), free, malloc, tcp_t::port, tcp_t::saddr, tcpcli_t::svr, tcp_t::tcon, ticonnect, tcpcli_t::tirecon, tcpcli_t::toinact, toinact, and tracet().
Referenced by openntrip(), and stropen().
|
static |
Definition at line 1100 of file mrtk_stream.c.
References decodetcppath(), free, gentcp(), malloc, tcp_t::port, tcp_t::saddr, tcpsvr_tag::svr, tcp_t::tcon, and tracet().
Referenced by openntripc(), openserial(), and stropen().
|
static |
Definition at line 2616 of file mrtk_stream.c.
References decodetcppath(), genudp(), and tracet().
Referenced by stropen().
|
static |
Definition at line 2559 of file mrtk_stream.c.
References decodetcppath(), genudp(), and tracet().
Referenced by stropen().
|
static |
Definition at line 1875 of file mrtk_stream.c.
References NTRIP_VER_1, NTRIP_VER_2, ntrip_ver_default, and tracet().
Referenced by openntrip().
|
static |
Definition at line 690 of file mrtk_stream.c.
References file_t::fp, file_t::fp_tag, file_t::fpos_n, gpst2utc(), file_t::offset, file_t::repmode, file_t::size_fpos, file_t::speed, file_t::start, file_t::tick, tick_master, file_t::tick_n, tickget(), file_t::time, timeadd(), timeset(), tracet(), and file_t::wtime.
Referenced by strread().
|
static |
Definition at line 2860 of file mrtk_stream.c.
References ftp_t::addr, ftp_t::error, ftpthread(), ftp_t::local, nextdltime(), ftp_t::proto, ftp_t::state, ftp_t::thread, timediff(), timeget(), ftp_t::tnext, ftp_t::topts, tracet(), and utc2gpst().
Referenced by strread().
|
static |
Definition at line 2970 of file mrtk_stream.c.
References membuf_t::buf, membuf_t::bufsize, membuf_t::lock, membuf_t::rp, rtk_lock, rtk_unlock, tracet(), and membuf_t::wp.
Referenced by strread().
|
static |
Definition at line 2011 of file mrtk_stream.c.
References ntrip_t::buff, ntrip_t::cdec, chunk_dec_init(), chunk_decode(), ntrip_t::chunked, ntrip_t::nb, NTRIP_MAXRSP, readtcpcli(), ntrip_t::tcp, tracet(), and waitntrip().
Referenced by strread().
|
static |
Definition at line 2391 of file mrtk_stream.c.
References tcpsvr_tag::cli, ntripc_t::con, discon_ntripc(), errsock(), MAXCLI, recv_nb(), tcp_t::sock, ntripc_con_t::state, tcp_t::tact, ntripc_t::tcp, tickget(), tracet(), and wait_ntripc().
Referenced by strread().
|
static |
Definition at line 386 of file mrtk_stream.c.
References serial_t::dev, serial_t::tcpsvr, tracet(), and writetcpsvr().
Referenced by strread().
|
static |
Definition at line 1412 of file mrtk_stream.c.
References discontcp(), errsock(), recv_nb(), tcp_t::sock, tcpcli_t::svr, tcp_t::tact, tickget(), tcpcli_t::tirecon, tracet(), and waittcpcli().
Referenced by readntrip(), strread(), and waitntrip().
|
static |
Definition at line 1226 of file mrtk_stream.c.
References tcpsvr_tag::cli, discontcp(), errsock(), MAXCLI, recv_nb(), tcp_t::sock, tcp_t::state, tcpsvr_tag::svr, tcp_t::tact, tickget(), ticonnect, tracet(), updatetcpsvr(), and waittcpsvr().
Referenced by strread().
|
static |
Definition at line 2582 of file mrtk_stream.c.
References udp_t::sock, and tracet().
Referenced by strread().
|
static |
Definition at line 1006 of file mrtk_stream.c.
References socket_t.
Referenced by readntripc(), readtcpcli(), readtcpsvr(), and wait_ntripc().
|
static |
Definition at line 1557 of file mrtk_stream.c.
References BUFADD, encbase64(), ntrip_t::host, ntrip_t::mntpnt, NTRIP_AGENT, NTRIP_VER_2, NTRIP_VER_AUTO, ntrip_t::passwd, ntrip_t::state, ntrip_t::tcp, tracet(), ntrip_t::url, ntrip_t::user, ntrip_t::v2_tried, ntrip_t::ver, ntrip_t::ver_neg, and writetcpcli().
Referenced by waitntrip().
|
static |
Definition at line 1500 of file mrtk_stream.c.
References BUFADD, encbase64(), ntrip_t::host, ntrip_t::mntpnt, NTRIP_AGENT, NTRIP_VER_2, NTRIP_VER_AUTO, ntrip_t::passwd, ntrip_t::state, ntrip_t::str, ntrip_t::tcp, tracet(), ntrip_t::url, ntrip_t::user, ntrip_t::v2_tried, ntrip_t::ver, ntrip_t::ver_neg, and writetcpcli().
Referenced by waitntrip().
|
static |
Definition at line 2281 of file mrtk_stream.c.
References ntripc_con_t::buff, tcpsvr_tag::cli, ntripc_t::con, discon_ntripc(), encbase64(), ntripc_con_t::mntpnt, ntripc_t::mntpnt, ntripc_con_t::nb, NTRIP_MAXRSP, ntripc_t::passwd, send_rsp_err(), send_rsp_ok(), send_srctbl(), tcp_t::sock, ntripc_con_t::state, ntripc_t::tcp, tracet(), ntripc_t::user, and ntripc_con_t::ver.
Referenced by wait_ntripc().
|
static |
Definition at line 1698 of file mrtk_stream.c.
References ntrip_t::buff, ntrip_t::cdec, chunk_dec_init(), ntrip_t::chunked, discontcp(), http_find_header(), http_header_end(), http_status_code(), MAXSTATMSG, ntrip_t::mntpnt, ntrip_t::nb, NTRIP_MAXRSP, NTRIP_RSP_OK_CLI, NTRIP_RSP_SRCTBL, NTRIP_VER_1, NTRIP_VER_2, NTRIP_VER_AUTO, tcp_t::saddr, ntrip_t::state, stristr(), tcpcli_t::svr, ntrip_t::tcp, tcpcli_t::tirecon, tracet(), ntrip_t::v2_tried, ntrip_t::ver, and ntrip_t::ver_neg.
Referenced by waitntrip().
|
static |
Definition at line 1629 of file mrtk_stream.c.
References ntrip_t::buff, discontcp(), http_header_end(), http_status_code(), MAXSTATMSG, ntrip_t::mntpnt, ntrip_t::nb, NTRIP_MAXRSP, NTRIP_RSP_ERROR, NTRIP_RSP_OK_SVR, NTRIP_VER_1, NTRIP_VER_2, tcp_t::saddr, ntrip_t::state, tcpcli_t::svr, ntrip_t::tcp, tcpcli_t::tirecon, tracet(), and ntrip_t::ver_neg.
Referenced by waitntrip().
|
static |
Definition at line 1021 of file mrtk_stream.c.
References socket_t.
Referenced by closentripc(), discon_ntripc(), send_rsp_err(), send_rsp_ok(), send_srctbl(), writentripc(), writetcpcli(), and writetcpsvr().
|
static |
Definition at line 2259 of file mrtk_stream.c.
References NTRIP_RSP_UNAUTH, send_nb(), send_srctbl(), socket_t, and time_str_http().
Referenced by rsp_ntripc().
|
static |
Definition at line 2239 of file mrtk_stream.c.
References NTRIP_RSP_OK_CLI, send_nb(), socket_t, and time_str_http().
Referenced by rsp_ntripc().
|
static |
Definition at line 2217 of file mrtk_stream.c.
References ntripc_t::mntpnt, NTRIP_MAXSTR, NTRIP_RSP_SRCTBL, NTRIP_RSP_TBLEND, send_nb(), socket_t, ntripc_t::srctbl, and time_str_http().
Referenced by rsp_ntripc(), and send_rsp_err().
|
static |
Definition at line 3733 of file mrtk_stream.c.
References stream_tag::mode, stream_tag::path, STR_SERIAL, strclose(), stropen(), and stream_tag::type.
Referenced by strsendcmd().
|
static |
Definition at line 946 of file mrtk_stream.c.
References buffsize, closesocket, errsock(), socket_t, and tracet().
Referenced by accsock(), and gentcp().
|
static |
Definition at line 661 of file mrtk_stream.c.
Referenced by strstat().
|
static |
Definition at line 2911 of file mrtk_stream.c.
References ftp_t::state.
Referenced by strstat().
|
static |
Definition at line 3022 of file mrtk_stream.c.
References membuf_t::state.
Referenced by strstat().
|
static |
Definition at line 2105 of file mrtk_stream.c.
References ntrip_t::state, tcp_t::state, tcpcli_t::svr, and ntrip_t::tcp.
Referenced by strstat().
|
static |
Definition at line 2472 of file mrtk_stream.c.
References ntripc_t::state.
Referenced by strstat().
|
static |
Definition at line 425 of file mrtk_stream.c.
References serial_t::error.
Referenced by strstat().
|
static |
Definition at line 1462 of file mrtk_stream.c.
References tcp_t::state, and tcpcli_t::svr.
Referenced by strstat().
|
static |
Definition at line 1287 of file mrtk_stream.c.
References tcp_t::state, and tcpsvr_tag::svr.
Referenced by strstat().
|
static |
Definition at line 2645 of file mrtk_stream.c.
References udp_t::state.
Referenced by strstat().
|
static |
Definition at line 2599 of file mrtk_stream.c.
References udp_t::state.
Referenced by strstat().
|
static |
Definition at line 663 of file mrtk_stream.c.
References file_t::mode, file_t::offset, file_t::openpath, file_t::path, file_t::repmode, file_t::speed, file_t::start, file_t::swapintv, file_t::tick, file_t::tick_f, file_t::time, time2str(), file_t::timetag, and file_t::wtime.
Referenced by strstatx().
|
static |
Definition at line 2923 of file mrtk_stream.c.
References ftp_t::state.
Referenced by strstatx().
|
static |
Definition at line 3024 of file mrtk_stream.c.
References membuf_t::bufsize, membuf_t::rp, membuf_t::state, and membuf_t::wp.
Referenced by strstatx().
|
static |
Definition at line 2109 of file mrtk_stream.c.
References ntrip_t::chunked, ntrip_t::host, ntrip_t::mntpnt, ntrip_t::nb, ntrip_t::passwd, ntrip_t::state, tcp_t::state, statextcp(), ntrip_t::str, tcpcli_t::svr, ntrip_t::tcp, ntrip_t::type, ntrip_t::url, ntrip_t::user, ntrip_t::ver, and ntrip_t::ver_neg.
Referenced by strstatx().
|
static |
Definition at line 2474 of file mrtk_stream.c.
References tcpsvr_tag::cli, ntripc_t::con, MAXCLI, ntripc_con_t::mntpnt, ntripc_t::mntpnt, ntripc_con_t::nb, ntripc_t::passwd, ntripc_t::srctbl, ntripc_t::state, tcp_t::state, statextcp(), tcpsvr_tag::svr, ntripc_t::tcp, ntripc_t::type, and ntripc_t::user.
Referenced by strstatx().
|
static |
Definition at line 427 of file mrtk_stream.c.
References serial_t::dev, and serial_t::error.
Referenced by strstatx().
|
static |
Definition at line 1289 of file mrtk_stream.c.
References tcp_t::port, tcp_t::saddr, tcp_t::sock, tcp_t::state, tcp_t::tact, tcp_t::tcon, and tcp_t::tdis.
Referenced by statexntrip(), statexntripc(), and statextcpsvr().
|
static |
Definition at line 1464 of file mrtk_stream.c.
References tcp_t::state, and tcpcli_t::svr.
Referenced by strstatx().
|
static |
Definition at line 1304 of file mrtk_stream.c.
References tcpsvr_tag::cli, MAXCLI, tcp_t::state, statextcp(), and tcpsvr_tag::svr.
Referenced by strstatx().
|
static |
Definition at line 2647 of file mrtk_stream.c.
References udp_t::port, udp_t::saddr, udp_t::sock, udp_t::state, and udp_t::type.
Referenced by strstatx().
|
static |
Definition at line 2601 of file mrtk_stream.c.
References udp_t::port, udp_t::sock, udp_t::state, and udp_t::type.
Referenced by strstatx().
|
extern |
Close stream.
| [in,out] | stream | stream struct |
Definition at line 3233 of file mrtk_stream.c.
References closefile(), closeftp(), closemembuf(), closentrip(), closentripc(), closeserial(), closetcpcli(), closetcpsvr(), closeudpcli(), closeudpsvr(), stream_tag::inr, stream_tag::mode, stream_tag::msg, stream_tag::outr, stream_tag::path, stream_tag::port, stream_tag::state, STR_FILE, STR_FTP, STR_HTTP, STR_MEMBUF, STR_NTRIPCAS, STR_NTRIPCLI, STR_NTRIPSVR, STR_SERIAL, STR_TCPCLI, STR_TCPSVR, STR_UDPCLI, STR_UDPSVR, strlock(), strunlock(), trace(), tracet(), and stream_tag::type.
Referenced by rtksvrclosestr(), rtksvrstart(), rtksvrthread(), set_brate(), strsvrstart(), and strsvrthread().
Get stream time.
| [in] | stream | stream struct |
Definition at line 3690 of file mrtk_stream.c.
References stream_tag::mode, stream_tag::port, file_t::start, STR_FILE, STR_MODE_R, file_t::time, timeadd(), timeget(), stream_tag::type, and utc2gpst().
Referenced by rtksvrstart().
|
extern |
Initialize stream structure.
| [in,out] | stream | stream struct |
Definition at line 3049 of file mrtk_stream.c.
References stream_tag::inb, stream_tag::inbt, stream_tag::inr, stream_tag::lock, stream_tag::mode, stream_tag::msg, stream_tag::outb, stream_tag::outbt, stream_tag::outr, stream_tag::path, stream_tag::port, rtk_initlock, stream_tag::state, stream_tag::tact, stream_tag::tick_i, stream_tag::tick_o, tracet(), and stream_tag::type.
Referenced by rtksvrinit(), and strsvrinit().
|
extern |
Initialize stream communication system.
Definition at line 3043 of file mrtk_stream.c.
References tracet().
Referenced by rtksvrstart(), and strsvrstart().
|
extern |
Lock stream.
| [in,out] | stream | stream struct |
Definition at line 3313 of file mrtk_stream.c.
References stream_tag::lock, and rtk_lock.
Referenced by strclose(), strread(), strstat(), strstatx(), strsum(), and strwrite().
|
extern |
Open stream.
| [in,out] | stream | stream struct |
| [in] | type | stream type (STR_???) |
| [in] | mode | stream mode (STR_MODE_?) |
| [in] | path | stream path |
Definition at line 3173 of file mrtk_stream.c.
References stream_tag::inb, stream_tag::inbt, stream_tag::inr, stream_tag::mode, stream_tag::msg, openfile(), openftp(), openmembuf(), openntrip(), openntripc(), openserial(), opentcpcli(), opentcpsvr(), openudpcli(), openudpsvr(), stream_tag::outb, stream_tag::outbt, stream_tag::outr, stream_tag::path, stream_tag::port, stream_tag::state, STR_FILE, STR_FTP, STR_HTTP, STR_MEMBUF, STR_NTRIPCAS, STR_NTRIPCLI, STR_NTRIPSVR, STR_SERIAL, STR_TCPCLI, STR_TCPSVR, STR_UDPCLI, STR_UDPSVR, stream_tag::tick_i, stream_tag::tick_o, tickget(), tracet(), and stream_tag::type.
Referenced by rtksvropenstr(), rtksvrstart(), set_brate(), and strsvrstart().
|
extern |
Read data from stream.
| [in,out] | stream | stream struct |
| [out] | buff | data buffer |
| [in] | n | max data length (bytes) |
Definition at line 3324 of file mrtk_stream.c.
References stream_tag::inb, stream_tag::inbt, stream_tag::inr, stream_tag::mode, stream_tag::msg, stream_tag::port, readfile(), readftp(), readmembuf(), readntrip(), readntripc(), readserial(), readtcpcli(), readtcpsvr(), readudpsvr(), STR_FILE, STR_FTP, STR_HTTP, STR_MEMBUF, STR_MODE_R, STR_NTRIPCAS, STR_NTRIPCLI, STR_NTRIPSVR, STR_SERIAL, STR_TCPCLI, STR_TCPSVR, STR_UDPSVR, strlock(), strunlock(), stream_tag::tact, stream_tag::tick_i, tickget(), tirate, tracet(), and stream_tag::type.
Referenced by rtksvrthread(), and strsvrthread().
|
extern |
Send receiver command to stream.
| [in,out] | stream | stream struct |
| [in] | cmd | receiver command |
Definition at line 3760 of file mrtk_stream.c.
References gen_hex(), gen_nvs(), gen_stq(), gen_ubx(), set_brate(), sleepms(), strwrite(), and tracet().
Referenced by periodic_cmd(), periodic_cmd(), rtksvrstart(), rtksvrstop(), send_nmea(), strsvrstart(), and strsvrstop().
Send NMEA request to stream.
| [in,out] | stream | stream struct |
| [in] | sol | solution data |
Definition at line 3703 of file mrtk_stream.c.
References outnmea_gga(), sol_t::rr, strwrite(), and tracet().
Referenced by send_nmea(), and strsvrthread().
|
extern |
Set FTP/HTTP local directory.
| [in] | dir | local directory |
Definition at line 3658 of file mrtk_stream.c.
References localdir, and tracet().
|
extern |
Set default NTRIP version for new connections.
| [in] | ver | NTRIP version (0:auto, 1:v1, 2:v2) |
When set to auto (0), the client tries NTRIP v2 first and falls back to v1 if the caster does not support it. Per-stream override is available via the ?ver=N query parameter in the stream path.
Definition at line 3678 of file mrtk_stream.c.
References ntrip_ver_default, and tracet().
|
extern |
Set stream options.
| [in] | opt | stream options (timeout/reconnect/rate/buffsize/fswapmargin) |
Definition at line 3620 of file mrtk_stream.c.
References buffsize, fswapmargin, ticonnect, tirate, toinact, and tracet().
Referenced by strsvrstart().
|
extern |
Set HTTP/NTRIP proxy address.
| [in] | addr | proxy address |
Definition at line 3668 of file mrtk_stream.c.
References proxyaddr, and tracet().
|
extern |
Set stream timeout.
| [in,out] | stream | stream struct |
| [in] | toinact | inactive timeout (ms) (0:no timeout) |
| [in] | tirecon | reconnect interval (ms) |
Definition at line 3637 of file mrtk_stream.c.
References stream_tag::port, STR_NTRIPCLI, STR_NTRIPSVR, STR_TCPCLI, tcpcli_t::tirecon, tcpcli_t::toinact, toinact, tracet(), and stream_tag::type.
|
extern |
Get stream status.
| [in] | stream | stream struct |
| [out] | msg | status message (NULL: no output) |
Definition at line 3458 of file mrtk_stream.c.
References MAXSTRMSG, stream_tag::msg, stream_tag::port, stream_tag::state, statefile(), stateftp(), statemembuf(), statentrip(), statentripc(), stateserial(), statetcpcli(), statetcpsvr(), stateudpcli(), stateudpsvr(), STR_FILE, STR_FTP, STR_HTTP, STR_MEMBUF, STR_NTRIPCAS, STR_NTRIPCLI, STR_NTRIPSVR, STR_SERIAL, STR_TCPCLI, STR_TCPSVR, STR_UDPCLI, STR_UDPSVR, strlock(), strunlock(), stream_tag::tact, tickget(), TINTACT, tracet(), and stream_tag::type.
Referenced by rtksvrsstat(), and strsvrstat().
|
extern |
Get stream extended status.
| [in] | stream | stream struct |
| [out] | msg | status message (NULL: no output) |
Definition at line 3523 of file mrtk_stream.c.
References stream_tag::port, stream_tag::state, statexfile(), statexftp(), statexmembuf(), statexntrip(), statexntripc(), statexserial(), statextcpcli(), statextcpsvr(), statexudpcli(), statexudpsvr(), STR_FILE, STR_FTP, STR_HTTP, STR_MEMBUF, STR_NTRIPCAS, STR_NTRIPCLI, STR_NTRIPSVR, STR_SERIAL, STR_TCPCLI, STR_TCPSVR, STR_UDPCLI, STR_UDPSVR, strlock(), strunlock(), stream_tag::tact, tickget(), TINTACT, tracet(), and stream_tag::type.
|
extern |
Get stream statistics summary.
| [in] | stream | stream struct |
| [out] | inb | input bytes (NULL: not output) |
| [out] | inr | input rate (bps) (NULL: not output) |
| [out] | outb | output bytes (NULL: not output) |
| [out] | outr | output rate (bps) (NULL: not output) |
Definition at line 3589 of file mrtk_stream.c.
References stream_tag::inb, stream_tag::inr, stream_tag::outb, stream_tag::outr, strlock(), strunlock(), and tracet().
Referenced by strsvrstat().
Sync streams.
| [in,out] | stream1 | stream struct 1 |
| [in,out] | stream2 | stream struct 2 |
Definition at line 3297 of file mrtk_stream.c.
References stream_tag::port, STR_FILE, syncfile(), and stream_tag::type.
Referenced by rtksvrstart().
|
extern |
Unlock stream.
| [in,out] | stream | stream struct |
Definition at line 3314 of file mrtk_stream.c.
References stream_tag::lock, and rtk_unlock.
Referenced by strclose(), strread(), strstat(), strstatx(), strsum(), and strwrite().
|
extern |
Write data to stream.
| [in,out] | stream | stream struct |
| [in] | buff | data buffer |
| [in] | n | data length (bytes) |
Definition at line 3394 of file mrtk_stream.c.
References stream_tag::mode, stream_tag::msg, stream_tag::outb, stream_tag::outbt, stream_tag::outr, stream_tag::port, STR_FILE, STR_FTP, STR_HTTP, STR_MEMBUF, STR_MODE_W, STR_NTRIPCAS, STR_NTRIPCLI, STR_NTRIPSVR, STR_SERIAL, STR_TCPCLI, STR_TCPSVR, STR_UDPCLI, strlock(), strunlock(), stream_tag::tact, stream_tag::tick_o, tickget(), tirate, tracet(), stream_tag::type, writefile(), writemembuf(), writentrip(), writentripc(), writeserial(), writetcpcli(), writetcpsvr(), and writeudpcli().
Referenced by output_lclcmb(), rtksvrmark(), rtksvrstart(), rtksvrthread(), strsendcmd(), strsendnmea(), strsvrstart(), strsvrthread(), write_nav(), write_nav_cycle(), write_obs(), write_rtcm3_msm(), write_sta_cycle(), writesol(), and writesolhead().
|
static |
Definition at line 649 of file mrtk_stream.c.
References file_t::fp_tag_tmp, file_t::fp_tmp, and tracet().
Referenced by writefile().
Definition at line 624 of file mrtk_stream.c.
References file_t::fp, file_t::fp_tag, file_t::fp_tag_tmp, file_t::fp_tmp, MAXSTRPATH, openfile_(), file_t::openpath, file_t::path, reppath(), time_str(), and tracet().
Referenced by writefile().
Definition at line 834 of file mrtk_stream.c.
References file_t::fp_tag, file_t::offset, file_t::repmode, and file_t::tick_f.
Referenced by strsync().
|
static |
Definition at line 2207 of file mrtk_stream.c.
Referenced by send_rsp_err(), send_rsp_ok(), and send_srctbl().
|
static |
Definition at line 1139 of file mrtk_stream.c.
References tcpsvr_tag::cli, MAXCLI, tcp_t::saddr, tcp_t::state, tcpsvr_tag::svr, and tracet().
Referenced by readtcpsvr(), waittcpsvr(), and writetcpsvr().
|
static |
Definition at line 843 of file mrtk_stream.c.
Referenced by decodetcppath().
|
static |
Definition at line 2353 of file mrtk_stream.c.
References ntripc_con_t::buff, tcpsvr_tag::cli, ntripc_t::con, discon_ntripc(), errsock(), MAXCLI, ntripc_con_t::nb, NTRIP_MAXRSP, recv_nb(), rsp_ntripc(), tcp_t::sock, ntripc_con_t::state, ntripc_t::state, tcp_t::state, tcpsvr_tag::svr, ntripc_t::tcp, tracet(), and waittcpsvr().
Referenced by readntripc(), and writentripc().
|
static |
Definition at line 1815 of file mrtk_stream.c.
References ntrip_t::buff, ntrip_t::nb, NTRIP_MAXRSP, NTRIP_VER_AUTO, readtcpcli(), reqntrip_c(), reqntrip_s(), rspntrip_c(), rspntrip_s(), ntrip_t::state, tcp_t::state, tcpcli_t::svr, ntrip_t::tcp, tracet(), ntrip_t::type, ntrip_t::v2_tried, ntrip_t::ver, and ntrip_t::ver_neg.
Referenced by readntrip(), and writentrip().
|
static |
Definition at line 1384 of file mrtk_stream.c.
References consock(), discontcp(), gentcp(), tcp_t::sock, tcp_t::state, tcpcli_t::svr, tcp_t::tact, tickget(), tcpcli_t::tirecon, tcpcli_t::toinact, and tracet().
Referenced by readtcpcli(), and writetcpcli().
|
static |
Definition at line 1211 of file mrtk_stream.c.
References accsock(), tcp_t::sock, tcp_t::state, tcpsvr_tag::svr, tracet(), and updatetcpsvr().
Referenced by readtcpsvr(), wait_ntripc(), and writetcpsvr().
|
static |
Definition at line 759 of file mrtk_stream.c.
References file_t::fp, file_t::fp_tag, file_t::fp_tag_tmp, file_t::fp_tmp, fswapmargin, file_t::size_fpos, swapclose(), swapfile(), file_t::swapintv, file_t::tick, tickget(), gtime_t::time, time2gpst(), timeadd(), timeget(), tracet(), utc2gpst(), and file_t::wtime.
Referenced by strwrite().
|
static |
Definition at line 2995 of file mrtk_stream.c.
References membuf_t::buf, membuf_t::bufsize, membuf_t::lock, membuf_t::rp, rtk_lock, rtk_unlock, membuf_t::state, tracet(), and membuf_t::wp.
Referenced by strwrite().
|
static |
Definition at line 2079 of file mrtk_stream.c.
References chunk_encode(), NTRIP_VER_2, ntrip_t::tcp, tracet(), ntrip_t::type, ntrip_t::ver_neg, waitntrip(), and writetcpcli().
Referenced by strwrite().
|
static |
Definition at line 2418 of file mrtk_stream.c.
References chunk_encode(), tcpsvr_tag::cli, ntripc_t::con, discon_ntripc(), errsock(), MAXCLI, send_nb(), tcp_t::sock, ntripc_con_t::state, tcp_t::tact, ntripc_t::tcp, tickget(), tracet(), ntripc_con_t::ver, and wait_ntripc().
Referenced by strwrite().
|
static |
Definition at line 405 of file mrtk_stream.c.
References serial_t::dev, serial_t::error, and tracet().
Referenced by strwrite().
|
static |
Definition at line 1438 of file mrtk_stream.c.
References discontcp(), errsock(), send_nb(), tcp_t::sock, tcp_t::state, tcpcli_t::svr, tcp_t::tact, tickget(), tcpcli_t::tirecon, tracet(), and waittcpcli().
Referenced by closentrip(), reqntrip_c(), reqntrip_s(), strwrite(), and writentrip().
|
static |
Definition at line 1255 of file mrtk_stream.c.
References tcpsvr_tag::cli, discontcp(), errsock(), MAXCLI, send_nb(), tcp_t::sock, tcp_t::state, tcpsvr_tag::svr, tcp_t::tact, tickget(), ticonnect, tracet(), updatetcpsvr(), and waittcpsvr().
Referenced by readserial(), and strwrite().
|
static |
Definition at line 2639 of file mrtk_stream.c.
References udp_t::addr, udp_t::sock, and tracet().
Referenced by strwrite().
|
static |
Definition at line 242 of file mrtk_stream.c.
Referenced by genudp(), rtksvrstart(), setsock(), and strsetopt().
| const char* formatstrs[32] |
Definition at line 80 of file mrtk_stream.c.
Referenced by setopt_file().
|
static |
Definition at line 247 of file mrtk_stream.c.
Referenced by strsetopt(), and writefile().
|
static |
Definition at line 243 of file mrtk_stream.c.
Referenced by ftpthread(), and strsetdir().
|
static |
Definition at line 245 of file mrtk_stream.c.
Referenced by parse_ntrip_query(), and strsetntripver().
|
static |
Definition at line 244 of file mrtk_stream.c.
Referenced by ftpthread(), openntrip(), and strsetproxy().
|
static |
Definition at line 246 of file mrtk_stream.c.
Referenced by readfile().
|
static |
Definition at line 240 of file mrtk_stream.c.
Referenced by discon_ntripc(), gentcp(), opentcpcli(), readtcpsvr(), strsetopt(), and writetcpsvr().
|
static |
Definition at line 241 of file mrtk_stream.c.
Referenced by strread(), strsetopt(), and strwrite().
|
static |
Definition at line 239 of file mrtk_stream.c.
Referenced by opentcpcli(), strsetopt(), and strsettimeout().