|
@@ -83,7 +83,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
[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();
|
|
@@ -146,7 +146,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
[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();
|
|
@@ -376,7 +376,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
[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();
|
|
@@ -394,7 +394,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
//check parameter
|
|
|
|
|
|
|
|
|
- if (StartTransaction == null
|
|
|
+ if (StartTransaction == null
|
|
|
|| (StartTransaction.ConnectorId.HasValue && (chargePointService.GetNumberofConnectors(ChargeBoxId) < StartTransaction.ConnectorId || StartTransaction.ConnectorId < 0)) || string.IsNullOrEmpty(StartTransaction.IdTag) || StartTransaction.IdTag.Length > 20)
|
|
|
{
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Code = 2100, Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
|
|
@@ -429,11 +429,11 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
}
|
|
|
|
|
|
|
|
|
- ChargePointStatus? currentStatus = StartTransaction.ConnectorId.HasValue?chargePointService.GetChargePointCurrentSatus(ChargeBoxId, StartTransaction.ConnectorId.Value).Value: (ChargePointStatus?)null;
|
|
|
+ ChargePointStatus? currentStatus = StartTransaction.ConnectorId.HasValue ? chargePointService.GetChargePointCurrentSatus(ChargeBoxId, StartTransaction.ConnectorId.Value).Value : (ChargePointStatus?)null;
|
|
|
+
|
|
|
|
|
|
-
|
|
|
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 });
|
|
|
}
|
|
@@ -441,6 +441,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
{
|
|
|
var _request = new RemoteStartTransactionRequest()
|
|
|
{
|
|
|
+
|
|
|
connectorId = StartTransaction.ConnectorId,
|
|
|
idTag = StartTransaction.IdTag,
|
|
|
chargingProfile = StartTransaction.ChargingProfile == null ? null :
|
|
@@ -520,7 +521,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
|
|
|
var _ConnectorStatus = chargePointService.GetChargePointCurrentSatus(ChargeBoxId, _ConnectorId);
|
|
|
|
|
|
- if (!(_ConnectorStatus.HasValue && _ConnectorStatus == ChargePointStatus.Charging))
|
|
|
+ if (!(_ConnectorStatus.HasValue && _ConnectorStatus == ChargePointStatus.Charging || _ConnectorStatus == ChargePointStatus.SuspendedEVSE || _ConnectorStatus == ChargePointStatus.SuspendedEV))
|
|
|
{
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Code = 2105, Message = EVCBConfiguration.ERROR_MSG_CONNECTOR_ISNOT_CHARGING_MODE });
|
|
@@ -781,7 +782,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
[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();
|
|
@@ -795,6 +796,13 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
|
|
|
return Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse() { Code = 2101, Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
|
|
|
}
|
|
|
+ if (LocalList != null && !LocalList.UpdateType.HasValue)
|
|
|
+ {
|
|
|
+ if (!LocalList.UpdateType.HasValue)
|
|
|
+ {
|
|
|
+ LocalList.UpdateType = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//check parameter
|
|
|
if (LocalList == null ||
|
|
@@ -867,7 +875,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
[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();
|
|
@@ -975,7 +983,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
|
|
|
[ResponseType(typeof(ErrorResponse))]
|
|
|
[ResponseType(typeof(InternalGenericResponse))]
|
|
|
[HttpPost]
|
|
|
- public HttpResponseMessage SetChargingProfile(string ChargeBoxId, [FromBody]ChargingProfileRequest ChargingProfile)
|
|
|
+ public HttpResponseMessage SetChargingProfile(string ChargeBoxId, [FromBody] ChargingProfileRequest ChargingProfile)
|
|
|
{
|
|
|
|
|
|
|