public object GetRealData() { IfType x = FactoryType.CreateType(GetDataType());//(m_packet.getDataType()); object res = x.getRealData(m_packet.getData()); return(res); }
public string GetRealDataToString() { IfType x = FactoryType.CreateType(GetDataType());//(m_packet.getDataType()); string res = x.ToStringRealData(m_packet.getData()); return(res); }
public async Task <bool> SaveRealDataToDbAsync(string adress) { Packet.DataType type = GetDataType(); IfType x = FactoryType.CreateType(type); return(await x.SaveToDbAsync(m_packet.getData(), "127.0.0.1")); }
// <summary> // check length of date with length // </summary> public bool checkLengthOfData() { byte[] data = GetData(); IfType x = FactoryType.CreateType((Packet.DataType)GetDataType()); int type_len = x.getFieldLength(); return(type_len == data.Length); }
public override Packet.PacketType createWrite(byte[] hexAddress, Packet.DataType type, string strData) { //byte[] addr = Packet.HexNiblleToAsciiByte(hexAddress); int lenRaw = strData.Length / 2; IfType x = FactoryType.CreateType(type); byte[] type_ascii = x.setFieldType(); byte[] data_ascii = x.setFieldData(strData); //m_packet = new Packet(Packet.PacketType.Read, Packet.DataType.Merenja, data_ascii, 0x01); return(Packet.PacketType.Write); }
public override Packet.PacketType createRead(byte idDest, Packet.DataType command) { IfType x = FactoryType.CreateType(command); byte[] command_data = x.setFieldType(); byte[] data = x.setFieldData("0"); // m_packet = new Packet(Packet.PacketType.Read, command_data, data, idDest); return(Packet.PacketType.Read); }
public override Packet.PacketType createWrite(byte[] hexAddress, Packet.DataType type, byte[] hexData) { // byte[] addr = Packet.HexNiblleToAsciiByte(hexAddress); //byte[] data = Packet.HexNiblleToAsciiByte(hexData); IfType x = FactoryType.CreateType(type); byte[] type_ascii = x.setFieldType(); // m_packet = new Packet(Packet.PacketType.Read, Packet.DataType.Merenja, data, 0x01); return(Packet.PacketType.Write); }
public bool checkMinMax(Packet.DataType type, string input, string min, string max) { IfType x = FactoryType.CreateType(type); return(x.checkMinMax(input, min, max)); }
public bool checkPattern(Packet.DataType type, string text) { IfType x = FactoryType.CreateType(type); return(x.checkStringPattern(text)); }