Skip to content
script.js 24.3 KiB
Newer Older
developer27's avatar
developer27 committed

var functions = {};

developer27's avatar
developer27 committed
functions["ReaderOpen"] = "";
developer34's avatar
developer34 committed
functions["ReaderOpenEx"] = "reader_type port_name port_interface additional_arguments";
developer34's avatar
developer34 committed
functions["ReaderOpenEx___UDP"] = "0 ip_address:port U 0";
functions["ReaderOpenEx___TCP"] = "0 ip_address:port T 0";
functions["ReaderOpenEx___Bluetooth"] = "2 port_name 0 UNIT_OPEN_RESET_DISABLE";
functions["ReaderOpenEx___Transparent"] = "2 port_name 0 UNIT_OPEN_RESET_DISABLE";
developer27's avatar
developer27 committed
functions["ReaderOpenByType"] = "reader_type";
functions["ReaderReset"] = "";
functions["ReaderClose"] = "";
functions["GetReaderType"] = "lpulReaderType";
functions["GetReaderSerialNumber"] = "lpulSerialNumber";
functions["GetBuildNumber"] = "buildNumber";
functions["GetReaderFirmwareVersion"] = "version_major version_minor";
functions["GetReaderHardwareVersion"] = "version_major version_minor";
functions["GetReaderSerialDescription"] = "pSerialDescription";
functions["ChangeReaderPassword"] = "oldPass newPass";
functions["ReaderKeyWrite"] = "aucKey index";
functions["ReaderKeysLock"] = "password";
functions["ReaderKeysUnlock"] = "password";
functions["ReaderSoftRestart"] = "";
functions["ReadUserData"] = "aucData";
functions["WriteUserData"] = "aucData";
functions["UfrEnterSleepMode"] = "";
functions["UfrLeaveSleepMode"] = "";
functions["AutoSleepSet"] = "wait";
functions["AutoSleepGet"] = "seconds_wait";
functions["SetSpeedPermanently"] = "tx rx";
functions["GetSpeedParameters"] = "tx_speed rx_speed";
functions["SetAsyncCardIdSendConfig"] = "sendEnable prefixEnable prefix suffix sendRemovedEnable baudRate";
functions["GetAsyncCardIdSendConfig"] = "send_enable prefix_enable prefix suffix send_removed_enable async_baud_rate";
functions["SetAsyncCardIdSendConfigEx"] = "sendEnable prefixEnable prefix suffix sendRemovedEnable reverseByteOrder decimalRepresentation baudRate";
functions["GetAsyncCardIdSendConfigEx"] = "send_enable prefix_enable prefix suffix send_removed_enable reserve_byte_order decimal_representation async_baud_rate";
functions["ReaderUISignal"] = "light beep";
functions["UfrRedLightControl"] = "control";
functions["SetSpeakerFrequency"] = "frequency";
functions["GetDllVersionStr"] = "";
functions["GetReaderDescription"] = "";
functions["GetDlogicCardType"] = "lpucCardType";
functions["GetCardId"] = "lpucCardType lpucCardSerial";
functions["GetCardIdEx"] = "lpucSak aucUid lpucUidSize";
functions["GetLastCardIdEx"] = "lpucSak aucUid lpucUidSize";
functions["BlockRead"] = "data blockAdress authMode keyIndex";
functions["BlockRead_AKM1"] = "data blockAdress authMode";
functions["BlockRead_AKM2"] = "data blockAdress authMode";
functions["BlockRead_PK"] = "data blockAdress authMode key";
functions["BlockWrite"] = "data blockAdress authMode keyIndex";
functions["BlockWrite_AKM1"] = "data blockAdress authMode";
functions["BlockWrite_AKM2"] = "data blockAdress authMode";
functions["BlockWrite_PK"] = "data blockAdress auhtMode key";
functions["BlockInSectorRead"] = "data sectorAdress blockAdress authMode keyIndex";
functions["BlockInSectorRead_AKM1"] = "data sectorAdress blockAdress authMode";
functions["BlockInSectorRead_AKM2"] = "data sectorAdress blockAdress authMode";
functions["BlockInSectorRead_PK"] = "data sectorAdress blockAdress authMode key";
functions["BlockInSectorWrite"] = "data sectorAdress blockAdress authMode keyIndex";
functions["BlockInSectorWrite_AKM1"] = "data sectorAdress blockAdress authMode";
functions["BlockInSectorWrite_AKM2"] = "data sectorAdress blockAdress authMode";
functions["BlockInSectorWrite_PK"] = "data sectorAdress blockAdress authMode key";
functions["LinearRead"] = "data linearAdress length bytes_returned authMode keyIndex";
functions["LinearRead_AKM1"] = "data linearAdress length bytes_returned authMode";
functions["LinearRead_AKM2"] = "data linearAdress length bytes_returned authMode";
functions["LinearRead_PK"] = "data linearAdress length bytes_returned authMode key";
functions["LinearWrite"] = "data linearAdress length bytes_returned authMode keyIndex";
functions["LinearWrite_AKM1"] = "data linearAdress length bytes_returned authMode";
functions["LinearWrite_AKM2"] = "data linearAdress length bytes_returned authMode";
functions["LinearWrite_PK"] = "data linearAdress length bytes_returned authMode key";
functions["LinRowRead"] = "data linRowAdress length bytes_returned authMode keyIndex";
functions["LinRowRead_AKM1"] = "data linRowAdress length bytes_returned authMode";
functions["LinRowRead_AKM2"] = "data linRowAdress length bytes_returned authMode";
functions["LinRowRead_PK"] = "data linRowAdress length bytes_returned authMode key";
functions["LinearFormatCard"] = "newKeyA blockAccessBits sectorTrailAccessBits sectorTrailAccessByte newKeyB lpucSectorsFormatted authMode keyIndex";
functions["LinearFormatCard_AKM1"] = "newKeyA blockAccessBits sectorTrailAccessBits sectorTrailAccessByte newKeyB lpucSectorsFormatted authMode";
functions["LinearFormatCard_AKM2"] = "newKeyA blockAccessBits sectorTrailAccessBits sectorTrailAccessByte newKeyB lpucSectorsFormatted authMode";
functions["LinearFormatCard_PK"] = "newKeyA blockAccessBits sectorTrailAccessBits sectorTrailAccessByte newKeyB lpucSectorsFormatted authMode key";
functions["GetCardSize"] = "lpulLinearSize lpulRawSize";
functions["SectorTrailerWrite"] = "adressMode adress newKeyA block0 block1 block2 sectorTrailAccessBits sectorTrailAccessByte newKeyB authMode keyIndex";
functions["SectorTrailerWrite_AKM1"] = "adressMode adress newKeyA block0 block1 block2 sectorTrailAccessBits sectorTrailAccessByte newKeyB authMode";
functions["SectorTrailerWrite_AKM2"] = "adressMode adress newKeyA block0 block1 block2 sectorTrailAccessBits sectorTrailAccessByte newKeyB authMode";
functions["SectorTrailerWrite_PK"] = "adressMode adress newKeyA block0 block1 block2 sectorTrailAccessBits sectorTrailAccessByte newKeyB authMode key";
functions["SectorTrailerWriteUnsafe"] = "adressMode adress sectorTrailer authMode keyIndex";
functions["SectorTrailerWriteUnsafe_AKM1"] = "adressMode adress sectorTrailer authMode";
functions["SectorTrailerWriteUnsafe_AKM2"] = "adressMode adress sectorTrailer authMode";
functions["SectorTrailerWriteUnsafe_PK"] = "adressMode adress sectorTrailer authMode key";
functions["ValueBlockRead"] = "value value_addr blockAdress authMode keyIndex";
functions["ValueBlockRead_AKM1"] = "value value_addr blockAdress authMode";
functions["ValueBlockRead_AKM2"] = "value value_addr blockAdress authMode";
functions["ValueBlockRead_PK"] = "value value_addr blockAdress authMode key";
functions["ValueBlockWrite"] = "value valueAddress blockAdress authMode keyIndex";
functions["ValueBlockWrite_AKM1"] = "value valueAddress blockAdress authMode";
functions["ValueBlockWrite_AKM2"] = "value valueAddress blockAdress authMode";
functions["ValueBlockWrite_PK"] = "value valueAddress blockAdress authMode key";
functions["ValueBlockInSectorRead"] = "value value_addr sectorAdress blockAdress authMode keyIndex";
functions["ValueBlockInSectorRead_AKM1"] = "value value_addr sectorAdress blockAdress authMode";
functions["ValueBlockInSectorRead_AKM2"] = "value value_addr sectorAdress blockAdress authMode";
functions["ValueBlockInSectorRead_PK"] = "value value_addr sectorAdress blockAdress authMode key";
functions["ValueBlockInSectorWrite"] = "value valueAddress sectorAdress blockAdress authMode keyIndex";
functions["ValueBlockInSectorWrite_AKM1"] = "value valueAddress sectorAdress blockAdress authMode";
functions["ValueBlockInSectorWrite_AKM2"] = "value valueAddress sectorAdress blockAdress authMode";
functions["ValueBlockInSectorWrite_PK"] = "value valueAddress sectorAdress blockAdress authMode key";
functions["ValueBlockIncrement"] = "incrementValue blockAdress authMode keyIndex";
functions["ValueBlockIncrement_AKM1"] = "incrementValue blockAdress authMode";
functions["ValueBlockIncrement_AKM2"] = "incrementValue blockAdress authMode";
functions["ValueBlockIncrement_PK"] = "incrementValue blockAdress authMode key";
functions["ValueBlockDecrement"] = "decrementValue blockAdress authMode keyIndex";
functions["ValueBlockDecrement_AKM1"] = "decrementValue blockAdress authMode";
functions["ValueBlockDecrement_AKM2"] = "decrementValue blockAdress authMode";
functions["ValueBlockDecrement_PK"] = "decrementValue blockAdress authMode key";
functions["ValueBlockInSectorIncrement"] = "incrementValue sectorAdress blockAdress authMode keyIndex";
functions["ValueBlockInSectorIncrement_AKM1"] = "incrementValue sectorAdress blockAdress authMode";
functions["ValueBlockInSectorIncrement_AKM2"] = "incrementValue sectorAdress blockAdress authMode";
functions["ValueBlockInSectorIncrement_PK"] = "incrementValue sectorAdress blockAdress authMode key";
functions["ValueBlockInSectorDecrement"] = "decrementValue sectorAdress blockAdress authMode keyIndex";
functions["ValueBlockInSectorDecrement_AKM1"] = "decrementValue sectorAdress blockAdress authMode";
functions["ValueBlockInSectorDecrement_AKM2"] = "decrementValue sectorAdress blockAdress authMode";
functions["ValueBlockInSectorDecrement_PK"] = "decrementValue sectorAdress blockAdress authMode key";
functions["get_ndef_record_count"] = "ndef_message_cnt ndef_record_cnt ndef_record_array empty_ndef_message_cnt";
developer34's avatar
developer34 committed
functions["read_ndef_record"] = "message_nr record_nr tnf type_record type_length id id_length payload payload_length";
functions["write_ndef_record"] = "message_nr tnf type_record type_length id id_length payload payload_length card_formatted";
developer27's avatar
developer27 committed
functions["write_ndef_record_mirroring"] = "message_nr tnf type_record type_length id id_length payload payload_length card_formated use_uid_ascii_mirror use_counter_ascii_mirror payload_mirroring_pos";
functions["erase_last_ndef_record"] = "message_nr";
functions["erase_all_ndef_records"] = "message_nr";
functions["ndef_card_initialization"] = "";
functions["GetReaderTime"] = "time";
functions["SetReaderTime"] = "password time";
functions["ReaderEepromRead"] = "data address size";
functions["ReaderEepromWrite"] = "data address size password";
functions["uFR_int_WriteAesKey"] = "aes_key_no aes_key";
functions["uFR_int_GetDesfireUid"] = "aes_key_nr aid aid_key_nr card_uid card_uid_len card_status exec_time";
functions["uFR_int_GetDesfireUid_PK"] = "aes_key_ext aid aid_key_nr card_uid card_uid_len card_status exec_time";
functions["uFR_int_DesfireFreeMem"] = "free_mem_byte card_status exec_time";
functions["uFR_int_DesfireFormatCard"] = "aes_key_nr card_status exec_time";
functions["uFR_int_DesfireFormatCard_PK"] = "aes_key_ext card_status exec_time";
functions["uFR_int_DesfireSetConfiguration"] = "aes_key_nr random_uid format_disable card_status exec_time";
functions["uFR_int_DesfireSetConfiguration_PK"] = "aes_key_ext random_uid format_disable card_status exec_time";
functions["uFR_int_DesfireChangeKeySettings"] = "aes_key_nr aid settings card_status exec_time";
functions["uFR_int_DesfireChangeKeySettings_PK"] = "aes_key_ext aid settings card_status exec_time";
functions["uFR_int_DesfireCreateAesApplication"] = "aes_key_nr aid_nr setting max_key_no card_status exec_time";
functions["uFR_int_DesfireCreateAesApplication_PK"] = "aes_key_ext aid_nr setting max_key_no card_status exec_time";
functions["uFR_int_DesfireCreateAesApplication_no_auth"] = "aid_nr setting max_key_no card_status exec_time";
functions["uFR_int_DesfireGetKeySettings"] = "aes_key_nr_ aid_ setting card_status exec_time";
functions["uFR_int_DesfireGetKeySettings_PK"] = "aes_key_ext_ aid_ setting card_status exec_time";
functions["uFR_int_DesfireChangeAesKey"] = "aes_key_nr_ aid_ aid_key_no_auth_ new_aes_key_ aid_key_no_ old_aes_key_ card_status exec_time";
functions["uFR_int_DesfireChangeAesKey_PK"] = "aes_key_ext_ aid_ aid_key_no_auth_ new_aes_key_ aid_key_no_ old_aes_key_ card_status exec_time";
functions["uFR_int_DesfireChangeAesKey_A"] = "aes_key_nr_ aid_ aid_key_no_auth_ new_aes_key_nr_ aid_key_no_ old_aes_key_nr_ card_status exec_time";
functions["uFR_int_DesfireCreateValueFile"] = "aes_key_nr aid file_id lower_limit upper_limit value limited_credit_enabled read_key_no write_key_no read_write_key_no change_key_no communication_settings card_status exec_time";
functions["uFR_int_DesfireCreateValueFile_PK"] = "aes_key_ext aid file_id lower_limit upper_limit value limited_credit_enabled read_key_no write_key_no read_write_key_no change_key_no communication_settings card_status exec_time";
functions["uFR_int_DesfireCreateValueFile_no_auth"] = "aid file_id lower_limit upper_limit value limited_credit_enabled read_key_no write_key_no read_write_key_no change_key_no communication_settings card_status exec_time";
functions["uFR_int_DesfireIncreaseValueFile"] = "aes_key_nr aid aid_key_nr file_id communication_settings value card_status exec_time";
functions["uFR_int_DesfireIncreaseValueFile_PK"] = "aes_key_ext aid aid_key_nr file_id communication_settings value card_status exec_time";
functions["uFR_int_DesfireIncreaseValueFile_no_auth"] = "aid aid_key_nr file_id communication_settings value card_status exec_time";
functions["ReadECCSignature"] = "lpucECCSignature lpucUid lpucUidLen lpucDlogicCardType";
functions["uFR_int_DesfireDeleteApplication"] = "aes_key_nr_ aid_ card_status exec_time";
functions["uFR_int_DesfireDeleteApplication_PK"] = "aes_key_ext_ aid_ card_status exec_time";
functions["uFR_int_DesfireCreateStdDataFile"] = "aes_key_nr_ aid_ file_id_ file_size_ read_key_no_ write_key_no_ read_write_key_no_ change_key_no_ communication_settings_ card_status exec_time";
functions["uFR_int_DesfireCreateStdDataFile_PK"] = "aes_key_ext_ aid_ file_id_ file_size_ read_key_no_ write_key_no_ read_write_key_no_ change_key_no_ communication_settings_ card_status exec_time";
functions["uFR_int_DesfireCreateStdDataFile_no_auth"] = "aid_ file_id_ file_size_ read_key_no_ write_key_no_ read_write_key_no_ change_key_no_ communication_settings_ card_status exec_time";
functions["uFR_int_DesfireDeleteFile"] = "aes_key_nr_ aid_ file_id_ card_status exec_time";
functions["uFR_int_DesfireDeleteFile_PK"] = "aes_key_ext_ aid_ file_id_ card_status exec_time";
functions["uFR_int_DesfireDeleteFile_no_auth"] = "aid_ file_id_ card_status exec_time";
functions["uFR_int_DesfireReadStdDataFile"] = "aes_key_nr_ aid_ aid_key_nr_ file_id_ offset_ data_length_ communication_settings_ data card_status exec_time";
functions["uFR_int_DesfireReadStdDataFile_PK"] = "aes_key_ext_ aid_ aid_key_nr_ file_id_ offset_ data_length_ communication_settings_ data card_status exec_time";
functions["uFR_int_DesfireReadStdDataFile_no_auth"] = "aid_ aid_key_nr_ file_id_ offset_ data_length_ communication_settings_ data card_status exec_time";
functions["uFR_int_DesfireWriteStdDataFile"] = "aes_key_nr_ aid_ aid_key_nr_ file_id_ offset_ data_length_ communication_settings_ data_ card_status exec_time";
functions["uFR_int_DesfireWriteStdDataFile_PK"] = "aes_key_ext_ aid_ aid_key_nr_ file_id_ offset_ data_length_ communication_settings_ data_ card_status exec_time";
functions["uFR_int_DesfireWriteStdDataFile_no_auth"] = "aid_ aid_key_nr_ file_id_ offset_ data_length_ communication_settings_ data_ card_status exec_time";
functions["uFR_int_DesfireReadValueFile"] = "aes_key_nr_ aid_ aid_key_nr_ file_id_ communication_settings_ value card_status exec_time";
functions["uFR_int_DesfireReadValueFile_PK"] = "aes_key_ext_ aid_ aid_key_nr_ file_id_ communication_settings_ value card_status exec_time";
functions["uFR_int_DesfireReadValueFile_no_auth"] = "aid_ aid_key_nr_ file_id_ communication_settings_ value card_status exec_time";
functions["uFR_int_DesfireDecreaseValueFile_no_auth"] = "aid_ aid_key_nr_ file_id_ communication_settings_ value_ card_status exec_time";
functions["uFR_int_DesfireDecreaseValueFile_PK"] = "aes_key_ext_ aid_ aid_key_nr_ file_id_ communication_settings_ value_ card_status exec_time";
functions["uFR_int_DesfireDecreaseValueFile"] = "aes_key_nr_ aid_ aid_key_nr_ file_id_ communication_settings_ value_ card_status exec_time";
functions["ReadCounter"] = "counter_address value";
functions["IncrementCounter"] = "counter_address inc_value";
functions["ReadNFCCounter"] = "value";
functions["ReadNFCCounterPwdAuth_RK"] = "value reader_key_index";
functions["ReadNFCCounterPwdAuth_PK"] = "value key";
functions["UfrSetBadSelectCardNrMax"] = "bad_select_nr_max";
functions["UfrGetBadSelectCardNrMax"] = "bad_select_nr_max";
functions["WriteEmulationNdef"] = "tnf type_record type_length id id_length payload payload_length";
functions["WriteEmulationNdefWithAAR"] = "tnf type_record type_length id id_length payload payload_length aar aar_length";
functions["TagEmulationStart"] = "";
functions["TagEmulationStop"] = "";
functions["SetDisplayData"] = "data data_length";
functions["EnterShareRamCommMode"] = "";
functions["ExitShareRamCommMode"] = "";
functions["WriteShareRam"] = "ram_data addr data_len";
functions["ReadShareRam"] = "ram_data addr data_len";
functions["AdHocEmulationStart"] = "";
functions["AdHocEmulationStop"] = "";
functions["GetExternalFieldState"] = "is_field_present";
functions["GetAdHocEmulationParams"] = "ThresholdMinLevel ThresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["SetAdHocEmulationParams"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["CombinedModeEmulationStart"] = "";
functions["r_block_transceive"] = "ack timeout rcv_length rcv_data_array rcv_chained ufr_status";
functions["s_block_deselect"] = "timeout";
functions["SetISO14443_4_Mode"] = "";
functions["UfrXrcLockOn"] = "pulse_duration";
functions["UfrXrcRelayState"] = "state";
functions["UfrXrcGetIoState"] = "intercom door relay_state";
functions["SetRfAnalogRegistersTypeA"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["SetRfAnalogRegistersTypeB"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["SetRfAnalogRegistersISO14443_212"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["SetRfAnalogRegistersISO14443_424"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["SetRfAnalogRegistersISO14443_424Default"] = "";
functions["SetRfAnalogRegistersISO14443_212Default"] = "";
functions["SetRfAnalogRegistersTypeBDefault"] = "";
functions["SetRfAnalogRegistersTypeADefault"] = "";
functions["GetRfAnalogRegistersISO14443_424"] = "ThresholdMinLevel ThresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["GetRfAnalogRegistersISO14443_212"] = "ThresholdMinLevel ThresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["GetRfAnalogRegistersTypeB"] = "ThresholdMinLevel ThresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["GetRfAnalogRegistersTypeA"] = "ThresholdMinLevel ThresholdCollLevel RFLevelAmp RxGain RFLevel";
functions["SetRfAnalogRegistersTypeATrans"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel CWGsNOn ModGsNOn CWGsP CWGsNOff ModGsNOff";
functions["SetRfAnalogRegistersTypeBTrans"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel CWGsNOn ModGsNOn CWGsP ModGsP";
functions["GetRfAnalogRegistersTypeBTrans"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel CWGsNOn ModGsNOn CWGsP ModGsP";
functions["GetRfAnalogRegistersTypeATrans"] = "TresholdMinLevel TresholdCollLevel RFLevelAmp RxGain RFLevel CWGsNOn ModGsNOn CWGsP CWGsNOff ModGsNOff";
functions["GreenLedBlinkingTurnOff"] = "";
functions["GreenLedBlinkingTurnOn"] = "";
functions["SetDisplayIntensity"] = "intensity";
functions["GetDisplayIntensity"] = "intensity";
functions["uart_transceive"] = "send_data_ send_len_ rcv_data bytes_to_receive_ rcv_len";
functions["card_transceive_mode_stop"] = "";
functions["card_transceive_mode_start"] = "tx_crc_ rx_crc_ rf_timeout_ uart_timeout";
functions["ReaderStillConnected"] = "connected";
functions["GetNfcT2TVersion"] = "lpucVersionResponse";
functions["SetOutput"] = "output";
developer27's avatar
developer27 committed

function load() {
developer27's avatar
developer27 committed

    var options = '';
    for (var key in functions) {
developer34's avatar
developer34 committed
        options += '<option class="opt" value="' + key + '" />'+ key +'</option>';
developer27's avatar
developer27 committed

    }
developer27's avatar
developer27 committed
    document.getElementById("lista").innerHTML = options;
developer27's avatar
developer27 committed

developer27's avatar
developer27 committed
    $('#lista').editableSelect(
        {

            filter: true,
              
            effects: 'slide',
          
            duration: 'fast',

            trigger: 'focus',
                     
          }
    );
developer27's avatar
developer27 committed
}

function change(event) {
    var input = document.getElementById("lista").value;
developer27's avatar
developer27 committed
    input = input.replace(/\s\s+/g, ' ');
developer27's avatar
developer27 committed
    var result = functions[input.trim().split(" ")[0]];
developer27's avatar
developer27 committed
    if (result == undefined) {
        document.querySelectorAll('.params').forEach(function(a) {
developer27's avatar
developer27 committed
           // 
      
          a.remove();
developer27's avatar
developer27 committed
          }) 
        document.getElementById("in").style.width = "30vw";
        //document.getElementById("arguments").innerHTML = "Unknown command";
developer27's avatar
developer27 committed
    }
developer27's avatar
developer27 committed
    else if (result == "") {
        document.querySelectorAll('.params').forEach(function(a) {
developer27's avatar
developer27 committed
           // 
        
           a.remove();
      
developer27's avatar
developer27 committed
          }) 
          document.getElementById("in").style.width = "30vw";
developer27's avatar
developer27 committed
    }
developer27's avatar
developer27 committed
    else {
developer27's avatar
developer27 committed
        var r = result.split(" ");
        var out = "";
        var i;
        var sp = input.split(" ");
developer27's avatar
developer27 committed
        document.querySelectorAll('.params').forEach(function(a) {
developer27's avatar
developer27 committed
           a.remove(); 
         

developer27's avatar
developer27 committed

developer27's avatar
developer27 committed
        var sum = 0;
developer27's avatar
developer27 committed
        for (i = 0; i < r.length; i++) {
developer27's avatar
developer27 committed
            var size= r[i].length;
            if(r[i]=="data")
developer27's avatar
developer27 committed
            {
developer27's avatar
developer27 committed
                size*=2;
developer27's avatar
developer27 committed
            }
developer27's avatar
developer27 committed
           
         
            var el = document.createElement("input");
            el.className ="params";
            if(r.length<=5)
developer27's avatar
developer27 committed
            {
developer27's avatar
developer27 committed
                sum += size+1;
                el.style.width =size+1  + "vw";
            }
      else if(r.length>7){
        sum += size/1.8+0.5;
developer27's avatar
developer27 committed
        el.style.width = size/1.7  + "vw";
developer27's avatar
developer27 committed
      }
      else {
        sum += size/1.2+1;
developer27's avatar
developer27 committed
        el.style.width = size/1.1  + "vw";
developer27's avatar
developer27 committed
      }
            el.style.marginLeft = "0.5vw";
            el.placeholder = r[i];
            document.getElementById("in").insertBefore(el, document.getElementById("send"));   
developer27's avatar
developer27 committed

        }
developer27's avatar
developer27 committed
  
developer27's avatar
developer27 committed
        var newWidth = sum + 33;
developer27's avatar
developer27 committed
        document.getElementById("in").style.width = newWidth+1 + "vw";
developer27's avatar
developer27 committed

       
developer27's avatar
developer27 committed
    }
developer34's avatar
developer34 committed
    
   if(input == "ReaderOpenEx___UDP")
   {
        var x = document.getElementsByClassName("params");
        x[0].value = '0';
        x[2].value = 'U';
        x[3].value = '0';
        x[0].disabled  = true;
        x[2].disabled  = true;
        x[3].disabled  = true;
   }
   else if(input == "ReaderOpenEx___TCP")
   {
        var x = document.getElementsByClassName("params");
        x[0].value = '0';
        x[2].value = 'T';
        x[3].value = '0';
        x[0].disabled  = true;
        x[2].disabled  = true;
        x[3].disabled  = true;
   }
   else if(input == "ReaderOpenEx___Bluetooth")
   {
        var x = document.getElementsByClassName("params");
        x[0].value = '2';
        x[2].value = '0';
        x[3].value = 'UNIT_OPEN_RESET_DISABLE';
        x[0].disabled  = true;
        x[2].disabled  = true;
        x[3].disabled  = true;
        
   } 
   else if(input == "ReaderOpenEx___Transparent")
   {
        var x = document.getElementsByClassName("params");
        x[0].value = '2';
        x[2].value = '0';
        x[3].value = 'UNIT_OPEN_RESET_DISABLE';
        x[0].disabled  = true;
        x[2].disabled  = true;
        x[3].disabled  = true;
   }

developer27's avatar
developer27 committed



}

function onclickbutton() {

developer27's avatar
developer27 committed
    var input = document.getElementById("lista").value;
    document.querySelectorAll('.params').forEach(function(a) {
          input += " " +  a.value;
developer27's avatar
developer27 committed
      }) 

            
       if(input.startsWith("ReaderOpenEx___UDP"))
       {
           input = input.replace("ReaderOpenEx___UDP", "ReaderOpenEx");
       }
       
       if(input.startsWith("ReaderOpenEx___TCP"))
       {
           input = input.replace("ReaderOpenEx___TCP", "ReaderOpenEx");
       }
 
       if(input.startsWith("ReaderOpenEx___Transparent"))
       {
           input = input.replace("ReaderOpenEx___Transparent", "ReaderOpenEx");
       }      
       
       if(input.startsWith("ReaderOpenEx___Bluetooth"))
       {
           input = input.replace("ReaderOpenEx___Bluetooth", "ReaderOpenEx");
       }      
           
developer27's avatar
developer27 committed

    ufRequest(input, function () {
		
		
        var output = ufResponse();
developer27's avatar
developer27 committed
        console.log(output);
developer27's avatar
developer27 committed
        var print = '';

        for (var key in output) {
            var o = output[key];
developer27's avatar
developer27 committed
            var widthI = o.length/1.3;
            if(key.startsWith("Status"))
            {
developer27's avatar
developer27 committed
                widthI = o.length/1.2;
developer27's avatar
developer27 committed
            }
developer34's avatar
developer34 committed
			if(o.length < 3)
			{
				widthI+=1;
			}
developer27's avatar
developer27 committed

 
            print +="<label>" +  key + ": </label><input type='text' readonly style='width:" + widthI  + "vw' value='" + o.replace(/\/\//g, "/") + "'></br>";
developer27's avatar
developer27 committed

        }
developer27's avatar
developer27 committed
        console.log(print);
		document.getElementById("out").innerHTML= print;
developer27's avatar
developer27 committed