[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linrad] Re: Two Linrad on one PC under Linux




> Another question. I want to write a small program which can feed my
> data to linrad over ethernet. Is there a special packet format linrad
> uses for 16bit raw data (All I know is that they're UDP packets)?

The raw16 format with 16 bit data as source is transmitted
by this section of rxin.c:

if( (ui.network_flag & NET_RXOUT_RAW16) != 0)
  {
  net_rxdata_16.time=read_time;
  net_rxdata_16.passband_center=fg.passband_center;
  net_rxdata_16.passband_direction=fg.passband_direction;
  j=0;
  if( (ui.rx_input_mode&DWORD_INPUT) == 0)
    {
    while(j < (int)rxad.block_bytes)
      {
      net_rxdata_16.buf[netsend_ptr_16  ]=charbuf[j  ];
      net_rxdata_16.buf[netsend_ptr_16+1]=charbuf[j+1];
      netsend_ptr_16+=2;
      j+=2;
      if(netsend_ptr_16 >= NET_MULTICAST_PAYLOAD)
        {
        raw16_blknum++;
        net_rxdata_16.block_no=raw16_blknum;
        net_rxdata_16.ptr=next_blkptr_16;
        lir_send_raw16();
        next_blkptr_16=j;
        if(next_blkptr_16 >= rxad.block_bytes)next_blkptr_16=0;
        netsend_ptr_16=0;
        }
      }
    }

The variable rxad.block_bytes is the amount of bytes present
in the buffer delivered by the hardware for this call to 
finish_rx_read.
net_rxdata_16 is defined like this (globdef.h):


// Structure for multicasting receive data on the network.
#define NET_MULTICAST_PAYLOAD 1392 // This number must be a multiple of 48
typedef struct {

double passband_center;        //  8
int time;                      //  4
float userx_freq;              //  4
int ptr;                       //  4
unsigned short int block_no;   //  2
char userx_no;                 //  1
char passband_direction;       //  1
char buf[NET_MULTICAST_PAYLOAD];
} NET_RX_STRUCT;
extern NET_RX_STRUCT net_rxdata_16;

ui.rx_input_mode&DWORD_INPUT is zero when the hardware sends 
16 bit data.
fg.passband_direction is 1 or -1. If I and Q are swapped
the frequency scale inverts. The input might have a reversed
frequency scale if downconverted depending on whether LO is
above or below the RF frequency.

Run Linrad with some extra write statements in rxin.c to see
what goes on.

Edit options.h to enable the dump file. Then:
fprintf(dmp,"............ to see what the different variables do.

You may run another instance of Linrad with write statements
in  thread_rx_raw_netinput() located in network.c to see that
what you sent was received. Place in another directory to
get another dmp file.

Hopefully the above helps. There is no other specification than
Linrad itself.....

73

Leif


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Linrad" group.
To post to this group, send email to linrad@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to linrad+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at http://groups.google.com/group/linrad?hl=en
-~----------~----~----~----~------~----~------~--~---

LINRADDARNIL