// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_rcvr_config(int)
void request_rcvr_config(int why)
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == ESIP_RCVR) {
      send_esip_cmd("PERDAPI,FIXMASK,QUERY");
      send_esip_cmd("PERDAPI,FREQ,QUERY");
   }
   else if(rcvr_type == FURUNO_RCVR) {
      send_furuno_cmd("GPsrq");   // get config
      send_furuno_cmd("GPrrq");   // get pps info
//    send_furuno_cmd("GPstq");   // SBAS position fix method
   }
   else if(rcvr_type == MOTO_RCVR) {
      send_moto_start("Ag"); // elevation mask
      send_byte(0xFF);
      send_moto_end();

      send_moto_start("At"); // position hold mode
      send_byte(0xFF);
      send_moto_end();

//    request_timing_mode();
   }
   else if(rcvr_type == NVS_RCVR) {
      send_nvs_start(0x0D);  // sig level / elevation masks
      send_byte(0x03);
      send_nvs_end();

      send_nvs_start(0x0D);  // solution filtration factor
      send_byte(0x04);
      send_nvs_end();

      send_nvs_start(0x11);  // self test results
      send_byte(0x00);
      send_nvs_end();

      send_nvs_start(0x1D);  // survey mode info
      send_byte(0x00);
      send_nvs_end();

      send_nvs_start(0xD7);  // get nav rate (1 Hz)
      send_byte(0x02);
      send_nvs_end();
   }
   else if(rcvr_type == RFTG_RCVR) {
      request_rftg_delta_temp();
      request_rftg_avg_sample();
      request_rftg_warmup_time();
      request_rftg_additional_status();
      request_rftg_traim();

      set_rftg_normal();
   }
   else if(rcvr_type == RT17_RCVR) {
flush_rt17_cmd();
//      send_rt17_start(0x06, 0);  // GETSERIAL
//      send_rt17_end();
//BEEP(5555);

      send_rt17_start(0x4A, 1);  // GETOPT   toots
      send_byte(1);
      send_rt17_end();
   }
   else if(rcvr_type == SIRF_RCVR) {
      query_sirf_msg(GET_SIRF_NAV_PARAMS);
   }
   else if(rcvr_type == STAR_RCVR) {
      if(star_line) return;  // dont do this in the middle of a multi-line response
      queue_star_cmd("CONF;", STAR_CONF_MSG);
//    queue_star_cmd("MASK_ANGLE;", STAR_ANGLE_MSG);
//    queue_star_cmd("INPUT_TYPE(1);", STAR_INP_TYPE_MSG);  // !!! this command is not valid for ATDC model
if(debug_file) fprintf(debug_file, "request_rcvr_config(%d)\n", why);
   }
   else if(rcvr_type == TM4_RCVR) {
      request_tm4_msg("55");  // mask angle
      request_tm4_msg("56");  // cable delay
      request_tm4_msg("57");  // timing mode
   }
   else if(rcvr_type == TRUE_RCVR) {
      send_true_cmd("$GETDELAY");   // get gps delay
      send_true_cmd("$GETBDELAY");  // get board delay
      send_true_cmd("$GETP");       // get pot values
      send_true_cmd("$GETSCALEFACTOR");       // get pot values
      request_atten();
   }
   else if(rcvr_type == SS_RCVR) {
      request_ss_msg(30);  // rcvr config
      request_ss_msg(49);  // rcvr status

      send_ss_start(51, 5);  // self test results
      send_byte(2);
      send_ss_end();
   }
   else if(rcvr_type == TSIP_RCVR) {
      if(SV6_FAMILY && !ACU_GG && !ACU_360 && !ACUTIME && !PALISADE) {
         request_sv6_config(1); 
      }
      else {
         send_tsip_start(0xBB); // receiver config packet
         send_byte(0x00);
         send_tsip_end();
      }
   }
   else if(rcvr_type == UBX_RCVR) {
      request_ubx_msg(UBX_MON);
      request_ubx_msg(UBX_CFG);
      request_ubx_msg(UBX_CFG_ANT);
      request_ubx_msg(UBX_NAVX5);
      request_ubx_msg(UBX_NAV_RATE);
   }
   else if(rcvr_type == UCCM_RCVR) {
      queue_uccm_cmd("OUTP:STAT?", UCCM_STATE_MSG);
      queue_uccm_cmd("PULLINRANGE?", UCCM_GET_PULLIN_MSG);
   }
   else if(rcvr_type == VENUS_RCVR) {
      query_venus_msg(QUERY_VENUS_CABLE);    // get cable delay
      query_venus_msg(QUERY_VENUS_RTK_MODE); // get RTK mode
      query_venus_msg(QUERY_VENUS_MASKS);    // get el/sig mask values
      query_venus_msg(QUERY_VENUS_BOOT);     // get boot status
      query_venus_msg(QUERY_VENUS_JAMMING);  // get jamming mode
      query_venus_msg(QUERY_VENUS_LEAP);     // get UTC offset
      query_venus_msg(QUERY_VENUS_RATE);     // get nav rate
   }
   else if(rcvr_type == Z12_RCVR) {
//    send_z12_cmd("PASHQ,ELM");
//    send_z12_cmd("PASHQ,PEM");
//    send_z12_cmd("PASHQ,PDP");
//    send_z12_cmd("PASHQ,VDP");  // we set to same as PDOP
   }
   else if(rcvr_type == ZODIAC_RCVR) {
      query_zod_msg(ZOD_SETTINGS_MSG);
   }
   else if(rcvr_type == ZYFER_RCVR) {
      send_zyfer_cmd("$ALRM");
      send_zyfer_cmd("$ANTD");
      send_zyfer_cmd("$DRFT");
      send_zyfer_cmd("$MANG");
      send_zyfer_cmd("$STAT");
      send_zyfer_cmd("$TRMO");
   }

   request_gnss_system();
