@@ -606,17 +606,10 @@ async function settrx(qrg, mode = '') {
606606 }
607607 }
608608 if ( defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . flrig_ena ) {
609- let postData = '<?xml version="1.0"?>' ;
610- postData += '<methodCall><methodName>main.set_frequency</methodName><params><param><value><double>' + to . qrg + '</double></value></param></params></methodCall>' ;
611- let options = {
612- method : 'POST' ,
613- headers : {
614- 'User-Agent' : 'SW2WL_v' + app . getVersion ( ) ,
615- 'Content-Length' : postData . length
616- }
617- } ;
618609 let url = "http://" + defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . flrig_host + ':' + defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . flrig_port + '/' ;
619- let x = await httpPost ( url , options , postData ) ;
610+ let postData = '' ;
611+ let options = { } ;
612+ let x ;
620613
621614 if ( defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . wavelog_pmode ) {
622615 postData = '<?xml version="1.0"?>' ;
@@ -630,7 +623,20 @@ async function settrx(qrg, mode = '') {
630623 } ;
631624 x = await httpPost ( url , options , postData ) ;
632625 }
626+
627+ postData = '<?xml version="1.0"?>' ;
628+ postData += '<methodCall><methodName>main.set_frequency</methodName><params><param><value><double>' + to . qrg + '</double></value></param></params></methodCall>' ;
629+ options = {
630+ method : 'POST' ,
631+ headers : {
632+ 'User-Agent' : 'SW2WL_v' + app . getVersion ( ) ,
633+ 'Content-Length' : postData . length
634+ }
635+ } ;
636+ x = await httpPost ( url , options , postData ) ;
637+
633638 }
639+
634640 if ( defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . hamlib_ena ) {
635641 const client = net . createConnection ( { host : defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . hamlib_host , port : defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . hamlib_port } , ( ) => {
636642 client . write ( "F " + to . qrg + "\n" ) ;
0 commit comments