// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1d873b(%rip), %rax    # 0x23ef3e
leaq 0x2d0816(%rip), %r14    # 0x337020
movb (%r14), %cl
orb (%rax), %cl
je 0x6681c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b20ad(%rip), %r15    # 0x2188d0
movq (%r15), %rax
cmpq $0xfff, %rax            # imm = 0xFFF
jg 0x668b4
cmpq $0x3f, %rax
jg 0x66931
cmpq $0x7, %rax
jg 0x66a56
cmpq $0x1, %rax
je 0x66c02
cmpq $0x4, %rax
jne 0x66d7a
movl $0xa09, %edi            # imm = 0xA09
xorl %esi, %esi
callq 0x5f37d
callq 0x5f456
movl $0x624, %edi            # imm = 0x624
xorl %esi, %esi
callq 0x5f37d
callq 0x5f456
movl $0x613, %edi            # imm = 0x613
xorl %esi, %esi
callq 0x5f37d
callq 0x5f456
movl $0x623, %edi            # imm = 0x623
xorl %esi, %esi
callq 0x5f37d
callq 0x5f456
movl $0x608, %edi            # imm = 0x608
xorl %esi, %esi
callq 0x5f37d
callq 0x5f456
jmp 0x66d7a
cmpq $0x1fffffff, %rax       # imm = 0x1FFFFFFF
jg 0x66a0c
cmpq $0x1fffff, %rax         # imm = 0x1FFFFF
jg 0x66aa5
cmpq $0x1000, %rax           # imm = 0x1000
je 0x66c28
cmpq $0x100000, %rax         # imm = 0x100000
jne 0x66d7a
leaq 0xba542(%rip), %rdi     # 0x120e2d
callq 0x5f0e5
leaq 0xba53c(%rip), %rdi     # 0x120e33
callq 0x5f0e5
leaq 0xba536(%rip), %rdi     # 0x120e39
callq 0x5f0e5
leaq 0xba530(%rip), %rdi     # 0x120e3f
callq 0x5f0e5
leaq 0xba52a(%rip), %rdi     # 0x120e45
callq 0x5f0e5
leaq 0xba524(%rip), %rdi     # 0x120e4b
callq 0x5f0e5
jmp 0x66d7a
cmpq $0xff, %rax
jg 0x66aec
cmpq $0x40, %rax
je 0x66c73
cmpq $0x80, %rax
jne 0x66d7a
movl $0x46, %edi
movl $0x1, %esi
callq 0x5fb3c
callq 0x61bc1
movl $0x6a, %edi
movl $0x2, %esi
callq 0x5fb3c
movl $0x2, %edi
callq 0x590f7
callq 0x61bc1
movl $0x2f, %edi
movl $0x1, %esi
callq 0x5fb3c
callq 0x61bc1
movl $0x64, %edi
movl $0x2, %esi
callq 0x5fb3c
movl $0x1, %edi
callq 0x590f7
callq 0x61bc1
movl $0x64, %edi
movl $0x2, %esi
callq 0x5fb3c
movl $0x7, %edi
callq 0x590f7
callq 0x61bc1
movl $0x64, %edi
movl $0x2, %esi
callq 0x5fb3c
movl $0x20, %edi
callq 0x590f7
callq 0x61bc1
movl $0x10, %edi
movl $0x1, %esi
callq 0x5fb3c
callq 0x61bc1
jmp 0x66d7a
movabsq $0x1ffffffff, %rcx      # imm = 0x1FFFFFFFF
cmpq %rcx, %rax
jg 0x66b80
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x66c93
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
jne 0x66d7a
leaq 0xba34f(%rip), %rdi     # 0x120d8f
callq 0x5ee9b
leaq 0xba359(%rip), %rdi     # 0x120da5
callq 0x5ee9b
jmp 0x66d7a
cmpq $0x8, %rax
je 0x66cb0
cmpq $0x20, %rax
jne 0x66d7a
leaq 0xba34d(%rip), %rdi     # 0x120dbe
callq 0x6160d
movl $0xff, %edi
callq 0x590f7
callq 0x61688
leaq 0xba335(%rip), %rdi     # 0x120dc1
callq 0x6160d
movl $0xff, %edi
callq 0x590f7
callq 0x61688
jmp 0x66d7a
cmpq $0x200000, %rax         # imm = 0x200000
je 0x66cd7
cmpq $0x400000, %rax         # imm = 0x400000
jne 0x66d7a
callq 0x65af3
callq 0x65bba
callq 0x659c8
callq 0x65986
callq 0x65bec
xorl %edi, %edi
callq 0x65779
movl $0x45, %edi
callq 0x5e6be
jmp 0x66d75
cmpq $0x100, %rax            # imm = 0x100
je 0x66d24
cmpq $0x800, %rax            # imm = 0x800
jne 0x66d7a
movl $0xd, %edi
callq 0x5e6be
movl $0x3, %edi
callq 0x590f7
callq 0x5e7c0
movl $0xd, %edi
callq 0x5e6be
movl $0x4, %edi
callq 0x590f7
callq 0x5e7c0
movl $0x11, %edi
callq 0x5e6be
xorl %edi, %edi
callq 0x590f7
callq 0x5e7c0
movl $0x1d, %edi
callq 0x5e6be
xorl %edi, %edi
callq 0x590f7
callq 0x5e7c0
movl $0xd7, %edi
callq 0x5e6be
movl $0x2, %edi
callq 0x590f7
callq 0x5e7c0
jmp 0x66d7a
movabsq $0x200000000, %rcx      # imm = 0x200000000
cmpq %rcx, %rax
je 0x66d3f
movabsq $0x800000000, %rcx      # imm = 0x800000000
cmpq %rcx, %rax
jne 0x66d7a
movl $0x1e, %edi
callq 0x65f72
movl $0x31, %edi
callq 0x65f72
movl $0x33, %edi
movl $0x5, %esi
callq 0x65608
movl $0x2, %edi
callq 0x590f7
movzwl 0x305ee1(%rip), %r14d   # 0x36cabc
movl $0xff, %ebx
movl %r14d, %edi
andl %ebx, %edi
callq 0x590f7
addl %r14d, %ebx
testw %r14w, %r14w
cmovnsl %r14d, %ebx
movzbl %bh, %edi
callq 0x590f7
jmp 0x66d7a
leaq 0x1b43cb(%rip), %rax    # 0x21afd4
movl (%rax), %eax
cmpl $0x36, %eax
je 0x66c19
cmpl $0x33, %eax
jne 0x66d64
movl $0x1, %edi
callq 0x61349
jmp 0x66d7a
leaq 0x1b43c9(%rip), %rax    # 0x21aff8
cmpl $0x0, (%rax)
jne 0x66811
movl %edi, %ebx
leaq 0xba183(%rip), %rdi     # 0x120dc4
movl $0xca, %esi
callq 0x5edda
leaq 0x1d773e(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x66d7a
leaq 0xba165(%rip), %rsi     # 0x120dca
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
jmp 0x66d7a
movl $0x98, %edi
movl $0x2, %esi
callq 0x5fa1f
xorl %edi, %edi
callq 0x590f7
callq 0x5fac3
jmp 0x66d7a
leaq 0xb9e37(%rip), %rdi     # 0x120ad1
callq 0x5eff8
leaq 0xba112(%rip), %rdi     # 0x120db8
callq 0x5eff8
jmp 0x66d7a
leaq 0xba15d(%rip), %rdi     # 0x120e14
movl $0x6b, %esi
callq 0x5edda
leaq 0xba157(%rip), %rdi     # 0x120e1f
movl $0x6d, %esi
callq 0x5edda
jmp 0x66d7a
leaq 0xba10b(%rip), %rdi     # 0x120de9
callq 0x5f228
leaq 0xba109(%rip), %rdi     # 0x120df3
callq 0x5f228
leaq 0xba108(%rip), %rdi     # 0x120dfe
callq 0x5f228
leaq 0xba102(%rip), %rdi     # 0x120e04
callq 0x5f228
cmpb $0x0, (%r14)
jne 0x66d7a
cmpq $0x200000, (%r15)       # imm = 0x200000
jne 0x66d7a
leaq 0xb9c07(%rip), %rdi     # 0x120924
callq 0x5f228
jmp 0x66d7a
movl $0x3f4, %edi            # imm = 0x3F4
movl $0x6, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x646e6
callq 0x648ab
jmp 0x66d7a
callq 0x6a147
movl $0x4a, %edi
movl $0x1, %esi
callq 0x6a189
movl $0x1, %edi
callq 0x590f7
callq 0x6a1f7
jmp 0x66d7a
movl $0xbb, %edi
callq 0x5e6be
xorl %edi, %edi
callq 0x590f7
callq 0x5e73c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6a236