Hamlib 4.7~git
 
Loading...
Searching...
No Matches
network.c File Reference

Network port IO. More...

#include <hamlib/config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <signal.h>
#include <pthread.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <hamlib/rig.h>
#include "network.h"
#include "misc.h"
#include "asyncpipe.h"
#include "snapshot_data.h"

Data Structures

struct  multicast_publisher_data_packet_s
 
struct  multicast_publisher_priv_data_s
 
struct  multicast_receiver_args_s
 
struct  multicast_receiver_priv_data_s
 

Macros

#define MULTICAST_PUBLISHER_DATA_PACKET_TYPE_POLL   0x01
 
#define MULTICAST_PUBLISHER_DATA_PACKET_TYPE_TRANSCEIVE   0x02
 
#define MULTICAST_PUBLISHER_DATA_PACKET_TYPE_SPECTRUM   0x03
 
#define TRACE   rig_debug(RIG_DEBUG_ERR, "TRACE %s(%d)\n", __func__,__LINE__);
 

Typedefs

typedef struct multicast_publisher_priv_data_s multicast_publisher_priv_data
 
typedef struct multicast_receiver_args_s multicast_receiver_args
 
typedef struct multicast_receiver_priv_data_s multicast_receiver_priv_data
 

Functions

struct multicast_publisher_data_packet_s __attribute__ ((packed))
 
int network_init ()
 
int network_open (hamlib_port_t *rp, int default_port)
 Open network port using STATE(rig) data.
 
int network_flush2 (hamlib_port_t *rp, unsigned char *stopset, char *buf, int buf_len)
 
void network_flush (hamlib_port_t *rp)
 Clears any data in the read buffer of the socket.
 
void sync_callback (int lock)
 
int network_multicast_publisher_start (RIG *rig, const char *multicast_addr, int multicast_port, enum multicast_item_e items)
 Start multicast publisher.
 
int network_multicast_publisher_stop (RIG *rig)
 Stop multicast publisher.
 
int network_multicast_receiver_start (RIG *rig, const char *multicast_addr, int multicast_port)
 Start multicast receiver.
 
int network_multicast_receiver_stop (RIG *rig)
 Stop multicast receiver.
 

Variables

uint8_t type
 
uint8_t padding
 
uint16_t data_length
 
 multicast_publisher_args
 

Detailed Description

Network port IO.