// File: 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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x211e9c(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x8c28c
jmp 0x8c83c
leaq 0x309f6d(%rip), %rax    # 0x396200
cmpb $0x0, (%rax)
je 0x8c29d
jmp 0x8c83c
movl $0x80000000, %ecx       # imm = 0x80000000
leaq 0x1eb807(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8c2cb
leaq 0xf7d5a(%rip), %rdi     # 0x18400f
callq 0x830d0
leaq 0xf7d64(%rip), %rdi     # 0x184025
callq 0x830d0
jmp 0x8c837
leaq 0x1eb7de(%rip), %rax    # 0x277ab0
cmpq $0x20000000, (%rax)     # imm = 0x20000000
jne 0x8c2f8
leaq 0xf7a6f(%rip), %rdi     # 0x183d51
callq 0x83270
leaq 0xf7d4a(%rip), %rdi     # 0x184038
callq 0x83270
jmp 0x8c835
leaq 0x1eb7b1(%rip), %rax    # 0x277ab0
cmpq $0x20, (%rax)
jne 0x8c340
leaq 0xf7d32(%rip), %rdi     # 0x18403e
callq 0x86190
movl $0xff, %edi
callq 0x7b210
callq 0x86230
leaq 0xf7d1a(%rip), %rdi     # 0x184041
callq 0x86190
movl $0xff, %edi
callq 0x7b210
callq 0x86230
jmp 0x8c833
leaq 0x1eb769(%rip), %rax    # 0x277ab0
cmpq $0x800, (%rax)          # imm = 0x800
jne 0x8c3cc
movl $0xd, %edi
callq 0x824f0
movl $0x3, %edi
callq 0x7b210
callq 0x82630
movl $0xd, %edi
callq 0x824f0
movl $0x4, %edi
callq 0x7b210
callq 0x82630
movl $0x11, %edi
callq 0x824f0
xorl %edi, %edi
callq 0x7b210
callq 0x82630
movl $0x1d, %edi
callq 0x824f0
xorl %edi, %edi
callq 0x7b210
callq 0x82630
movl $0xd7, %edi
callq 0x824f0
movl $0x2, %edi
callq 0x7b210
callq 0x82630
jmp 0x8c831
leaq 0x1eb6dd(%rip), %rax    # 0x277ab0
cmpq $0x400000, (%rax)       # imm = 0x400000
jne 0x8c3ff
callq 0x8b300
callq 0x8b3c0
callq 0x8b1c0
callq 0x8b160
callq 0x8b400
callq 0x8b030
jmp 0x8c82f
movabsq $0x200000000, %rcx      # imm = 0x200000000
leaq 0x1eb6a0(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8c43d
callq 0x909a0
movl $0x4a, %edi
movl $0x1, %esi
callq 0x90a00
movl $0x1, %edi
callq 0x7b210
callq 0x90a70
jmp 0x8c82d
leaq 0x1eb66c(%rip), %rax    # 0x277ab0
cmpq $0x40, (%rax)
jne 0x8c459
movl $0x98, %edi
callq 0x8b7a0
jmp 0x8c82b
leaq 0x1eb650(%rip), %rax    # 0x277ab0
cmpq $0x1000, (%rax)         # imm = 0x1000
jne 0x8c4b8
leaq 0x1edd68(%rip), %rax    # 0x27a1d8
cmpl $0x0, (%rax)
je 0x8c47a
jmp 0x8c83c
leaq 0xf7bc3(%rip), %rdi     # 0x184044
movl $0xca, %esi
callq 0x82fd0
leaq 0x2110de(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0x8c4b3
leaq 0x2110d1(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movl -0x4(%rbp), %edx
leaq 0xf7b9e(%rip), %rsi     # 0x18404a
movb $0x0, %al
callq 0x9550
jmp 0x8c829
movabsq $0x400000000, %rcx      # imm = 0x400000000
leaq 0x1eb5e7(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8c4f7
leaq 0xe3a06(%rip), %rdi     # 0x16fedb
callq 0x83970
leaq 0xf7b82(%rip), %rdi     # 0x184063
callq 0x83970
leaq 0xf7b79(%rip), %rdi     # 0x184066
callq 0x83970
jmp 0x8c827
leaq 0x1eb5b2(%rip), %rax    # 0x277ab0
cmpq $0x200000, (%rax)       # imm = 0x200000
jne 0x8c541
leaq 0xf7b5b(%rip), %rdi     # 0x184069
callq 0x83580
leaq 0xf7b59(%rip), %rdi     # 0x184073
callq 0x83580
leaq 0xf7b58(%rip), %rdi     # 0x18407e
callq 0x83580
leaq 0xf7b52(%rip), %rdi     # 0x184084
callq 0x83580
callq 0x8bce0
jmp 0x8c825
movabsq $0x800000000, %rcx      # imm = 0x800000000
leaq 0x1eb55e(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8c58e
movl $0x1e, %edi
callq 0x8b7d0
movl $0x31, %edi
callq 0x8b7d0
movl $0x33, %edi
movl $0x5, %esi
callq 0x8ab80
movl $0x2, %edi
callq 0x7b210
callq 0x8ac40
jmp 0x8c823
leaq 0x1eb51b(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x8c693
leaq 0x1eb50a(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x8c678
leaq 0x1edbfd(%rip), %rax    # 0x27a1b4
cmpl $0x36, (%rax)
je 0x8c5e4
leaq 0x1edbf1(%rip), %rax    # 0x27a1b4
cmpl $0x33, (%rax)
je 0x8c5e4
leaq 0x1edbe5(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x8c5e4
leaq 0x1edbd9(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x8c678
leaq 0x1eb4c5(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x8c609
leaq 0x1edbbc(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x8c609
leaq 0x1eb4d4(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
je 0x8c678
leaq 0x1eb4a0(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x8c63a
leaq 0x1edb97(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x8c63a
leaq 0x1eb4af(%rip), %rax    # 0x277ad8
cmpl $0x33, (%rax)
je 0x8c678
leaq 0x1eb4a3(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
je 0x8c678
leaq 0x1eb46f(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x8c653
leaq 0x1edb66(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
je 0x8c678
leaq 0x1eb456(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x8c66c
leaq 0x1edb4d(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x8c678
movl $0x1, %edi
callq 0x85d60
jmp 0x8c68e
movl $0xbb, %edi
callq 0x824f0
xorl %edi, %edi
callq 0x7b210
callq 0x82590
jmp 0x8c821
leaq 0x1eb416(%rip), %rax    # 0x277ab0
cmpq $0x4, (%rax)
jne 0x8c6d7
movl $0xa09, %edi            # imm = 0xA09
callq 0x85d00
movl $0x624, %edi            # imm = 0x624
callq 0x85d00
movl $0x613, %edi            # imm = 0x613
callq 0x85d00
movl $0x623, %edi            # imm = 0x623
callq 0x85d00
movl $0x608, %edi            # imm = 0x608
callq 0x85d00
jmp 0x8c81f
leaq 0x1eb3d2(%rip), %rax    # 0x277ab0
cmpq $0x8, (%rax)
jne 0x8c70b
leaq 0xf79a9(%rip), %rdi     # 0x184094
movl $0x6b, %esi
callq 0x82fd0
leaq 0xf79a3(%rip), %rdi     # 0x18409f
movl $0x6d, %esi
callq 0x82fd0
jmp 0x8c81d
leaq 0x1eb39e(%rip), %rax    # 0x277ab0
cmpq $0x80, (%rax)
jne 0x8c789
movl $0x46, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x8b800
movl $0x6a, %edi
movl $0x2, %esi
callq 0x8b800
movl $0x2f, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x8b800
movl $0x64, %edi
movl $0x1, %esi
callq 0x8b800
movl $0x64, %edi
movl $0x7, %esi
callq 0x8b800
movl $0x64, %edi
movl $0x20, %esi
callq 0x8b800
movl $0x10, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x8b800
jmp 0x8c81b
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq 0x1eb316(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8c7a1
jmp 0x8c819
leaq 0x1eb308(%rip), %rax    # 0x277ab0
cmpq $0x100, (%rax)          # imm = 0x100
jne 0x8c7bd
movl $0x3f4, %edi            # imm = 0x3F4
callq 0x8b850
jmp 0x8c817
leaq 0x1eb2ec(%rip), %rax    # 0x277ab0
cmpq $0x100000, (%rax)       # imm = 0x100000
jne 0x8c815
leaq 0xf78d8(%rip), %rdi     # 0x1840ac
callq 0x85d30
leaq 0xf78d2(%rip), %rdi     # 0x1840b2
callq 0x85d30
leaq 0xf78cc(%rip), %rdi     # 0x1840b8
callq 0x85d30
leaq 0xf78c6(%rip), %rdi     # 0x1840be
callq 0x85d30
leaq 0xf78c0(%rip), %rdi     # 0x1840c4
callq 0x85d30
leaq 0xf78ba(%rip), %rdi     # 0x1840ca
callq 0x85d30
jmp 0x8c817
jmp 0x8c819
jmp 0x8c81b
jmp 0x8c81d
jmp 0x8c81f
jmp 0x8c821
jmp 0x8c823
jmp 0x8c825
jmp 0x8c827
jmp 0x8c829
jmp 0x8c82b
jmp 0x8c82d
jmp 0x8c82f
jmp 0x8c831
jmp 0x8c833
jmp 0x8c835
jmp 0x8c837
callq 0x90ac0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)