|
@@ -86,7 +86,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
[ResponseType(typeof(ErrorResponse))]
|
|
|
[ResponseType(typeof(InternalGenericResponse))]
|
|
|
[HttpPut]
|
|
|
- public HttpResponseMessage Availability(string ChargeBoxId, [FromBody]AvailiabilityRequest Availiability)
|
|
|
+ public HttpResponseMessage Availability(string ChargeBoxId, [FromBody] AvailiabilityRequest Availiability)
|
|
|
{
|
|
|
string uuid = Guid.NewGuid().ToString();
|
|
|
var result = new InternalGenericResponse();
|
|
@@ -149,7 +149,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
[ResponseType(typeof(ErrorResponse))]
|
|
|
[ResponseType(typeof(InternalGenericResponse))]
|
|
|
[HttpPut]
|
|
|
- public HttpResponseMessage ChargeBoxConfiguration(string ChargeBoxId, [FromBody]SingleConfigurationRequest SingleConfiguration)
|
|
|
+ public HttpResponseMessage ChargeBoxConfiguration(string ChargeBoxId, [FromBody] SingleConfigurationRequest SingleConfiguration)
|
|
|
{
|
|
|
string uuid = Guid.NewGuid().ToString();
|
|
|
var result = new InternalGenericResponse();
|
|
@@ -379,7 +379,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
[ResponseType(typeof(ErrorResponse))]
|
|
|
[ResponseType(typeof(InternalGenericResponse))]
|
|
|
[HttpPost]
|
|
|
- public HttpResponseMessage StartTransaction(string ChargeBoxId, [FromBody]StartTransactionRequest StartTransaction)
|
|
|
+ public HttpResponseMessage StartTransaction(string ChargeBoxId, [FromBody] StartTransactionRequest StartTransaction)
|
|
|
{
|
|
|
string uuid = Guid.NewGuid().ToString();
|
|
|
var result = new InternalGenericResponse();
|
|
@@ -434,7 +434,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
var currentStatus = chargePointService.GetChargePointCurrentSatus(ChargeBoxId, StartTransaction.ConnectorId.Value).Value;
|
|
|
|
|
|
if (StartTransaction.ConnectorId.HasValue && chargePointService.GetChargePointCurrentSatus(ChargeBoxId, StartTransaction.ConnectorId.Value).HasValue &&
|
|
|
- (currentStatus != ChargePointStatus.Available && currentStatus != ChargePointStatus.Reserved && currentStatus != ChargePointStatus.Preparing ))
|
|
|
+ (currentStatus != ChargePointStatus.Available && currentStatus != ChargePointStatus.Reserved && currentStatus != ChargePointStatus.Preparing))
|
|
|
{
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Code = 2103, Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_AVAILIABLE_MODE });
|
|
|
}
|
|
@@ -782,7 +782,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
[ResponseType(typeof(ErrorResponse))]
|
|
|
[ResponseType(typeof(InternalGenericResponse))]
|
|
|
[HttpPost]
|
|
|
- public HttpResponseMessage SendLocalList(string ChargeBoxId, [FromBody]LocalListRequest LocalList)
|
|
|
+ public HttpResponseMessage SendLocalList(string ChargeBoxId, [FromBody] LocalListRequest LocalList)
|
|
|
{
|
|
|
string uuid = Guid.NewGuid().ToString();
|
|
|
var result = new InternalGenericResponse();
|
|
@@ -868,7 +868,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
[ResponseType(typeof(ErrorResponse))]
|
|
|
[ResponseType(typeof(InternalGenericResponse))]
|
|
|
[HttpPost]
|
|
|
- public HttpResponseMessage SendDataTransfer(string ChargeBoxId, string VenderId, [FromBody]string Data, string MessageId = "")
|
|
|
+ public HttpResponseMessage SendDataTransfer(string ChargeBoxId, string VenderId, [FromBody] string Data, string MessageId = "")
|
|
|
{
|
|
|
string uuid = Guid.NewGuid().ToString();
|
|
|
var result = new InternalGenericResponse();
|
|
@@ -976,7 +976,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
[ResponseType(typeof(ErrorResponse))]
|
|
|
[ResponseType(typeof(InternalGenericResponse))]
|
|
|
[HttpPost]
|
|
|
- public HttpResponseMessage SetChargingProfile(string ChargeBoxId, [FromBody]ChargingProfileRequest ChargingProfile)
|
|
|
+ public HttpResponseMessage SetChargingProfile(string ChargeBoxId, [FromBody] ChargingProfileRequest ChargingProfile)
|
|
|
{
|
|
|
|
|
|
|
|
@@ -997,9 +997,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
if (ChargingProfile == null ||
|
|
|
ChargingProfile.connectorId < 0 ||
|
|
|
!(ChargingProfile.ChargingProfile != null && IsValidEnum<ChargingProfileKindType>((int)ChargingProfile.ChargingProfile.chargingProfileKind)) ||
|
|
|
- !(ChargingProfile.ChargingProfile != null && ChargingProfile.ChargingProfile.recurrencyKind.HasValue && IsValidEnum<RecurrencyKindType>((int)ChargingProfile.ChargingProfile.recurrencyKind)) ||
|
|
|
- !(ChargingProfile.ChargingProfile != null && ChargingProfile.ChargingProfile.recurrencyKind.HasValue && IsValidEnum<RecurrencyKindType>((int)ChargingProfile.ChargingProfile.recurrencyKind)) ||
|
|
|
- !(ChargingProfile.ChargingProfile != null && IsValidEnum<ChargingProfilePurposeType>((int)ChargingProfile.ChargingProfile.chargingProfilePurpose)) ||
|
|
|
+ !(ChargingProfile.ChargingProfile != null && IsValidEnum<ChargingProfilePurposeType>((int)ChargingProfile.ChargingProfile.chargingProfilePurpose)) ||
|
|
|
!(ChargingProfile.ChargingProfile != null && ChargingProfile.ChargingProfile.chargingSchedule != null && IsValidEnum<ChargingRateUnitType>((int)ChargingProfile.ChargingProfile.chargingSchedule.chargingRateUnit)))
|
|
|
{
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Code = 2100, Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
@@ -1020,7 +1018,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
|
|
|
chargingProfilePurpose = ChargingProfile.ChargingProfile.chargingProfilePurpose,
|
|
|
recurrencyKind = ChargingProfile.ChargingProfile.recurrencyKind,
|
|
|
stackLevel = ChargingProfile.ChargingProfile.stackLevel,
|
|
|
- transactionId = ChargingProfile.ChargingProfile.TransactionId,
|
|
|
+ transactionId = ChargingProfile.ChargingProfile.SessionId,
|
|
|
validFrom = ChargingProfile.ChargingProfile.validFrom == null ? (DateTime?)null : DateTime.SpecifyKind(ChargingProfile.ChargingProfile.validFrom.Value, DateTimeKind.Utc),
|
|
|
validTo = ChargingProfile.ChargingProfile.validTo == null ? (DateTime?)null : DateTime.SpecifyKind(ChargingProfile.ChargingProfile.validTo.Value, DateTimeKind.Utc),
|
|
|
chargingSchedule = new ChargingSchedule()
|