// request_gps_system_msg();  // request GPS system message
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1cada2(%rip), %rax    # 0x228f3e
leaq 0x2c2e7d(%rip), %rcx    # 0x321020
movb (%rcx), %cl
orb (%rax), %cl
je 0x5e1ae
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1a471b(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x1, %rax
je 0x5e3ea
cmpq $0x4, %rax
je 0x5e29b
cmpq $0x8, %rax
je 0x5e4f8
cmpq $0x20, %rax
je 0x5e337
cmpq $0x40, %rax
je 0x5e2d2
cmpq $0x80, %rax
je 0x5e2e1
cmpq $0x100, %rax            # imm = 0x100
je 0x5e587
cmpq $0x800, %rax            # imm = 0x800
je 0x5e51b
cmpq $0x1000, %rax           # imm = 0x1000
je 0x5e39f
cmpq $0x100000, %rax         # imm = 0x100000
je 0x5e4ab
cmpq $0x200000, %rax         # imm = 0x200000
je 0x5e44e
cmpq $0x400000, %rax         # imm = 0x400000
je 0x5e488
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x5e431
movabsq $0x800000000, %rcx      # imm = 0x800000000
cmpq %rcx, %rax
je 0x5e372
movabsq $0x200000000, %rcx      # imm = 0x200000000
cmpq %rcx, %rax
je 0x5e40e
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
jne 0x5e5a9
leaq 0xaca52(%rip), %rdi     # 0x10acd7
callq 0x57791
leaq 0xaca5c(%rip), %rdi     # 0x10aced
callq 0x57791
jmp 0x5e5a9
movl $0xa09, %edi            # imm = 0xA09
callq 0x59749
movl $0x624, %edi            # imm = 0x624
callq 0x59749
movl $0x613, %edi            # imm = 0x613
callq 0x59749
movl $0x623, %edi            # imm = 0x623
callq 0x59749
movl $0x608, %edi            # imm = 0x608
callq 0x59749
jmp 0x5e5a9
movl $0x98, %edi
callq 0x5da5e
jmp 0x5e5a9
pushq $0x46
popq %rdi
pushq $-0x1
popq %rbx
movl %ebx, %esi
callq 0x5da8c
pushq $0x6a
popq %rdi
pushq $0x2
popq %rsi
callq 0x5da8c
pushq $0x2f
popq %rdi
movl %ebx, %esi
callq 0x5da8c
pushq $0x64
popq %r14
pushq $0x1
popq %rsi
movl %r14d, %edi
callq 0x5da8c
pushq $0x7
popq %rsi
movl %r14d, %edi
callq 0x5da8c
pushq $0x20
popq %rsi
movl %r14d, %edi
callq 0x5da8c
pushq $0x10
popq %rdi
movl %ebx, %esi
callq 0x5da8c
jmp 0x5e5a9
leaq 0xac9c8(%rip), %rdi     # 0x10ad06
callq 0x59a28
movl $0xff, %edi
callq 0x523f2
callq 0x59aab
leaq 0xac9b0(%rip), %rdi     # 0x10ad09
callq 0x59a28
movl $0xff, %edi
callq 0x523f2
callq 0x59aab
jmp 0x5e5a9
pushq $0x1e
popq %rdi
callq 0x5da7a
pushq $0x31
popq %rdi
callq 0x5da7a
pushq $0x33
popq %rdi
pushq $0x5
popq %rsi
callq 0x5d27d
pushq $0x2
popq %rdi
callq 0x523f2
callq 0x5d2f6
jmp 0x5e5a9
leaq 0x1a6c52(%rip), %rax    # 0x204ff8
cmpl $0x0, (%rax)
jne 0x5e1a9
movl %edi, %ebx
leaq 0xac954(%rip), %rdi     # 0x10ad0c
movl $0xca, %esi
callq 0x576d4
leaq 0x1c9fc7(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x5e5a9
leaq 0xac936(%rip), %rsi     # 0x10ad12
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
jmp 0x5e5a9
leaq 0x1a6be3(%rip), %rax    # 0x204fd4
movl (%rax), %eax
cmpl $0x36, %eax
je 0x5e401
cmpl $0x33, %eax
jne 0x5e593
pushq $0x1
popq %rdi
callq 0x59771
jmp 0x5e5a9
callq 0x61393
pushq $0x4a
popq %rdi
pushq $0x1
popq %rbx
movl %ebx, %esi
callq 0x613d4
movl %ebx, %edi
callq 0x523f2
callq 0x61440
jmp 0x5e5a9
leaq 0xac5e1(%rip), %rdi     # 0x10aa19
callq 0x578d5
leaq 0xac8bc(%rip), %rdi     # 0x10ad00
callq 0x578d5
jmp 0x5e5a9
leaq 0xac8dc(%rip), %rdi     # 0x10ad31
callq 0x57acc
leaq 0xac8da(%rip), %rdi     # 0x10ad3b
callq 0x57acc
leaq 0xac8d9(%rip), %rdi     # 0x10ad46
callq 0x57acc
leaq 0xac8d3(%rip), %rdi     # 0x10ad4c
callq 0x57acc
callq 0x5ddc7
jmp 0x5e5a9
callq 0x5d6e9
callq 0x5d773
callq 0x5d603
callq 0x5d5c5
callq 0x5d7a1
callq 0x5d4f6
jmp 0x5e5a9
leaq 0xac8c3(%rip), %rdi     # 0x10ad75
callq 0x579af
leaq 0xac8bd(%rip), %rdi     # 0x10ad7b
callq 0x579af
leaq 0xac8b7(%rip), %rdi     # 0x10ad81
callq 0x579af
leaq 0xac8b1(%rip), %rdi     # 0x10ad87
callq 0x579af
leaq 0xac8ab(%rip), %rdi     # 0x10ad8d
callq 0x579af
leaq 0xac8a5(%rip), %rdi     # 0x10ad93
callq 0x579af
jmp 0x5e5a9
leaq 0xac85d(%rip), %rdi     # 0x10ad5c
pushq $0x6b
popq %rsi
callq 0x576d4
leaq 0xac859(%rip), %rdi     # 0x10ad67
pushq $0x6d
popq %rsi
callq 0x576d4
jmp 0x5e5a9
pushq $0xd
popq %rbx
movl %ebx, %edi
callq 0x5707f
pushq $0x3
popq %rdi
callq 0x523f2
callq 0x57171
movl %ebx, %edi
callq 0x5707f
pushq $0x4
popq %rdi
callq 0x523f2
callq 0x57171
pushq $0x11
popq %rdi
callq 0x5707f
xorl %edi, %edi
callq 0x523f2
callq 0x57171
pushq $0x1d
popq %rdi
callq 0x5707f
xorl %edi, %edi
callq 0x523f2
callq 0x57171
movl $0xd7, %edi
callq 0x5707f
pushq $0x2
popq %rdi
callq 0x523f2
callq 0x57171
jmp 0x5e5a9
movl $0x3f4, %edi            # imm = 0x3F4
callq 0x5dabd
jmp 0x5e5a9
movl $0xbb, %edi
callq 0x5707f
xorl %edi, %edi
callq 0x523f2
callq 0x570f8
popq %rbx
popq %r14
popq %rbp
jmp 0x6147d