using System;
using System.Collections.Generic;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol;
using Xylem.Common.Hardware.WaterMeter.Genesis.Applications;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.Consts;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
{
///
/// Interface of special GenesisMeter derived from IMeter
///
public interface IGenesisMeter : IMeter
{
#region properties
///
/// Represent
/// proposed for login
///
String PcbId
{
get;
}
///
/// Transmit protocol access for underlie objects to change response timeout
///
ITransmitProtocol TransmitProtocol{ get; }
///
/// List of all present meter applications installed in meter
///
List MeterAppListVersion
{
get;
}
///
/// Successfully logged on to meter
///
Boolean IsLoggedOn
{
get;
}
///
/// Core revision of boot code.
///
Int32? CoreRevision
{
get;
}
///
/// Core revision of boot code as string.
///
String StrCoreRevision
{
get;
}
///
/// This is the FLEXNETVERSION version which describes the entire packet.
///
String FwVersion
{
get;
}
///
/// This is the FLEXNETVERSION version which describes the entire packet.
///
UInt32? InstalledFwVersion
{
get;
}
///
/// This is the Metrology Lookup Table CRC.
///
String LutCrc
{
get;
}
///
/// This is the meter size.
///
String MeterSize
{
get;
}
///
/// This is the version of the interface "configuration.json".
///
String InterfaceVersion
{
get;
}
///
/// This is the max supported firmware version of the interface "configuration.json".
/// It is the max version for a specific region.
///
String InterfaceMaxFwVersion
{
get;
}
///
/// This FW version is supported by the interface "configuration.json".
///
Boolean InterfaceSupportsFwVersion
{
get;
}
///
/// Length of the meter.
///
String MeterLength { get; set; }
///
/// Pressure sensor assembled to meter.
///
Boolean PressureSensorAssembled
{
get;
}
///
/// Region (EMEA, NA or China).
///
String Region
{
get;
}
///
/// Radio frequency in MHz (433 or 868 or null).
///
Int32? RadioFrequencyMhz
{
get;
}
///
/// Metrology upgrade permission.
///
Byte MetrologyUpgradePermission
{
set; get;
}
///
/// Order number under which this meter has to be produced
///
Int32 OrderNumber
{
set; get;
}
///
/// Radio address
///
Int64 RadioAddress
{
set; get;
}
///
/// Process configuration
///
ProcessConfig Configuration
{
get;
}
///
/// Customer serial number for informal issues
///
String CustomerSerialNumber
{
get; set;
}
#endregion
#region methods
///
/// Check region and size.
/// After reading the version, all valid registers are going to be selected.
///
void CheckRegionSizeLutCrc();
///
/// Reset the empty pipe alarm
///
void ResetAlarm(Alarm clear);
///
/// Upload app list to database
///
///
///
///
StatusReturn PushProgress(String progressName, String version);
///
/// Clear password to force new password reading
///
void ClearPassword();
///
/// Executes all StoreConfiguration and StoreCalibration for each application.
///
/// true if all configurations are stored
Boolean StoreAllConfigurations();
///
/// Login with identical password as last time to avoid get password from database
///
Boolean ReLogin();
///
/// Returns meter registers
///
///
MeterRegisters GetConfigRegistersDefinitions();
///
/// Common routine for reboot being able to override this routine which will be called in
/// MeteResetPsu to simulate a reboot.
///
///
StatusReturn RebootGenesis();
///
/// Write Register, optional: wait for result and validate,
/// write register will ALWAYS log the data DON'T use for password write
///
/// Data type of Register
/// Register name
/// Value to save as byte array in raw format
/// wait until result is ready
/// check the content of the register by read back
/// skip retries on this error code return
/// true on successful operation
Boolean WriteRegister(String regName, T value, Boolean waitForResult = true,
Boolean checkRegister = false, UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode);
///
/// Read Register and return byte array
///
/// Register name
/// expected length for response
/// skip retries on this error code return
/// value as byte array in raw format or null
Byte[] ReadRegister(String regName, Int32? expectedLength = null,
UInt16 skipRetryErrorCode = CommunicationConfig.SkipRetryErrorCode);
#endregion
}
}