3.10 Status Notification
The StatusNotification message in OCPP 1.6J updates the central system about the status of a charge point or its connectors. It reports states like Available, Occupied, Charging, Faulted or Unavailable, along with the connector ID. This helps the central system monitor and manage the charge point’s availability and condition.
|
API Syntax |
Description |
Input Params |
Return Value |
|---|---|---|---|
SendStatusNotificationRequest | Sends a StatusNotification request to the server. Creates an OCPP frame for the request and sends it using “sendframe”. | void | STATUSNOTIFICATIONERROR_T |
Example:
case TRIGGER_MESSAGE_TYPE_STATUS_NOTIFICATION:
(void)SendStatusNotificationRequest();
break;
|
API Syntax |
Description |
Input Params |
Return Value |
|---|---|---|---|
SetChargePointError | Sets the current charge point error code. | CHARGEPOINT_ERRORCODE_T error | void |
Example:
void ReservationTimeoutCallback(size_t timerId, void *userData)
{
(void)timerId;
(void)userData;
SetChargePointError(NOERROR);
SetChargePointStatus(AVAILABLE);
SetChargePointConnectorId(rxReserveNow.connectorId);
SendStatusNotificationRequest();
}
|
API Syntax |
Description |
Input Params |
Return Value |
|---|---|---|---|
SetChargePointStatus | Sets the current charge point status. | CHARGEPOINT_STATUS_T status | void |
Example:
void ConnectionTimeoutCallback(size_t timerId, void *userData)
{
(void)timerId;
(void)userData;
SetChargePointError(NOERROR);
SetChargePointStatus(AVAILABLE);
SendStatusNotificationRequest();
}
|
API Syntax |
Description |
Input Params |
Return Value |
|---|---|---|---|
ChargePointStatusInit | Initializes the charge point status notification with default values. | void | void |
Example:
void OCPPMessagesInit(void)
{
DataTransferInit();
ResetInit();
MeterValueStructInit();
SetLocalListVersionNumber(DEFAULT_SEND_LOCAL_LIST_VERSION);
SetChargePointConnectorId(CHARGEPOINT_DEFAULT_CONTROLLER);
ChargePointStatusInit();
SetAuthorizeStatus(AUTHORIZE_INVALID);
SetOCPPWebsocketOnlineMode();
UnlockConnectorInit();
ReserveNowInit();
ChangeAvailabilityInit();
ClearCacheInit();
|
API Syntax |
Description |
Input Params |
Return Value |
|---|---|---|---|
GetChargePointStatus | Retrieves the current charge point status description. | char *str | void |
Example:
if (check != 1U)
{
char chargePointStatus[CHARGE_POINT_STATUS_SIZE];
GetChargePointStatus(chargePointStatus);
if((strncmp(chargePointStatus, "Charging", strlen(chargePointStatus)) == 0 ) || (remoteStartStatus == REMOTE_START_STOP_ACCEPTED))
{
LogDebug("APP_LOG", " Second Remote Start Transaction rejected \n");
SetRemoteStartTransactionStatus(REMOTE_START_STOP_REJECTED);
(void)SendRemoteStartTransactionResponse();
}
|
API Syntax |
Description |
Input Params |
Return Value |
|---|---|---|---|
GetChargePointError | Retrieves the current charge point error description. | char *str | void |
Example:
GetChargePointError(error_string);
GetChargePointStatus(status_string);
|
Syntax |
Description |
Constants/Members |
|---|---|---|
|
STATUSNOTIFICATION_T |
Structure to hold status notification information |
u_int32_t connectorId; CHARGEPOINT_ERRORCODE_T chargePointError; CHARGEPOINT_STATUS_T chargePointStatus; char info[CISTRING_50TYPE_LENGTH]; dateTime timestamp; char vendorId[]; char vendorError[]; |
|
CHARGEPOINT_ERRORCODE_T |
Enumeration for charge point error codes |
CONNECTORLOCKFAILURE EVCOMMUNICATIONERROR GROUNDFAILURE HIGHTEMPERATURE INTERNALERROR LOCALLISTCONFLICT NOERROR OTHERERROR OVERCURRENTFAILURE OVERVOLTAGE POWERMETERFAILURE RESPOWERSWITCHFAILUREET READERFAILURE RESETFAILURE UNDERVOLTAGE WEAKSIGNAL |
|
CHARGEPOINT_STATUS_T |
Enumeration for charge point statuses |
AVAILABLE PREPARING CHARGING SUSPENDEDEVSE SUSPENDEDEV FINISHING RESERVED UNAVAILABLE FAULTED |
|
STATUSNOTIFICATIONERROR_T |
Enumeration for status notification errors |
STATUSNOTIFICATION_SUCCESS STATUSNOTIFICATION_FAILED STATUSNOTIFICATION_RESPONSE_FAILED, STATUSNOTIFICATION_RESPONSE_ACCEPT_FAILED, STATUSNOTIFICATION_RESPONSE_SUCCESS |
