@@ -633,10 +633,25 @@ function broadcastRadioStatus(radioData) {
633633
634634async function get_modes ( ) {
635635 return new Promise ( ( resolve ) => {
636- ipcMain . once ( 'get_info_result' , ( event , modes ) => {
637- resolve ( modes ) ;
638- } ) ;
639- s_mainWindow . webContents . send ( 'get_info' , 'rig.get_modes' ) ;
636+ // Check which radio type is enabled
637+ const profile = defaultcfg . profiles [ defaultcfg . profile ?? 0 ] ;
638+
639+ if ( profile . hamlib_ena ) {
640+ // For Hamlib, send the command directly
641+ ipcMain . once ( 'get_info_result' , ( event , modes ) => {
642+ resolve ( modes ?? [ 'CW' , 'LSB' , 'USB' ] ) ;
643+ } ) ;
644+ s_mainWindow . webContents . send ( 'get_info' , 'rig.get_modes' ) ;
645+ } else if ( profile . flrig_ena ) {
646+ // For FLRig, use the existing method
647+ ipcMain . once ( 'get_info_result' , ( event , modes ) => {
648+ resolve ( modes ?? [ 'CW' , 'LSB' , 'USB' ] ) ;
649+ } ) ;
650+ s_mainWindow . webContents . send ( 'get_info' , 'rig.get_modes' ) ;
651+ } else {
652+ // No radio control enabled, return default modes
653+ resolve ( [ 'CW' , 'LSB' , 'USB' ] ) ;
654+ }
640655 } ) ;
641656}
642657
@@ -719,7 +734,7 @@ async function settrx(qrg, mode = '') {
719734 const client = net . createConnection ( { host : defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . hamlib_host , port : defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . hamlib_port } , ( ) => {
720735 client . write ( "F " + to . qrg + "\n" ) ;
721736 if ( defaultcfg . profiles [ defaultcfg . profile ?? 0 ] . wavelog_pmode ) {
722- client . write ( "M " + to . mode + "\n-1 " ) ;
737+ client . write ( "M " + to . mode + " 0\n " ) ;
723738 }
724739 client . end ( ) ;
725740 } ) ;
0 commit comments