Closed jpily closed 1 year ago
Hi @jpily
Do you mean the route of the bootNotification through the library? It is:
bootNotification
calls ocppEngine->initiateOperation(std::move(bootNotification));
oConn.initiateOcppOperation(std::move(op));
sendReq(ocppSock);
of the operationcreateReq()
and sends it using ocppSocket.sendTXT(out);
Thank you... You must be busy until late, but thank you very much for taking time for your reply. Ask for additional help.
Sending and receiving via AT command is needed, so I would appreciate any advice to create a function.
Closing this due to inactivity
Dear Math-x I have a question about the library. Hi, I'm leaving a question because I have a question during matth-x function analysis. bootNotification("test1", "test2"); If you use this function, you will not be able to find where it becomes Tx. If you look at the definition in ArduinoOcpp.cpp, there's only json form of writing, and I don't know where to send the Tx.
void bootNotification(const char chargePointModel, const char chargePointVendor, OnReceiveConfListener onConf, OnAbortListener onAbort, OnTimeoutListener onTimeout, OnReceiveErrorListener onError, std::unique_ptr timeout) {
if (!ocppEngine) {
AO_DBG_ERR("OCPP uninitialized"); //please call OCPP_initialize before
return;
}
auto credentials = std::unique_ptr(new DynamicJsonDocument(
JSON_OBJECT_SIZE(2) + strlen(chargePointModel) + strlen(chargePointVendor) + 2));
(credentials)["chargePointModel"] = (char) chargePointModel;
(credentials)["chargePointVendor"] = (char) chargePointVendor;
bootNotification(std::move(credentials), onConf, onAbort, onTimeout, onError, std::move(timeout)); }
void bootNotification(std::unique_ptr payload, OnReceiveConfListener onConf, OnAbortListener onAbort, OnTimeoutListener onTimeout, OnReceiveErrorListener onError, std::unique_ptr timeout) {
if (!ocppEngine) {
AO_DBG_ERR("OCPP uninitialized"); //please call OCPP_initialize before
return;
}
auto bootNotification = makeOcppOperation(
new BootNotification(std::move(payload)));
if (onConf)
bootNotification->setOnReceiveConfListener(onConf);
if (onAbort)
bootNotification->setOnAbortListener(onAbort);
if (onTimeout)
bootNotification->setOnTimeoutListener(onTimeout);
if (onError)
bootNotification->setOnReceiveErrorListener(onError);
if (timeout)
bootNotification->setTimeout(std::move(timeout));
else
bootNotification->setTimeout(std::unique_ptr(new SuppressedTimeout()));
ocppEngine->initiateOperation(std::move(bootNotification));
}
I would appreciate it if you could tell me which part is the function that Tx operates.