Skip to content

Commit

Permalink
update v16 firmware source
Browse files Browse the repository at this point in the history
  • Loading branch information
matth-x committed Sep 3, 2024
1 parent 4c781d3 commit f1e03e8
Showing 1 changed file with 38 additions and 19 deletions.
57 changes: 38 additions & 19 deletions tests/benchmarks/firmware_size/main_v16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,52 @@
// MIT License

#include <MicroOcpp.h>
#include <MicroOcpp_c.h>
#include <MicroOcpp/Model/FirmwareManagement/FirmwareService.h>
#include <MicroOcpp/Model/Diagnostics/DiagnosticsService.h>

MicroOcpp::LoopbackConnection g_loopback;

void setup() {

ocpp_deinitialize();

mocpp_initialize(g_loopback, ChargerCredentials());

/*
* Integrate OCPP functionality. You can leave out the following part if your EVSE doesn't need it.
*/
setEnergyMeterInput([]() {
//take the energy register of the main electricity meter and return the value in watt-hours
return 0.f;
});

setSmartChargingCurrentOutput([](float limit) {
//set the SAE J1772 Control Pilot value here
Serial.printf("[main] Smart Charging allows maximum charge rate: %.0f\n", limit);
});

setConnectorPluggedInput([]() {
//return true if an EV is plugged to this EVSE
return false;
});

//... see MicroOcpp.h for more settings
ocpp_beginTransaction("");
ocpp_beginTransaction_authorized("","");
ocpp_endTransaction("","");
ocpp_endTransaction_authorized("","");
ocpp_isTransactionActive();
ocpp_isTransactionRunning();
ocpp_getTransactionIdTag();
ocpp_getTransaction();
ocpp_ocppPermitsCharge();
ocpp_getChargePointStatus();
ocpp_setConnectorPluggedInput([] () {return false;});
ocpp_setEnergyMeterInput([] () {return 0;});
ocpp_setPowerMeterInput([] () {return 0.f;});
ocpp_setSmartChargingPowerOutput([] (float) {});
ocpp_setSmartChargingCurrentOutput([] (float) {});
ocpp_setSmartChargingOutput([] (float,float,int) {});
ocpp_setEvReadyInput([] () {return false;});
ocpp_setEvseReadyInput([] () {return false;});
ocpp_addErrorCodeInput([] () {return (const char*)nullptr;});
addErrorDataInput([] () {return MicroOcpp::ErrorData("");});
ocpp_addMeterValueInputFloat([] () {return 0.f;},"","","","");
ocpp_setOccupiedInput([] () {return false;});
ocpp_setStartTxReadyInput([] () {return false;});
ocpp_setStopTxReadyInput([] () {return false;});
ocpp_setTxNotificationOutput([] (OCPP_Transaction*, OCPP_TxNotification) {});
ocpp_setOnUnlockConnectorInOut([] () {return UnlockConnectorResult_UnlockFailed;});
isOperative();
setOnResetNotify([] (bool) {return false;});
setOnResetExecute([] (bool) {return false;});
getFirmwareService()->getFirmwareStatus();
getDiagnosticsService()->getDiagnosticsStatus();
setCertificateStore(nullptr);
getOcppContext();

}

void loop() {
Expand Down

0 comments on commit f1e03e8

Please sign in to comment.