kopia lustrzana https://github.com/sp9skp/spdxl
poprawne QRG sond dla wiecej niz 15 kanalow naraz
rodzic
3c0fdf9f68
commit
9fe8a2037d
2
VER.txt
2
VER.txt
|
@ -1 +1 @@
|
||||||
20180706
|
20180924
|
16
src/osic.c
16
src/osic.c
|
@ -207,22 +207,18 @@ void osic_CloseSock(int32_t fd)
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t osic_RdBin(int32_t fd,
|
int32_t osic_RdBin(int32_t fd, char buf[], uint32_t buf_len, uint32_t size)
|
||||||
char buf[], uint32_t buf_len,
|
|
||||||
uint32_t size)
|
|
||||||
{
|
{
|
||||||
if (size > (buf_len-1) + 1)
|
if (size > buf_len)
|
||||||
size = (buf_len-1)+1;
|
size = buf_len;
|
||||||
return read(fd, (char *)buf, size);
|
return read(fd, (char *)buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void osic_WrBin(int32_t fd, char buf[],
|
void osic_WrBin(int32_t fd, char buf[], uint32_t buf_len, uint32_t size)
|
||||||
uint32_t buf_len,
|
|
||||||
uint32_t size)
|
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
if (size > (buf_len-1)+1)
|
if (size > buf_len)
|
||||||
size = (buf_len-1)+1;
|
size = buf_len;
|
||||||
rc = write(fd, (char *)buf, size);
|
rc = write(fd, (char *)buf, size);
|
||||||
(void)rc;
|
(void)rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -558,7 +558,7 @@ static void skip(const char s[], uint32_t s_len, uint32_t * p)
|
||||||
// send freq table
|
// send freq table
|
||||||
static void updateChanT(){
|
static void updateChanT(){
|
||||||
|
|
||||||
int i;
|
int i,j,l;
|
||||||
char tmp[15],tmp1[25];
|
char tmp[15],tmp1[25];
|
||||||
double fhz;
|
double fhz;
|
||||||
|
|
||||||
|
@ -569,43 +569,48 @@ static void updateChanT(){
|
||||||
|
|
||||||
double tt;
|
double tt;
|
||||||
|
|
||||||
tt=-1.0;
|
tt=0;
|
||||||
if(rxx[i].df>0) tt=0.5;
|
if(rxx[i].df>0) tt=0.5;
|
||||||
|
|
||||||
|
|
||||||
sndbufft[0]=0;
|
j=0;
|
||||||
strcat(sndbufft,"9 S K P ");
|
|
||||||
|
|
||||||
while (prx[i]) {
|
while (prx[i]) {
|
||||||
|
if(j==0){
|
||||||
|
sndbufft[0]=0;
|
||||||
|
strcat(sndbufft,"9 S K P ");
|
||||||
|
}
|
||||||
sprintf(tmp,"%02i%06li",i+1,(long int)((midfreq/1000+(int32_t)rxx[i].df*khz+tt)));
|
sprintf(tmp,"%02i%06li",i+1,(long int)((midfreq/1000+(int32_t)rxx[i].df*khz+tt)));
|
||||||
tmp1[0]=tmp[0];
|
tmp1[0]=tmp[0];
|
||||||
tmp1[1]='0';
|
tmp1[1]=' ';
|
||||||
tmp1[2]=tmp[1];
|
tmp1[2]=tmp[1];
|
||||||
tmp1[3]='0';
|
tmp1[3]=' ';
|
||||||
tmp1[4]=tmp[2];
|
tmp1[4]=tmp[2];
|
||||||
tmp1[5]='0';
|
tmp1[5]=' ';
|
||||||
tmp1[6]=tmp[3];
|
tmp1[6]=tmp[3];
|
||||||
tmp1[7]='0';
|
tmp1[7]=' ';
|
||||||
tmp1[8]=tmp[4];
|
tmp1[8]=tmp[4];
|
||||||
tmp1[9]='0';
|
tmp1[9]=' ';
|
||||||
tmp1[10]=tmp[5];
|
tmp1[10]=tmp[5];
|
||||||
tmp1[11]='0';
|
tmp1[11]=' ';
|
||||||
tmp1[12]=tmp[6];
|
tmp1[12]=tmp[6];
|
||||||
tmp1[13]='0';
|
tmp1[13]=' ';
|
||||||
tmp1[14]=tmp[7];
|
tmp1[14]=tmp[7];
|
||||||
tmp1[15]='0';
|
tmp1[15]=' ';
|
||||||
tmp1[16]=tmp[8];
|
tmp1[16]=tmp[8];
|
||||||
tmp1[17]='0';
|
tmp1[17]=' ';
|
||||||
tmp1[18]=0;
|
tmp1[18]=0;
|
||||||
|
|
||||||
strcat(sndbufft,tmp1);
|
strcat(sndbufft,tmp1);
|
||||||
++i;
|
++i;
|
||||||
}
|
j++;
|
||||||
if(fd){
|
if(j>14){
|
||||||
osi_WrBin(fd, (char *)sndbufft, 1024u/1u, 1024);
|
if(fd){
|
||||||
osi_WrBin(fd, (char *)sndbufft, 1024u/1u, 1024);
|
l=strlen(sndbufft);
|
||||||
osi_WrBin(fd, (char *)sndbufft, 1024u/1u, 1024);
|
sndbufft[l]=0;
|
||||||
osi_WrBin(fd, (char *)sndbufft, 1024u/1u, 1024);
|
sndbufft[l+1]=0;
|
||||||
|
osi_WrBin(fd, (char *)sndbufft, 1024, 1024);
|
||||||
|
j=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1365,8 +1365,7 @@ static void decodeframe92(uint32_t m)
|
||||||
/* +crc */
|
/* +crc */
|
||||||
++p;
|
++p;
|
||||||
if (maxchannels>0UL) {
|
if (maxchannels>0UL) {
|
||||||
osic_WrINT32(m+1UL, 1UL);
|
printf("%02i:",m+1);
|
||||||
osi_WrStr(":", 2ul);
|
|
||||||
}
|
}
|
||||||
osi_WrStr("R92 ", 5ul);
|
osi_WrStr("R92 ", 5ul);
|
||||||
if (8UL+len>240UL || !crcrs(chan[m].r92.rxbuf, 256ul, 8L,
|
if (8UL+len>240UL || !crcrs(chan[m].r92.rxbuf, 256ul, 8L,
|
||||||
|
@ -1602,8 +1601,7 @@ static SET256 _cnst1 = {0x03FFFFF0UL,0x00000003UL,0x00000000UL,0x00000018UL,
|
||||||
static void WrChan(int32_t c)
|
static void WrChan(int32_t c)
|
||||||
{
|
{
|
||||||
if (maxchannels>0UL) {
|
if (maxchannels>0UL) {
|
||||||
osic_WrINT32((uint32_t)(c+1L), 1UL);
|
printf("%02i:",c+1);
|
||||||
osi_WrStr(":", 2ul);
|
|
||||||
}
|
}
|
||||||
} /* end WrChan() */
|
} /* end WrChan() */
|
||||||
|
|
||||||
|
@ -2184,8 +2182,7 @@ static void demodbytepilot(uint32_t m, char d)
|
||||||
crc = (anonym->rxbuf[48UL]<<8UL) | anonym->rxbuf[49UL];
|
crc = (anonym->rxbuf[48UL]<<8UL) | anonym->rxbuf[49UL];
|
||||||
if (verb) {
|
if (verb) {
|
||||||
if (maxchannels>0UL) {
|
if (maxchannels>0UL) {
|
||||||
osic_WrINT32(m+1UL, 1UL);
|
printf("%02i:",m+1);
|
||||||
osi_WrStr(":", 2ul); //if more than one channel print channel No.
|
|
||||||
}
|
}
|
||||||
osi_WrStr("PS ",4UL);
|
osi_WrStr("PS ",4UL);
|
||||||
}
|
}
|
||||||
|
@ -2546,8 +2543,7 @@ static void decode41(uint32_t m)
|
||||||
} while (!(allok || try0>2UL));
|
} while (!(allok || try0>2UL));
|
||||||
if (verb && nameok>0UL) {
|
if (verb && nameok>0UL) {
|
||||||
if (maxchannels>0UL) {
|
if (maxchannels>0UL) {
|
||||||
osic_WrINT32(m+1UL, 1UL);
|
printf("%02i:",m+1);
|
||||||
osi_WrStr(":", 2ul);
|
|
||||||
}
|
}
|
||||||
osi_WrStr("R41 ", 5ul);
|
osi_WrStr("R41 ", 5ul);
|
||||||
for (i = 0UL; i<=7UL; i++) {
|
for (i = 0UL; i<=7UL; i++) {
|
||||||
|
@ -3472,6 +3468,7 @@ static char sendDFM(uint32_t m){
|
||||||
tmp[4] = chan[m].freq[4];
|
tmp[4] = chan[m].freq[4];
|
||||||
tmp[5] = chan[m].freq[5];
|
tmp[5] = chan[m].freq[5];
|
||||||
tmp[6] = 0;
|
tmp[6] = 0;
|
||||||
|
|
||||||
if(strlen(tmp)>2)
|
if(strlen(tmp)>2)
|
||||||
strcat(s,tmp);
|
strcat(s,tmp);
|
||||||
else
|
else
|
||||||
|
@ -3701,8 +3698,7 @@ static void demodframe34(uint32_t channel)
|
||||||
}
|
}
|
||||||
if (verb && ok0 || verb2) {
|
if (verb && ok0 || verb2) {
|
||||||
if (maxchannels>0UL) {
|
if (maxchannels>0UL) {
|
||||||
osic_WrINT32(channel+1UL, 1UL);
|
printf("%02i:",channel+1);
|
||||||
osi_WrStr(":", 2ul);
|
|
||||||
}
|
}
|
||||||
if (anonym->c50) {
|
if (anonym->c50) {
|
||||||
osi_WrStr("C50 ", 5ul);
|
osi_WrStr("C50 ", 5ul);
|
||||||
|
@ -4230,13 +4226,16 @@ static void getadc(void)
|
||||||
|
|
||||||
sprintf(tmps,"%c%c%c%c\n",adcbuf[0],adcbuf[1],adcbuf[2],adcbuf[3]);
|
sprintf(tmps,"%c%c%c%c\n",adcbuf[0],adcbuf[1],adcbuf[2],adcbuf[3]);
|
||||||
|
|
||||||
|
|
||||||
if(tmps[0]=='9' && tmps[1]=='S' && tmps[2]=='K' && tmps[3]=='P'){ //freq table
|
if(tmps[0]=='9' && tmps[1]=='S' && tmps[2]=='K' && tmps[3]=='P'){ //freq table
|
||||||
// printf("Update channel table\n");
|
// printf("Update channel table\n");
|
||||||
pos=4;
|
pos=4;
|
||||||
mod=1;
|
mod=1;
|
||||||
chno=0;
|
chno=0;
|
||||||
while(adcbuf[pos]!=0){
|
while(adcbuf[pos]!=0){
|
||||||
//chan[chno].nr=(adcbuf[pos]-48)*10+adcbuf[pos+1]-48;
|
chno=(int)(((char)adcbuf[pos]-48)*10+((char)adcbuf[pos+1]-48)-1);
|
||||||
|
if(chno<0) break;
|
||||||
|
|
||||||
chan[chno].freq[0]=adcbuf[pos+2];
|
chan[chno].freq[0]=adcbuf[pos+2];
|
||||||
chan[chno].freq[1]=adcbuf[pos+3];
|
chan[chno].freq[1]=adcbuf[pos+3];
|
||||||
chan[chno].freq[2]=adcbuf[pos+4];
|
chan[chno].freq[2]=adcbuf[pos+4];
|
||||||
|
@ -4245,8 +4244,8 @@ static void getadc(void)
|
||||||
chan[chno].freq[5]=adcbuf[pos+7];
|
chan[chno].freq[5]=adcbuf[pos+7];
|
||||||
chan[chno].freq[6]=0;
|
chan[chno].freq[6]=0;
|
||||||
pos+=8;
|
pos+=8;
|
||||||
|
//printf("CH:%i QRG:",chno);
|
||||||
//printf(chan[chno].freq);printf("\n");
|
//printf(chan[chno].freq);printf("\n");
|
||||||
chno++;
|
|
||||||
}
|
}
|
||||||
}else if(mod==0){
|
}else if(mod==0){
|
||||||
adcbufsamps = 0UL;
|
adcbufsamps = 0UL;
|
||||||
|
|
Ładowanie…
Reference in New Issue