3.15 Clear Charging profile

The ClearChargingProfile message in OCPP 1.6J is sent by the central system to remove a specific charging profile from the charge point using its charging profile ID. The charge point responds to confirm whether the profile was successfully cleared or if an error occurred. This helps manage and update charging settings remotely.

API Syntax

Description

Input Params

Return Value

SendClearChargingProfileResponse

This function sends the ClearChargingProfile response by creating an OCPP reply frame and passing it to the sendFrameToCMS function.

void

int

Example:

    if (DeleteProfile(&clearProfile) == 0)
    {
      SetClearChargingProfileStatus(CLEAR_CHARGING_PROFILE_ACCEPTED);
    }
    else
    {
      SetClearChargingProfileStatus(CLEAR_CHARGING_PROFILE_UNKNOWN);
    }
    (void)SendClearChargingProfileResponse();
    /* ClearChargingProfile(clearProfile); */
  }
  break;

API Syntax

Description

Input Params

Return Value

GetClearChargingProfileParams

This function copies the parameters from the global RXClearChargingProfile structure to the provided Params structure.

RX_CLEARCHARGINGPROFILE_T *params

void

Example:

  case CLEAR_CHARGING_PROFILE:
  {
    RX_CLEARCHARGINGPROFILE_T clearProfile;
    GetClearChargingProfileParams(&clearProfile);
    LogDebug("APP_LOG", "UUID: %s\n", clearProfile.uuid);
    LogDebug("APP_LOG", "ID: %u\n", clearProfile.id);
    LogDebug("APP_LOG", "Connector ID: %u\n", clearProfile.connectorId);
    LogDebug("APP_LOG", "Charging Profile Purpose: %s\n", GetChargingProfilePurposeTypeArr(clearProfile.chargingProfilePurpose));
    LogDebug("APP_LOG", "Stack Level: %u\n", clearProfile.stackLevel);
    if (DeleteProfile(&clearProfile) == 0)
    {
      SetClearChargingProfileStatus(CLEAR_CHARGING_PROFILE_ACCEPTED);
    }
    else
    {
      SetClearChargingProfileStatus(CLEAR_CHARGING_PROFILE_UNKNOWN);
    }
    (void)SendClearChargingProfileResponse();
    /* ClearChargingProfile(clearProfile); */
  }
  break;

Syntax

Description

Input Params

Return Value

SetClearChargingProfileStatus

This function sets the status of the ClearChargingProfile response based on the provided status code.

CLEAR_CHARGING_PROFILE_STATUS_T status

void

Example:

if (DeleteProfile(&clearProfile) == 0)
    {
      SetClearChargingProfileStatus(CLEAR_CHARGING_PROFILE_ACCEPTED);
    }
    else
    {
      SetClearChargingProfileStatus(CLEAR_CHARGING_PROFILE_UNKNOWN);
    }
    (void)SendClearChargingProfileResponse();
    /* ClearChargingProfile(clearProfile); */

API Syntax

Description

Input Params

Return Value

ClearChargingProfileInit

This function initializes the ClearChargingProfile response status to a default value, typically CLEAR_CHARGING_PROFILE_UNKNOWN.

void

void

Example:

void OCPPMessagesInit(void)
{
    DataTransferInit();
    ResetInit();
    MeterValueStructInit();
    SetLocalListVersionNumber(DEFAULT_SEND_LOCAL_LIST_VERSION);   
    SetChargePointConnectorId(CHARGEPOINT_DEFAULT_CONTROLLER);
    ChargePointStatusInit();
    (void)SetAuthorizeStatus(AUTHORIZE_INVALID);
    SetOCPPWebsocketOnlineMode();
    UnlockConnectorInit();
    ReserveNowInit();
    ChangeAvailabilityInit();
    ClearCacheInit();
    ChangeConfigurationInit();
    CancelReservationInit();
    GetAllIDsFromDB();
    CheckAndStartClockAlignedMeterValueTimer();
    ClearChargingProfileInit();
    GetCompositeScheduleInit();
    GetLocalListVersionInit();
    SendLocalListInit();
    SetChargingProfileInit();
    TriggerMessageInit();
    RemoteStopTransactionInit();
    RemoteStartTransactionInit();
}
       	 

API Syntax

Description

Constants/Members

CLEARCHARGINGPROFILE_RESPONSE_T

Structure to hold the ClearChargingProfile response

CLEAR_CHARGING_PROFILE_STATUS_T status;

RX_CLEARCHARGINGPROFILE_T

Structure to hold the received ClearChargingProfile parameters

char uuid[];

uint16_t id;

int connectorId;

CHARGING_PROFILE_PURPOSE_TYPE_T chargingProfilePurpose;

uint8_t stackLevel;

CLEAR_CHARGING_PROFILE_STATUS_T

Enumeration for ClearChargingProfile status types

CLEAR_CHARGING_PROFILE_ACCEPTED

CLEAR_CHARGING_PROFILE_UNKNOWN