spectrum_data.vfo_b_ctun_freq=htonll(vfo[VFO_B].ctun_frequency);
spectrum_data.vfo_a_offset=htonll(vfo[VFO_A].offset);
spectrum_data.vfo_b_offset=htonll(vfo[VFO_B].offset);
- s=(short)receiver[r]->meter;
- spectrum_data.meter=htons(s);
+ spectrum_data.meter=htond(receiver[r]->meter);
spectrum_data.samples=htons(rx->width);
samples=rx->pixel_samples;
for(int i=0;i<rx->width;i++) {
adc_data.random=adc[i].random;
adc_data.preamp=adc[i].preamp;
adc_data.attenuation=htons(adc[i].attenuation);
- adc_data.adc_attenuation=htons(adc_attenuation[i]);
+ adc_data.gain=htond(adc[i].gain);
+ adc_data.min_gain=htond(adc[i].min_gain);
+ adc_data.max_gain=htond(adc[i].max_gain);
int bytes_sent=send_bytes(client->socket,(char *)&adc_data,sizeof(adc_data));
if(bytes_sent<0) {
perror("send_adc_data");
receiver_data.height=htons(receiver[rx]->height);
receiver_data.x=htons(receiver[rx]->x);
receiver_data.y=htons(receiver[rx]->y);
- s=(short)(receiver[rx]->volume*100.0);
- receiver_data.volume=htons(s);
- s=(short)receiver[rx]->rf_gain;
- receiver_data.rf_gain=htons(s);
- s=(short)receiver[rx]->agc_gain;
- receiver_data.agc_gain=htons(s);
+ receiver_data.volume=htond(receiver[rx]->volume);
+ receiver_data.agc_gain=htond(receiver[rx]->agc_gain);
int bytes_sent=send_bytes(client->socket,(char *)&receiver_data,sizeof(receiver_data));
if(bytes_sent<0) {
adc[i].random=adc_data.random;
adc[i].preamp=adc_data.preamp;
adc[i].attenuation=ntohs(adc_data.attenuation);
- adc_attenuation[i]=ntohs(adc_data.adc_attenuation);
+ adc[i].gain=ntohd(adc_data.gain);
+ adc[i].min_gain=ntohd(adc_data.min_gain);
+ adc[i].max_gain=ntohd(adc_data.max_gain);
}
break;
case INFO_RECEIVER:
receiver[rx]->height=ntohs(receiver_data.height);
receiver[rx]->x=ntohs(receiver_data.x);
receiver[rx]->y=ntohs(receiver_data.y);
- s=ntohs(receiver_data.volume);
- receiver[rx]->volume=(double)s/100.0;
- s=ntohs(receiver_data.rf_gain);
- receiver[rx]->rf_gain=(double)s;
- s=ntohs(receiver_data.agc_gain);
- receiver[rx]->agc_gain=(double)s;
+ receiver[rx]->volume=ntohd(receiver_data.volume);
+ receiver[rx]->agc_gain=ntohd(receiver_data.agc_gain);
//
receiver[rx]->pixel_samples=NULL;
g_mutex_init(&receiver[rx]->display_mutex);
receiver[rx]->hz_per_pixel=(double)receiver[rx]->sample_rate/(double)receiver[rx]->pixels;
- receiver[rx]->playback_handle=NULL;
+ //receiver[rx]->playback_handle=NULL;
receiver[rx]->local_audio_buffer=NULL;
receiver[rx]->local_audio_buffer_size=2048;
receiver[rx]->local_audio=0;
long long ctun_frequency_b=ntohll(spectrum_data.vfo_b_ctun_freq);
long long offset_a=ntohll(spectrum_data.vfo_a_offset);
long long offset_b=ntohll(spectrum_data.vfo_b_offset);
- short meter=ntohs(spectrum_data.meter);
- receiver[r]->meter=(double)meter;
+ receiver[r]->meter=ntohd(spectrum_data.meter);
short samples=ntohs(spectrum_data.samples);
if(receiver[r]->pixel_samples==NULL) {
receiver[r]->pixel_samples=g_new(float,(int)samples);
}
int rx=attenuation_cmd.id;
short attenuation=ntohs(attenuation_cmd.attenuation);
-g_print("CMD_RESP_RX_ATTENUATION: attenuation=%d adc_attenuation[rx[%d]->adc]=%d\n",attenuation,rx,adc_attenuation[receiver[rx]->adc]);
- adc_attenuation[receiver[rx]->adc]=attenuation;
+g_print("CMD_RESP_RX_ATTENUATION: attenuation=%d attenuation[rx[%d]->adc]=%d\n",attenuation,rx,adc[receiver[rx]->adc].attenuation);
+ adc[receiver[rx]->adc].attenuation=attenuation;
}
break;
case CMD_RESP_RX_NOISE: