Nein. Da ist nichts anders als bei anderen.
Was gibt unter "Skript testen"
Code: Alles auswählen
string a;system.Exec("grep -i f9d2 /firmware/rftypes/*",&a);WriteLine(a);
string a;system.Exec("ls /firmware/rftypes/*",&a);WriteLine(a);
Moderator: Co-Administratoren
Nein. Da ist nichts anders als bei anderen.
Code: Alles auswählen
string a;system.Exec("grep -i f9d2 /firmware/rftypes/*",&a);WriteLine(a);
string a;system.Exec("ls /firmware/rftypes/*",&a);WriteLine(a);
Code: Alles auswählen
/firmware/rftypes/hb-uni-sen-lev-us.xml: <parameter index="10.0" size="2.0" const_value="0xF9D2" />
/firmware/rftypes/hb-uni-sen-lev-us_e_v1_1.xml: <parameter index="10.0" size="2.0" const_value="0xF9D2" />
/firmware/rftypes/hb-uni-sen-lev-us_ge_v1_2.xml: <parameter index="10.0" size="2.0" const_value="0xF9D2" />
/firmware/rftypes/hb-cdl-6.xml
/firmware/rftypes/hb-dis-ep-42bw_e_v1_0.xml
/firmware/rftypes/hb-dis-ep-42bw_e_v1_1.xml
/firmware/rftypes/hb-dis-ep-42bw_e_v1_1_mains.xml
/firmware/rftypes/hb-dis-ep-75bw_e_1_0.xml
/firmware/rftypes/hb-dis-ep-75bw_mains_e_1_0.xml
/firmware/rftypes/hb-es-pmsw1-usb.xml
/firmware/rftypes/hb-gd-sw1-th-ts.xml
/firmware/rftypes/hb-ibut-8.xml
/firmware/rftypes/hb-ir-rcv-rc.xml
/firmware/rftypes/hb-lc-bl1-fm-bat.xml
/firmware/rftypes/hb-lc-bl1pbu-fm.xml
/firmware/rftypes/hb-lc-bl2-rd.xml
/firmware/rftypes/hb-lc-dim5pwm-cv.xml
/firmware/rftypes/hb-lc-sw12-fm.xml
/firmware/rftypes/hb-lc-sw1pbu-fm.xml
/firmware/rftypes/hb-lc-sw2-fm.xml
/firmware/rftypes/hb-lc-sw2pbu-fm.xml
/firmware/rftypes/hb-ou-af-sen-temp.xml
/firmware/rftypes/hb-ou-mot-fan-rpm.xml
/firmware/rftypes/hb-ou-mot-fan.xml
/firmware/rftypes/hb-ou-mot-servo.xml
/firmware/rftypes/hb-ou-mot-win.xml
/firmware/rftypes/hb-ou-mp3-led.xml
/firmware/rftypes/hb-ou-rgb-tealight-bat.xml
/firmware/rftypes/hb-ou-rgb-tealight.xml
/firmware/rftypes/hb-ou-rgbw-led-fx.xml
/firmware/rftypes/hb-rc-12-ep-bw.xml
/firmware/rftypes/hb-rc-12-ep-c.xml
/firmware/rftypes/hb-rc-2-pbu-led.xml
/firmware/rftypes/hb-rc-4-dis-th-crg.xml
/firmware/rftypes/hb-rc-4-dis-th.xml
/firmware/rftypes/hb-rc-4-touch.xml
/firmware/rftypes/hb-rc-6-pbu-led.xml
/firmware/rftypes/hb-rc-x-pos.xml
/firmware/rftypes/hb-sec-rhs-3.xml
/firmware/rftypes/hb-sw1-th-sc.xml
/firmware/rftypes/hb-uni-dmx-master_le_v10.xml
/firmware/rftypes/hb-uni-rgb-led-ctrl.xml
/firmware/rftypes/hb-uni-sen-cap-moist-t.xml
/firmware/rftypes/hb-uni-sen-cap-moist.xml
/firmware/rftypes/hb-uni-sen-current.xml
/firmware/rftypes/hb-uni-sen-dist-tof.xml
/firmware/rftypes/hb-uni-sen-dist-us.xml
/firmware/rftypes/hb-uni-sen-dummy-beacon-v2.xml
/firmware/rftypes/hb-uni-sen-dummy-beacon.xml
/firmware/rftypes/hb-uni-sen-dust.xml
/firmware/rftypes/hb-uni-sen-iaq.xml
/firmware/rftypes/hb-uni-sen-ldr-sc.xml
/firmware/rftypes/hb-uni-sen-lev-tof.xml
/firmware/rftypes/hb-uni-sen-lev-us.xml
/firmware/rftypes/hb-uni-sen-lev-us_e_v1_1.xml
/firmware/rftypes/hb-uni-sen-lev-us_ge_v1_2.xml
/firmware/rftypes/hb-uni-sen-pc-wm.xml
/firmware/rftypes/hb-uni-sen-pf-sc.xml
/firmware/rftypes/hb-uni-sen-ph-orp.xml
/firmware/rftypes/hb-uni-sen-ph.xml
/firmware/rftypes/hb-uni-sen-pool.xml
/firmware/rftypes/hb-uni-sen-press-sc.xml
/firmware/rftypes/hb-uni-sen-press.xml
/firmware/rftypes/hb-uni-sen-rfid-rc.xml
/firmware/rftypes/hb-uni-sen-temp-ir.xml
/firmware/rftypes/hb-uni-sen-temp-max6675-dt.xml
/firmware/rftypes/hb-uni-sen-temp-max6675.xml
/firmware/rftypes/hb-uni-sen-temp-sc.xml
/firmware/rftypes/hb-uni-sen-temp.xml
/firmware/rftypes/hb-uni-sen-volt.xml
/firmware/rftypes/hb-uni-sen-wea.xml
/firmware/rftypes/hb-uni-sen-wea_e_v12.xml
/firmware/rftypes/hb-uni-sen-wea_e_v13.xml
/firmware/rftypes/hb-uni-sen-wea_ge_v14.xml
/firmware/rftypes/hb-uni-sen-wea_le_v10.xml
/firmware/rftypes/hb-uni-sen-weight-sc.xml
/firmware/rftypes/hb-uni-sen-weight.xml
/firmware/rftypes/hb-uni-senact-4-4-rc-bat.xml
/firmware/rftypes/hb-uni-senact-4-4-rc.xml
/firmware/rftypes/hb-uni-senact-4-4-sc-bat.xml
/firmware/rftypes/hb-uni-senact-4-4-sc.xml
/firmware/rftypes/hb-uni-senact-8-8-rc-bat.xml
/firmware/rftypes/hb-uni-senact-8-8-rc.xml
/firmware/rftypes/hb-uni-senact-8-8-sc-bat.xml
/firmware/rftypes/hb-uni-senact-8-8-sc.xml
/firmware/rftypes/hb-wds40-thp-o.xml
/firmware/rftypes/hb_switch_tp.xml
/firmware/rftypes/rf_4dis.xml
/firmware/rftypes/rf_ao.xml
/firmware/rftypes/rf_ash550.xml
/firmware/rftypes/rf_bl.xml
/firmware/rftypes/rf_bl_644.xml
/firmware/rftypes/rf_bl_conf_644.xml
/firmware/rftypes/rf_bl_conf_644_e_v2_0.xml
/firmware/rftypes/rf_bl_conf_644_e_v2_1.xml
/firmware/rftypes/rf_bl_le_v2_3.xml
/firmware/rftypes/rf_cc_rt_dn.xml
/firmware/rftypes/rf_cc_rt_dn_bom.xml
/firmware/rftypes/rf_cc_tc.xml
/firmware/rftypes/rf_cc_tc_le_v1_9.xml
/firmware/rftypes/rf_cc_vd.xml
/firmware/rftypes/rf_central.xml
/firmware/rftypes/rf_cf.xml
/firmware/rftypes/rf_cfm.xml
/firmware/rftypes/rf_cfm_tw.xml
/firmware/rftypes/rf_cm.xml
/firmware/rftypes/rf_cmm.xml
/firmware/rftypes/rf_d.xml
/firmware/rftypes/rf_d_le_v1_7.xml
/firmware/rftypes/rf_d_le_v1_9.xml
/firmware/rftypes/rf_ddc.xml
/firmware/rftypes/rf_dim_1l_644.xml
/firmware/rftypes/rf_dim_1l_644_le_v2_4.xml
/firmware/rftypes/rf_dim_1pwm_644.xml
/firmware/rftypes/rf_dim_1pwm_644_le_v2_4.xml
/firmware/rftypes/rf_dim_1t_644.xml
/firmware/rftypes/rf_dim_1t_644_le_v2_4.xml
/firmware/rftypes/rf_dim_1t_dr.xml
/firmware/rftypes/rf_dim_1t_fm_lf.xml
/firmware/rftypes/rf_dim_1tconf_644.xml
/firmware/rftypes/rf_dim_1tconf_644_le_v2_4.xml
/firmware/rftypes/rf_dim_2l_644.xml
/firmware/rftypes/rf_dim_2l_644_le_v2_4.xml
/firmware/rftypes/rf_dim_2pwm.xml
/firmware/rftypes/rf_dim_2t_644.xml
/firmware/rftypes/rf_dim_2t_644_le_v2_4.xml
/firmware/rftypes/rf_dim_t.xml
/firmware/rftypes/rf_dim_t_le_v1_9.xml
/firmware/rftypes/rf_dis_ep_wm55.xml
/firmware/rftypes/rf_dis_ep_wm55_le_v1_0.xml
/firmware/rftypes/rf_dis_wm55.xml
/firmware/rftypes/rf_dw.xml
/firmware/rftypes/rf_em_8.xml
/firmware/rftypes/rf_em_8_bit.xml
/firmware/rftypes/rf_es_pmsw.xml
/firmware/rftypes/rf_es_pmsw_le_v2_4.xml
/firmware/rftypes/rf_es_tx_wm.xml
/firmware/rftypes/rf_es_tx_wm_ge_v2_0.xml
/firmware/rftypes/rf_es_tx_wm_le_v1_0.xml
/firmware/rftypes/rf_fs_ba.xml
/firmware/rftypes/rf_hm-wds100-c6-o-2.xml
/firmware/rftypes/rf_ja_conf_644.xml
/firmware/rftypes/rf_keymatic.xml
/firmware/rftypes/rf_ks550.xml
/firmware/rftypes/rf_oligo_smart_iq.xml
/firmware/rftypes/rf_ou_led16_ge_v1_1.xml
/firmware/rftypes/rf_ou_led16_le_v1_0.xml
/firmware/rftypes/rf_pb-2-wm55_ge_v1_4.xml
/firmware/rftypes/rf_pb-2-wm55_le_v1_3.xml
/firmware/rftypes/rf_pb-2.xml
/firmware/rftypes/rf_pbi.xml
/firmware/rftypes/rf_rc-4-2.xml
/firmware/rftypes/rf_rc-4-3_single_on.xml
/firmware/rftypes/rf_rc-key4-2.xml
/firmware/rftypes/rf_rc-sec4-2.xml
/firmware/rftypes/rf_rc.xml
/firmware/rftypes/rf_rc_12.xml
/firmware/rftypes/rf_rc_19.xml
/firmware/rftypes/rf_rc_2_fm.xml
/firmware/rftypes/rf_rc_dis.xml
/firmware/rftypes/rf_rc_single_on.xml
/firmware/rftypes/rf_rd.xml
/firmware/rftypes/rf_rd_le_v1_3.xml
/firmware/rftypes/rf_rep.xml
/firmware/rftypes/rf_resc_win_pcb_sc.xml
/firmware/rftypes/rf_rgbw.xml
/firmware/rftypes/rf_rhs.xml
/firmware/rftypes/rf_rhs_e_v1_7.xml
/firmware/rftypes/rf_rhs_le_v1_6.xml
/firmware/rftypes/rf_roto_wdf_solar.xml
/firmware/rftypes/rf_s.xml
/firmware/rftypes/rf_s550ia.xml
/firmware/rftypes/rf_s_1conf_644.xml
/firmware/rftypes/rf_s_1conf_644_le_v2_1.xml
/firmware/rftypes/rf_s_1conf_644_le_v2_3.xml
/firmware/rftypes/rf_s_2conf_644.xml
/firmware/rftypes/rf_s_4_ba.xml
/firmware/rftypes/rf_s_644.xml
/firmware/rftypes/rf_s_8_ba.xml
/firmware/rftypes/rf_s_ba.xml
/firmware/rftypes/rf_s_le_v1_5.xml
/firmware/rftypes/rf_s_le_v2_3.xml
/firmware/rftypes/rf_s_mega168.xml
/firmware/rftypes/rf_sc.xml
/firmware/rftypes/rf_sc_e_v1_7.xml
/firmware/rftypes/rf_sc_le_v1_6.xml
/firmware/rftypes/rf_scd_v1_0.xml
/firmware/rftypes/rf_sci_3.xml
/firmware/rftypes/rf_sec_mdir.xml
/firmware/rftypes/rf_sec_mdir_v1_5.xml
/firmware/rftypes/rf_sec_sco.xml
/firmware/rftypes/rf_sec_sd.xml
/firmware/rftypes/rf_sec_sd_2.xml
/firmware/rftypes/rf_sec_sd_schueco.xml
/firmware/rftypes/rf_sec_sfa.xml
/firmware/rftypes/rf_sec_sir_wm.xml
/firmware/rftypes/rf_sen_db.xml
/firmware/rftypes/rf_sen_ep.xml
/firmware/rftypes/rf_sen_li.xml
/firmware/rftypes/rf_sen_mdir.xml
/firmware/rftypes/rf_sen_mdir_v1_5.xml
/firmware/rftypes/rf_sen_mdir_wm55.xml
/firmware/rftypes/rf_sen_wa_od.xml
/firmware/rftypes/rf_st_6_sh.xml
/firmware/rftypes/rf_swi.xml
/firmware/rftypes/rf_tc_it_wm-w-eu.xml
/firmware/rftypes/rf_tis.xml
/firmware/rftypes/rf_tis_le_v1_0.xml
/firmware/rftypes/rf_wds30_ot2.xml
/firmware/rftypes/rf_wds40_th_i_2.xml
/firmware/rftypes/rf_wds_v1_0.xml
/firmware/rftypes/rf_wds_v1_1.xml
/firmware/rftypes/rf_winmatic.xml
/firmware/rftypes/rf_ws550.xml
/firmware/rftypes/replaceMap:
rfReplaceMap.xml
Code: Alles auswählen
string show_devices_w_serial_starting_with = ""; ! leave empty for no filtering
string hide_devices_w_serial_containing = ""; ! leave empty for no filtering
object oUser = dom.GetObject( system.GetSessionVar('sessionUserID') );
oUser.UserTempViewIDs3().RemoveAll();
string o;
string hexAddress;
string err;
string metaData;
string data;
boolean hide_flt=false;
if (hide_devices_w_serial_containing == "") { hide_flt = true; }
foreach (o, root.Devices().EnumUsedIDs()) {
var dev = dom.GetObject(o);
var name = dev.Name();
var addr = dev.Address();
var iface = dom.GetObject(dev.Interface());
if ((iface.Name() == "BidCos-RF") &&
(addr.Length() == 10) &&
(addr.StartsWith(show_devices_w_serial_starting_with)) &&
(addr.Contains(hide_devices_w_serial_containing) == hide_flt)) {
metaData = dev.MetaData("DEVDESC");
foreach (data, metaData.Split(",")) {
if (data.Substr(0,8) == "FIRMWARE") {
string fw = data.Replace("FIRMWARE:\"","");
fw = fw.Substr(0,fw.Length() -1);
}
if (data.Substr(0,10) == "RF_ADDRESS") {
string decimalAddress = data.Replace("RF_ADDRESS:","");
if (decimalAddress != "0") {
string cmd = "printf '000000%x' "#decimalAddress;
system.Exec(cmd, &hexAddress, &err);
hexAddress = hexAddress.Substr(hexAddress.Length()-6, 6).ToUpper();
string formattedhexAddress = "{ 0x"#hexAddress.Substr(0,2)#", 0x"#hexAddress.Substr(2,2)#", 0x"#hexAddress.Substr(4,2)#" }";
string decimalAddressFixed = "00000000"#decimalAddress;
decimalAddressFixed = decimalAddressFixed.Substr(decimalAddressFixed.Length()-8, 8);
object oObj = dom.CreateObject(OT_XMLNODE);
oObj.Name(decimalAddressFixed);
oObj.AddMetaData("NAME", dev.Name());
oObj.AddMetaData("HEX", formattedhexAddress);
oObj.AddMetaData("ADDR", addr);
oObj.AddMetaData("FW", fw);
oUser.UserTempViewIDs3().Add(oObj.ID());
}
}
}
}
}
oUser.UserTempViewIDs3().SortByName();
string uid;
string rfaddresslist = "";
foreach (uid, oUser.UserTempViewIDs3().EnumIDs()) {
object o = dom.GetObject(uid);
rfaddresslist = rfaddresslist # o.MetaData("HEX")#" = "#o.MetaData("ADDR")#", FW: "#o.MetaData("FW")#" ("#o.MetaData("NAME")#")\n";
dom.DeleteObject(o);
}
Write(rfaddresslist);