// File: jkingan[P]ladyheather/heathgps.cpp
// Function: request_version()
void request_version()
{
   if(luxor) return;
   if(no_poll) return;

   if(rcvr_type == BRANDY_RCVR) {
      queue_brandy_cmd("n", BRANDY_VERSION_MSG);
   }
   else if(rcvr_type == ESIP_RCVR) {
      send_esip_cmd("PERDSYS,VERSION");
      send_esip_cmd("PERDSYS,GPIO");
   }
   else if(rcvr_type == GPSD_RCVR) {
      send_user_cmd("?DEVICES;");
      send_user_cmd("?VERSION;");
   }
   else if(rcvr_type == LPFRS_RCVR) {
      queue_lpfrs_cmd("V", LPFRS_ID_MSG);
   }
   else if(rcvr_type == MOTO_RCVR) {
      if(!saw_version) {  // this message is rather long, only get the info once
         send_moto_start("Cj");  // request receiver ID string
         send_moto_end();
      }
   }
   else if(rcvr_type == NVS_RCVR) {
      send_nvs_start(0x1B);
      send_nvs_end();
   }
   else if(rcvr_type == PRS_RCVR) {
      queue_prs_cmd("ID?", PRS_ID_MSG);
   }
   else if(rcvr_type == RFTG_RCVR) {
      request_rftg_hw_ver();
   }
   else if(rcvr_type == SA35_RCVR) {
//      queue_sa35_cmd("V", LPFRS_ID_MSG);
   }
   else if(rcvr_type == SIRF_RCVR) {
      query_sirf_msg(GET_SIRF_SW_VER);
   }
   else if(rcvr_type == SS_RCVR) {
      request_ss_msg(45);  // hardware/software version
   }
   else if(rcvr_type == SRO_RCVR) {
      queue_prs_cmd("ID", SRO_ID_MSG);
   }
   else if(rcvr_type == TAIP_RCVR) {
      send_taip_cmd("QVR");  // query version
      send_taip_cmd("QID");  // query unit id
   }
   else if(rcvr_type == TRUE_RCVR) {
      send_true_cmd("$GETVER");   // get receiver version
   }
   else if(rcvr_type == TSIP_RCVR) {
      send_tsip_start(0x1F);
      if(0) {  // requests (undocumented) extended receiver configuration info
         send_byte(0x01);
         send_byte(0x00);
      }
      send_tsip_end();

      request_manuf_params();
      request_prodn_params();
      request_fw_ver();      // !!! testing ThunderBolt-E, Resolution messages
      request_hw_ver();
   }
   else if(rcvr_type == UBX_RCVR) {  // this is a rather wordy message
       if(saw_version == 0) request_ubx_msg(UBX_VER);  // don't request if we already have it
   }
   else if(rcvr_type == VENUS_RCVR) {
      query_venus_msg(QUERY_VENUS_VERSION);
   }
   else if(rcvr_type == Z12_RCVR) {
      if(have_info == 0) send_z12_cmd("PASHQ,RID");
   }
   else if(rcvr_type == ZODIAC_RCVR) {
      query_zod_msg(ZOD_ID_MSG);
      query_zod_msg(ZOD_DIAG_MSG);
   }
   else if(rcvr_type == ZYFER_RCVR) {
      send_zyfer_cmd("$VERS");
      send_zyfer_cmd("$UNID");
      send_zyfer_cmd("$MANI");
      send_zyfer_cmd("$PRID");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x212ce3(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x8b445
jmp 0x8b79d
leaq 0x30adb4(%rip), %rax    # 0x396200
cmpb $0x0, (%rax)
je 0x8b456
jmp 0x8b79d
leaq 0x1ec653(%rip), %rax    # 0x277ab0
cmpq $0x40000, (%rax)        # imm = 0x40000
jne 0x8b47c
leaq 0xe6fca(%rip), %rdi     # 0x172437
movl $0x190, %esi            # imm = 0x190
callq 0x82fd0
jmp 0x8b79d
movl $0x80000000, %ecx       # imm = 0x80000000
leaq 0x1ec628(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8b4aa
leaq 0xf867a(%rip), %rdi     # 0x183b0e
callq 0x830d0
leaq 0xf867e(%rip), %rdi     # 0x183b1e
callq 0x830d0
jmp 0x8b79b
leaq 0x1ec5ff(%rip), %rax    # 0x277ab0
cmpq $0x200, (%rax)          # imm = 0x200
jne 0x8b4d7
leaq 0xf866a(%rip), %rdi     # 0x183b2b
callq 0x827c0
leaq 0xf8668(%rip), %rdi     # 0x183b35
callq 0x827c0
jmp 0x8b799
leaq 0x1ec5d2(%rip), %rax    # 0x277ab0
cmpq $0x10000000, (%rax)     # imm = 0x10000000
jne 0x8b4fd
leaq 0x106d82(%rip), %rdi    # 0x192270
movl $0x385, %esi            # imm = 0x385
callq 0x82fd0
jmp 0x8b797
leaq 0x1ec5ac(%rip), %rax    # 0x277ab0
cmpq $0x20, (%rax)
jne 0x8b52c
leaq 0x2e10d7(%rip), %rax    # 0x36c5e8
cmpl $0x0, (%rax)
jne 0x8b527
leaq 0xf8622(%rip), %rdi     # 0x183b3f
callq 0x86190
callq 0x86230
jmp 0x8b795
leaq 0x1ec57d(%rip), %rax    # 0x277ab0
cmpq $0x800, (%rax)          # imm = 0x800
jne 0x8b550
movl $0x1b, %edi
callq 0x824f0
callq 0x82630
jmp 0x8b793
leaq 0x1ec559(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x8b576
leaq 0xf85db(%rip), %rdi     # 0x183b42
movl $0x1f6, %esi            # imm = 0x1F6
callq 0x82fd0
jmp 0x8b791
leaq 0x1ec533(%rip), %rax    # 0x277ab0
cmpq $0x400000, (%rax)       # imm = 0x400000
jne 0x8b590
callq 0x8b380
jmp 0x8b78f
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
leaq 0x1ec50f(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8b5ab
jmp 0x8b78d
leaq 0x1ec4fe(%rip), %rax    # 0x277ab0
cmpq $0x40, (%rax)
jne 0x8b5c7
movl $0x84, %edi
callq 0x8b7a0
jmp 0x8b78b
movabsq $0x800000000, %rcx      # imm = 0x800000000
leaq 0x1ec4d8(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8b5ec
movl $0x2d, %edi
callq 0x8b7d0
jmp 0x8b789
leaq 0x1ec4bd(%rip), %rax    # 0x277ab0
cmpq $0x8000000, (%rax)      # imm = 0x8000000
jne 0x8b612
leaq 0xfc217(%rip), %rdi     # 0x18781a
movl $0x321, %esi            # imm = 0x321
callq 0x82fd0
jmp 0x8b787
leaq 0x1ec497(%rip), %rax    # 0x277ab0
cmpq $0x8000, (%rax)         # imm = 0x8000
jne 0x8b63f
leaq 0xf851d(%rip), %rdi     # 0x183b46
callq 0x899c0
leaq 0xf8515(%rip), %rdi     # 0x183b4a
callq 0x899c0
jmp 0x8b785
leaq 0x1ec46a(%rip), %rax    # 0x277ab0
cmpq $0x200000, (%rax)       # imm = 0x200000
jne 0x8b660
leaq 0xf84f8(%rip), %rdi     # 0x183b4e
callq 0x83580
jmp 0x8b783
leaq 0x1ec449(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x8b695
movl $0x1f, %edi
callq 0x824f0
callq 0x82590
callq 0x8ac90
callq 0x8adc0
callq 0x85620
callq 0x857e0
jmp 0x8b781
leaq 0x1ec414(%rip), %rax    # 0x277ab0
cmpq $0x4, (%rax)
jne 0x8b6bd
leaq 0x2e0f3f(%rip), %rax    # 0x36c5e8
cmpl $0x0, (%rax)
jne 0x8b6b8
movl $0xa04, %edi            # imm = 0xA04
callq 0x85d00
jmp 0x8b77f
leaq 0x1ec3ec(%rip), %rax    # 0x277ab0
cmpq $0x80, (%rax)
jne 0x8b6e1
movl $0x2, %edi
movl $0x1, %esi
callq 0x8b800
jmp 0x8b77d
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq 0x1ec3be(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x8b711
leaq 0x2e1456(%rip), %rax    # 0x36cb54
cmpl $0x0, (%rax)
jne 0x8b70f
leaq 0xf844c(%rip), %rdi     # 0x183b56
callq 0x83630
jmp 0x8b77b
leaq 0x1ec398(%rip), %rax    # 0x277ab0
cmpq $0x100, (%rax)          # imm = 0x100
jne 0x8b737
movl $0x3f3, %edi            # imm = 0x3F3
callq 0x8b850
movl $0x44c, %edi            # imm = 0x44C
callq 0x8b850
jmp 0x8b779
leaq 0x1ec372(%rip), %rax    # 0x277ab0
cmpq $0x100000, (%rax)       # imm = 0x100000
jne 0x8b777
leaq 0xf8412(%rip), %rdi     # 0x183b60
callq 0x85d30
leaq 0xf840c(%rip), %rdi     # 0x183b66
callq 0x85d30
leaq 0xf8406(%rip), %rdi     # 0x183b6c
callq 0x85d30
leaq 0xf8400(%rip), %rdi     # 0x183b72
callq 0x85d30
jmp 0x8b779
jmp 0x8b77b
jmp 0x8b77d
jmp 0x8b77f
jmp 0x8b781
jmp 0x8b783
jmp 0x8b785
jmp 0x8b787
jmp 0x8b789
jmp 0x8b78b
jmp 0x8b78d
jmp 0x8b78f
jmp 0x8b791
jmp 0x8b793
jmp 0x8b795
jmp 0x8b797
jmp 0x8b799
jmp 0x8b79b
jmp 0x8b79d
popq %rbp
retq
nop