@@ -2576,7 +2576,7 @@ declare_proto_rig(set_ptt)
25762576 if (rig -> caps -> ptt_type != RIG_PTT_RIG_MICDATA )
25772577 {
25782578 rig_debug (RIG_DEBUG_ERR , "%s: pttport.type.ptt=%d\n" , __func__ ,
2579- rig -> state . pttport . type .ptt );
2579+ PTTPORT ( rig ) -> type .ptt );
25802580 ptt = RIG_PTT_ON ;
25812581 }
25822582
@@ -4654,7 +4654,7 @@ declare_proto_rig(dump_state)
46544654 {
46554655 fprintf (fout , "vfo_ops=0x%x\n" , rig -> caps -> vfo_ops );
46564656 fprintf (fout , "ptt_type=0x%x\n" ,
4657- rig -> state . pttport . type .ptt );
4657+ PTTPORT ( rig ) -> type .ptt );
46584658 fprintf (fout , "targetable_vfo=0x%x\n" , rig -> caps -> targetable_vfo );
46594659 fprintf (fout , "has_set_vfo=%d\n" , rig -> caps -> set_vfo != NULL );
46604660 fprintf (fout , "has_get_vfo=%d\n" , rig -> caps -> get_vfo != NULL );
@@ -5005,7 +5005,7 @@ extern int flrig_cat_string(RIG *rig, const char *arg);
50055005declare_proto_rig (send_cmd )
50065006{
50075007 int retval ;
5008- struct rig_state * rs = & rig -> state ;
5008+ hamlib_port_t * rp = RIGPORT ( rig ) ;
50095009 int backend_num , cmd_len ;
50105010#define BUFSZ 512
50115011 char bufcmd [BUFSZ * 5 ]; // allow for 5 chars for binary
@@ -5015,7 +5015,7 @@ declare_proto_rig(send_cmd)
50155015 int rxbytes = BUFSZ ;
50165016 int simulate = rig -> caps -> rig_model == RIG_MODEL_DUMMY ||
50175017 rig -> caps -> rig_model == RIG_MODEL_NONE ||
5018- rs -> rigport . rig == RIG_PORT_NONE ;
5018+ rp -> rig == RIG_PORT_NONE ;
50195019
50205020 ENTERFUNC2 ;
50215021
@@ -5120,7 +5120,7 @@ declare_proto_rig(send_cmd)
51205120 }
51215121
51225122 rig_debug (RIG_DEBUG_TRACE , "%s: rigport=%d, bufcmd=%s, cmd_len=%d\n" , __func__ ,
5123- rs -> rigport . fd , hasbinary (bufcmd , cmd_len ) ? "BINARY" : bufcmd , cmd_len );
5123+ rp -> fd , hasbinary (bufcmd , cmd_len ) ? "BINARY" : bufcmd , cmd_len );
51245124
51255125 set_transaction_active (rig );
51265126
@@ -5131,17 +5131,17 @@ declare_proto_rig(send_cmd)
51315131 }
51325132 else
51335133 {
5134- rig_flush (& rs -> rigport );
5134+ rig_flush (rp );
51355135
51365136 // we don't want the 'w' command to wait too long
5137- int save_retry = rs -> rigport . retry ;
5138- rs -> rigport . retry = 0 ;
5139- retval = write_block (& rs -> rigport , (unsigned char * ) bufcmd , cmd_len );
5140- rs -> rigport . retry = save_retry ;
5137+ int save_retry = rp -> retry ;
5138+ rp -> retry = 0 ;
5139+ retval = write_block (rp , (unsigned char * ) bufcmd , cmd_len );
5140+ rp -> retry = save_retry ;
51415141
51425142 if (retval != RIG_OK )
51435143 {
5144- rig_flush_force (& rs -> rigport , 1 );
5144+ rig_flush_force (rp , 1 );
51455145 set_transaction_inactive (rig );
51465146 RETURNFUNC2 (retval );
51475147 }
@@ -5193,7 +5193,7 @@ declare_proto_rig(send_cmd)
51935193 else
51945194 {
51955195 /* Assumes CR or LF is end of line char for all ASCII protocols. */
5196- retval = read_string (& rs -> rigport , buf , rxbytes , eom_buf ,
5196+ retval = read_string (rp , buf , rxbytes , eom_buf ,
51975197 strlen (eom_buf ), 0 , 1 );
51985198
51995199 if (retval < 0 )
@@ -5245,7 +5245,7 @@ declare_proto_rig(send_cmd)
52455245 strncat (hexbuf , hex , hexbufbytes - 1 );
52465246 }
52475247
5248- rig_flush_force (& rs -> rigport , 1 );
5248+ rig_flush_force (rp , 1 );
52495249 set_transaction_inactive (rig );
52505250
52515251 rig_debug (RIG_DEBUG_TRACE , "%s: binary=%s, retval=%d\n" , __func__ , hexbuf ,
@@ -5262,7 +5262,7 @@ declare_proto_rig(send_cmd)
52625262 }
52635263 while (retval > 0 && rxbytes == BUFSZ );
52645264
5265- rig_flush_force (& rs -> rigport , 1 );
5265+ rig_flush_force (rp , 1 );
52665266 set_transaction_inactive (rig );
52675267
52685268 // we use fwrite in case of any nulls in binary return
@@ -5786,7 +5786,7 @@ declare_proto_rig(cm108_get_bit)
57865786
57875787 if (n != 1 ) { return - RIG_EINVAL ; }
57885788
5789- int retval = rig_cm108_get_bit (& rig -> state . pttport , gpio , & bit );
5789+ int retval = rig_cm108_get_bit (PTTPORT ( rig ) , gpio , & bit );
57905790
57915791 if (retval != RIG_OK )
57925792 {
@@ -5826,7 +5826,7 @@ declare_proto_rig(cm108_set_bit)
58265826 if (n != 1 ) { return - RIG_EINVAL ; }
58275827
58285828 rig_debug (RIG_DEBUG_TRACE , "%s: set gpio=%d, bit=%d\n" , __func__ , gpio , bit );
5829- int retval = rig_cm108_set_bit (& rig -> state . pttport , gpio , bit );
5829+ int retval = rig_cm108_set_bit (PTTPORT ( rig ) , gpio , bit );
58305830
58315831 if (retval != RIG_OK )
58325832 {
0 commit comments