/// <summary> /// Creates the set request file for tariff. /// </summary> /// <param name="portId">The port id.</param> /// <param name="bitMask">The bit mask.</param> /// <param name="tariffAplus">The tariff aplus.</param> /// <param name="tarrifAminus">The tarrif aminus.</param> /// <returns>The request file to set the tariffs and bitmask.</returns> public static SmlFile CreateSetRequestFileForTariff( string portId, UnsignedParam bitMask, UnsignedParam tariffAplus, UnsignedParam tarrifAminus) { var handler = new SmlHandler(portId); var smlFile = new SmlFile(); handler.AddOpenRequest(smlFile); handler.AddSetBooleanParamRequest( smlFile, new BooleanParam() { ObisCode = (long)ObisId.EdlOperationModeEdl40, Data = false }); handler.AddSetUnsignedParamRequest(smlFile, bitMask); if (tariffAplus != null) { handler.AddSetUnsignedParamRequest(smlFile, tariffAplus); } if (tarrifAminus != null) { handler.AddSetUnsignedParamRequest(smlFile, tarrifAminus); } handler.AddCloseRequest(smlFile); return smlFile; }
/// <summary> /// Creates the set request file. /// </summary> /// <param name="portId">The port id.</param> /// <param name="param">The param.</param> /// <returns></returns> public static SmlFile CreateSetRequestFile(string portId, UnsignedParam param) { var handler = new SmlHandler(portId); var smlFile = new SmlFile(); handler.AddOpenRequest(smlFile); handler.AddSetUnsignedParamRequest(smlFile, param); handler.AddCloseRequest(smlFile); return smlFile; }