|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
OCPP Charge Point Implementation. More...
Data Structures | |
| union | ocpp_io_value |
| OCPP user callback notification/request of input/output values union member should be accessed with enum value ocpp_notify_reason correspondingly. More... | |
| struct | ocpp_cp_info |
| Parameters for ocpp_init information about Charge Point (CP) all are string literal except num_of_con. More... | |
| struct | ocpp_tls_credentials |
| TLS credentials information of the central system (CS). More... | |
| struct | ocpp_cs_info |
| Parameters for ocpp_init information about central system (CS). More... | |
Macros | |
| #define | CISTR50 50 |
| Max length of string literals e.g idtag. | |
Typedefs | |
| typedef void * | ocpp_session_handle_t |
| Parameters opaque session handle for ocpp_* API. | |
| typedef int(* | ocpp_user_notify_callback_t) (enum ocpp_notify_reason reason, union ocpp_io_value *io, void *user_data) |
| Asynchronous event notification callback registered by the application. | |
Functions | |
| int | ocpp_init (struct ocpp_cp_info *cpi, struct ocpp_cs_info *csi, ocpp_user_notify_callback_t cb, void *user_data) |
| OCPP library init. | |
| int | ocpp_session_open (ocpp_session_handle_t *hndl) |
| API to request a new Session. | |
| void | ocpp_session_close (ocpp_session_handle_t hndl) |
| API to close a Session. | |
| int | ocpp_authorize (ocpp_session_handle_t hndl, char *idtag, enum ocpp_auth_status *status, uint32_t timeout_ms) |
| Authorize request call to CS to get validity of idtag. | |
| int | ocpp_start_transaction (ocpp_session_handle_t hndl, int meter_val, uint8_t conn_id, uint32_t timeout_ms) |
| Notify transaction start to CS. | |
| int | ocpp_stop_transaction (ocpp_session_handle_t hndl, int meter_val, uint32_t timeout_ms) |
| Notify transaction stopped to CS. | |
| int | ocpp_status_notification (ocpp_session_handle_t hndl, int conn_id, enum ocpp_cp_status status, enum ocpp_cp_error_code error, uint32_t timeout_ms) |
| Notify connector status to CS via StatusNotification. | |
OCPP Charge Point Implementation.
| #define CISTR50 50 |
#include <zephyr/net/ocpp.h>
Max length of string literals e.g idtag.
| typedef void* ocpp_session_handle_t |
#include <zephyr/net/ocpp.h>
Parameters opaque session handle for ocpp_* API.
| typedef int(* ocpp_user_notify_callback_t) (enum ocpp_notify_reason reason, union ocpp_io_value *io, void *user_data) |
#include <zephyr/net/ocpp.h>
Asynchronous event notification callback registered by the application.
advised callback should not be hold for longer time to unblock the ocpp protocol stack/lib.
Only one callback runs at a time, but not always from the same thread. For a request whose io carries a status, the callback runs in the receive thread and the reply to the central system uses the status set by the user. No callback may call an ocpp API that waits for the central system, as the receive thread may be waiting for the callback to return and could not read that reply.
The reply to OCPP_USR_RESET is sent after the callback returns, so the reset must be done later from another thread, which for a soft reset also stops the running transactions first.
| [in] | reason | for callback invoked. |
| [in] | io | referred corresponding to reason. |
| [in] | user_data | passed on ocpp_init. |
| enum ocpp_auth_status |
#include <zephyr/net/ocpp.h>
OCPP IdTag authorization status in result to ocpp request authorization.
#include <zephyr/net/ocpp.h>
OCPP availability type requested in ChangeAvailability.
| Enumerator | |
|---|---|
| OCPP_AVAILABILITY_INOPERATIVE | connector taken out of service |
| OCPP_AVAILABILITY_OPERATIVE | connector put into service |
| enum ocpp_cp_error_code |
#include <zephyr/net/ocpp.h>
OCPP charge point error code reported in StatusNotification.
| enum ocpp_cp_status |
#include <zephyr/net/ocpp.h>
OCPP charge point status reported in StatusNotification.
| enum ocpp_meter_measurand |
#include <zephyr/net/ocpp.h>
OCPP meter readings to be filled on user callback request from library.
| enum ocpp_notify_reason |
#include <zephyr/net/ocpp.h>
| enum ocpp_req_status |
#include <zephyr/net/ocpp.h>
Reply status the application sets for a central system request.
| enum ocpp_reset_type |
#include <zephyr/net/ocpp.h>
OCPP reset type requested by central system.
| Enumerator | |
|---|---|
| OCPP_RESET_HARD | full reboot of the charge point |
| OCPP_RESET_SOFT | restart of the application only |
| int ocpp_authorize | ( | ocpp_session_handle_t | hndl, |
| char * | idtag, | ||
| enum ocpp_auth_status * | status, | ||
| uint32_t | timeout_ms ) |
#include <zephyr/net/ocpp.h>
Authorize request call to CS to get validity of idtag.
| [in] | hndl | session handle |
| [in] | idtag | (string literal) to get authorize validity |
| [out] | status | authorization status |
| [in] | timeout_ms | timeout in msec |
| int ocpp_init | ( | struct ocpp_cp_info * | cpi, |
| struct ocpp_cs_info * | csi, | ||
| ocpp_user_notify_callback_t | cb, | ||
| void * | user_data ) |
#include <zephyr/net/ocpp.h>
OCPP library init.
| [in] | cpi | Charge Point information |
| [in] | csi | Central System information |
| [in] | cb | user register callback |
| [in] | user_data | same reference will be passed on callback |
| void ocpp_session_close | ( | ocpp_session_handle_t | hndl | ) |
#include <zephyr/net/ocpp.h>
API to close a Session.
| [in] | hndl | a handle received from session open |
| int ocpp_session_open | ( | ocpp_session_handle_t * | hndl | ) |
#include <zephyr/net/ocpp.h>
API to request a new Session.
| [out] | hndl | a valid opaque handle |
| int ocpp_start_transaction | ( | ocpp_session_handle_t | hndl, |
| int | meter_val, | ||
| uint8_t | conn_id, | ||
| uint32_t | timeout_ms ) |
#include <zephyr/net/ocpp.h>
Notify transaction start to CS.
| [in] | hndl | session handle |
| [in] | meter_val | energy meter reading of this connector in Wh |
| [in] | conn_id | connector id should be > 0 and sequential number |
| [in] | timeout_ms | timeout in msec |
| int ocpp_status_notification | ( | ocpp_session_handle_t | hndl, |
| int | conn_id, | ||
| enum ocpp_cp_status | status, | ||
| enum ocpp_cp_error_code | error, | ||
| uint32_t | timeout_ms ) |
#include <zephyr/net/ocpp.h>
Notify connector status to CS via StatusNotification.
| [in] | hndl | session handle |
| [in] | conn_id | connector id, 0 refers to the charge point itself |
| [in] | status | connector status |
| [in] | error | error code, OCPP_CP_ERR_NO_ERROR if none |
| [in] | timeout_ms | timeout in msec |
| int ocpp_stop_transaction | ( | ocpp_session_handle_t | hndl, |
| int | meter_val, | ||
| uint32_t | timeout_ms ) |
#include <zephyr/net/ocpp.h>
Notify transaction stopped to CS.
| [in] | hndl | session handle |
| [in] | meter_val | energy meter reading of this connector in Wh |
| [in] | timeout_ms | timeout in msec |