// File: /workspace/github_cpp_makefile_star2_O1/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 0x1d8916(%rip), %rax    # 0x23ef3e
leaq 0x2d09f1(%rip), %r14    # 0x337020
movb (%r14), %cl
orb (%rax), %cl
je 0x66641
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b2288(%rip), %r15    # 0x2188d0
movq (%r15), %rax
cmpq $0xfff, %rax            # imm = 0xFFF
jg 0x666d9
cmpq $0x3f, %rax
jg 0x66756
cmpq $0x7, %rax
jg 0x6687b
cmpq $0x1, %rax
je 0x66a27
cmpq $0x4, %rax
jne 0x66bdb
movl $0xa09, %edi            # imm = 0xA09
xorl %esi, %esi
callq 0x5f3f5
callq 0x5f4ce
movl $0x624, %edi            # imm = 0x624
xorl %esi, %esi
callq 0x5f3f5
callq 0x5f4ce
movl $0x613, %edi            # imm = 0x613
xorl %esi, %esi
callq 0x5f3f5
callq 0x5f4ce
movl $0x623, %edi            # imm = 0x623
xorl %esi, %esi
callq 0x5f3f5
callq 0x5f4ce
movl $0x608, %edi            # imm = 0x608
xorl %esi, %esi
callq 0x5f3f5
callq 0x5f4ce
jmp 0x66bdb
cmpq $0x1fffffff, %rax       # imm = 0x1FFFFFFF
jg 0x66831
cmpq $0x1fffff, %rax         # imm = 0x1FFFFF
jg 0x668ca
cmpq $0x1000, %rax           # imm = 0x1000
je 0x66aa1
cmpq $0x100000, %rax         # imm = 0x100000
jne 0x66bdb
leaq 0xba63d(%rip), %rdi     # 0x120d4d
callq 0x5f15d
leaq 0xba637(%rip), %rdi     # 0x120d53
callq 0x5f15d
leaq 0xba631(%rip), %rdi     # 0x120d59
callq 0x5f15d
leaq 0xba62b(%rip), %rdi     # 0x120d5f
callq 0x5f15d
leaq 0xba625(%rip), %rdi     # 0x120d65
callq 0x5f15d
leaq 0xba61f(%rip), %rdi     # 0x120d6b
callq 0x5f15d
jmp 0x66bdb
cmpq $0xff, %rax
jg 0x66911
cmpq $0x40, %rax
je 0x66aec
cmpq $0x80, %rax
jne 0x66bdb
movl $0x46, %edi
movl $0x1, %esi
callq 0x5fbb4
callq 0x61bc3
movl $0x6a, %edi
movl $0x2, %esi
callq 0x5fbb4
movl $0x2, %edi
callq 0x591af
callq 0x61bc3
movl $0x2f, %edi
movl $0x1, %esi
callq 0x5fbb4
callq 0x61bc3
movl $0x64, %edi
movl $0x2, %esi
callq 0x5fbb4
movl $0x1, %edi
callq 0x591af
callq 0x61bc3
movl $0x64, %edi
movl $0x2, %esi
callq 0x5fbb4
movl $0x7, %edi
callq 0x591af
callq 0x61bc3
movl $0x64, %edi
movl $0x2, %esi
callq 0x5fbb4
movl $0x20, %edi
callq 0x591af
callq 0x61bc3
movl $0x10, %edi
movl $0x1, %esi
callq 0x5fbb4
callq 0x61bc3
jmp 0x66bdb
movabsq $0x1ffffffff, %rcx      # imm = 0x1FFFFFFFF
cmpq %rcx, %rax
jg 0x669a5
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x66b0c
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
jne 0x66bdb
leaq 0xba44a(%rip), %rdi     # 0x120caf
callq 0x5ef13
leaq 0xba454(%rip), %rdi     # 0x120cc5
callq 0x5ef13
jmp 0x66bdb
cmpq $0x8, %rax
je 0x66b29
cmpq $0x20, %rax
jne 0x66bdb
leaq 0xba448(%rip), %rdi     # 0x120cde
callq 0x61694
movl $0xff, %edi
callq 0x591af
callq 0x6170f
leaq 0xba430(%rip), %rdi     # 0x120ce1
callq 0x61694
movl $0xff, %edi
callq 0x591af
callq 0x6170f
jmp 0x66bdb
cmpq $0x200000, %rax         # imm = 0x200000
je 0x66b50
cmpq $0x400000, %rax         # imm = 0x400000
jne 0x66bdb
callq 0x658f9
callq 0x6598f
callq 0x657ff
callq 0x657bd
callq 0x659c1
xorl %edi, %edi
callq 0x655b0
movl $0x45, %edi
callq 0x5e740
jmp 0x66a97
cmpq $0x100, %rax            # imm = 0x100
je 0x66b9d
cmpq $0x800, %rax            # imm = 0x800
jne 0x66bdb
movl $0xd, %edi
callq 0x5e740
movl $0x3, %edi
callq 0x591af
callq 0x5e844
movl $0xd, %edi
callq 0x5e740
movl $0x4, %edi
callq 0x591af
callq 0x5e844
movl $0x11, %edi
callq 0x5e740
xorl %edi, %edi
callq 0x591af
callq 0x5e844
movl $0x1d, %edi
callq 0x5e740
xorl %edi, %edi
callq 0x591af
callq 0x5e844
movl $0xd7, %edi
callq 0x5e740
movl $0x2, %edi
callq 0x591af
callq 0x5e844
jmp 0x66bdb
movabsq $0x200000000, %rcx      # imm = 0x200000000
cmpq %rcx, %rax
je 0x66bb8
movabsq $0x800000000, %rcx      # imm = 0x800000000
cmpq %rcx, %rax
jne 0x66bdb
movl $0x1e, %edi
callq 0x65d47
movl $0x31, %edi
callq 0x65d47
movl $0x33, %edi
movl $0x5, %esi
callq 0x653a5
movl $0x2, %edi
callq 0x591af
movzwl 0x3060bc(%rip), %r14d   # 0x36cabc
movl $0xff, %ebx
movl %r14d, %edi
andl %ebx, %edi
callq 0x591af
addl %r14d, %ebx
testw %r14w, %r14w
cmovnsl %r14d, %ebx
movzbl %bh, %edi
callq 0x591af
jmp 0x66bdb
leaq 0x1b45a6(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
leal -0x33(%rcx), %edx
cmpl $0x1d, %edx
ja 0x66a86
movl $0x20004009, %esi       # imm = 0x20004009
btl %edx, %esi
jae 0x66a86
movl %ecx, %esi
xorl $0x41, %esi
leaq 0x1b1eaa(%rip), %rdx    # 0x2188f8
movl (%rdx), %edx
movl %edx, %edi
xorl $0x47, %edi
orl %esi, %edi
je 0x66a86
cmpl $0x41, %ecx
jne 0x66a68
cmpl $0x33, %edx
je 0x66a86
cmpl $0x47, %edx
je 0x66a86
cmpl $0x41, %ecx
sete %dl
cmpl $0x50, %ecx
sete %cl
cmpq $0x1, %rax
jne 0x66bea
orb %cl, %dl
je 0x66bea
movl $0xbb, %edi
callq 0x5e740
xorl %edi, %edi
callq 0x591af
callq 0x5e7c0
jmp 0x66bdb
leaq 0x1b4550(%rip), %rax    # 0x21aff8
cmpl $0x0, (%rax)
jne 0x66636
movl %edi, %ebx
leaq 0xba22a(%rip), %rdi     # 0x120ce4
movl $0xca, %esi
callq 0x5ee52
leaq 0x1d78c5(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x66bdb
leaq 0xba20c(%rip), %rsi     # 0x120cea
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
jmp 0x66bdb
movl $0x98, %edi
movl $0x2, %esi
callq 0x5fa97
xorl %edi, %edi
callq 0x591af
callq 0x5fb3b
jmp 0x66bdb
leaq 0xb9ede(%rip), %rdi     # 0x1209f1
callq 0x5f070
leaq 0xba1b9(%rip), %rdi     # 0x120cd8
callq 0x5f070
jmp 0x66bdb
leaq 0xba204(%rip), %rdi     # 0x120d34
movl $0x6b, %esi
callq 0x5ee52
leaq 0xba1fe(%rip), %rdi     # 0x120d3f
movl $0x6d, %esi
callq 0x5ee52
jmp 0x66bdb
leaq 0xba1b2(%rip), %rdi     # 0x120d09
callq 0x5f2a0
leaq 0xba1b0(%rip), %rdi     # 0x120d13
callq 0x5f2a0
leaq 0xba1af(%rip), %rdi     # 0x120d1e
callq 0x5f2a0
leaq 0xba1a9(%rip), %rdi     # 0x120d24
callq 0x5f2a0
cmpb $0x0, (%r14)
jne 0x66bdb
cmpq $0x200000, (%r15)       # imm = 0x200000
jne 0x66bdb
leaq 0xb9cae(%rip), %rdi     # 0x120844
callq 0x5f2a0
jmp 0x66bdb
movl $0x3f4, %edi            # imm = 0x3F4
movl $0x6, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x645ec
callq 0x646c7
jmp 0x66bdb
callq 0x69fe9
movl $0x4a, %edi
movl $0x1, %esi
callq 0x6a02b
movl $0x1, %edi
callq 0x591af
callq 0x6a099
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6a0d8
movl $0x1, %edi
callq 0x6139d
jmp 0x66bdb