This document describes every breaking API change introduced in this PR and the corresponding adjustments an integrator must make in their own code.
| # | What to do |
|---|---|
| 1 | Rename EgLpListener.on_remote_entity_connect/disconnect → on_remote_cs_added/removed |
| 2 | Rename EgLpcReadActiveProductionPowerLimit → EgLpcReadActiveConsumptionPowerLimit |
| 3 | Add cb, ctx to all EgLpc*Set* and EgLpp*Set* calls |
| 4 | Add on_remote_eg_added / on_remote_eg_removed to CsLpListenerInterface |
| 5 | Rename MaMpcListener.on_remote_entity_connect/disconnect → on_remote_mu_added/removed |
| 6 | Pass fourth listener argument (or NULL) to MuMpcUseCaseCreate |
| 7 | Add entity_addr parameter to CemOhpcfListener.on_announce/on_state_report/on_clear_process |
| Before | After |
|---|---|
on_remote_entity_connect |
on_remote_cs_added |
on_remote_entity_disconnect |
on_remote_cs_removed |
| — | on_power_nominal_max_receive (new) |
Macro renames:
// Before
EG_LP_LISTENER_ON_REMOTE_ENTITY_CONNECT(obj, entity_addr)
EG_LP_LISTENER_ON_REMOTE_ENTITY_DISCONNECT(obj, entity_addr)
// After
EG_LP_LISTENER_ON_REMOTE_CS_ADDED(obj, entity_addr)
EG_LP_LISTENER_ON_REMOTE_CS_REMOVED(obj, entity_addr)
EG_LP_LISTENER_ON_POWER_NOMINAL_MAX_RECEIVE(obj, entity_addr, power_limit) // newNew callback signature:
void on_power_nominal_max_receive(
EgLpListenerObject* self,
const EntityAddressType* entity_addr,
const ScaledValue* power_limit
);-
In your
EgLpListenerInterfacestruct literal, rename the function pointer fields:on_remote_entity_connect→on_remote_cs_added,on_remote_entity_disconnect→on_remote_cs_removed. -
Rename the pointed-to functions in your implementation accordingly.
-
Optionally add
on_power_nominal_max_receiveif your application needs the nominal max power value (set toNULLotherwise).
| Before | After |
|---|---|
EgLpcReadActiveProductionPowerLimit(...) |
EgLpcReadActiveConsumptionPowerLimit(...) |
EgLppReadActiveProductionPowerLimit(...) |
EgLppReadActiveProductionPowerLimit(...) (unchanged) |
| — | EgLpcReadFailsafeConsumptionActivePowerLimit(...) (new) |
| — | EgLppReadFailsafeProductionActivePowerLimit(...) (new) |
| — | EgLpcReadFailsafeDurationMinimum(...) (new) |
| — | EgLppReadFailsafeDurationMinimum(...) (new) |
| — | EgLpcReadPowerConsumptionNominalMax(...) (new) |
| — | EgLppReadPowerProductionNominalMax(...) (new) |
All Set* functions gained ResultMessageCallback cb and void* ctx
parameters:
// Before
EebusError EgLpcSetActiveConsumptionPowerLimit(
EgLpUseCaseObject* self,
const EntityAddressType* remote_entity_addr,
const ScaledValue* load_limit
);
// After
EebusError EgLpcSetActiveConsumptionPowerLimit(
EgLpUseCaseObject* self,
const EntityAddressType* remote_entity_addr,
const ScaledValue* load_limit,
ResultMessageCallback cb,
void* ctx
);This applies to all EgLpc* and EgLpp* set functions
(SetActiveConsumptionPowerLimit, SetActiveProductionPowerLimit,
SetFailsafeConsumptionActivePowerLimit, SetFailsafeProductionActivePowerLimit,
SetFailsafeDurationMinimum).
-
Rename
EgLpcReadActiveProductionPowerLimittoEgLpcReadActiveConsumptionPowerLimitat every call site. -
Add
cb, ctx(orNULL, NULL) to everyEgLpc*Set*andEgLpp*Set*call.
Two new methods were added:
void on_remote_eg_added(CsLpListenerObject* self, const EntityAddressType* entity_addr);
void on_remote_eg_removed(CsLpListenerObject* self, const EntityAddressType* entity_addr);Corresponding macros:
CS_LP_LISTENER_ON_REMOTE_EG_ADDED(obj, entity_addr)
CS_LP_LISTENER_ON_REMOTE_EG_REMOVED(obj, entity_addr)Add on_remote_eg_added and on_remote_eg_removed to your
CsLpListenerInterface struct literal. These can be NULL if your
application does not need to react to EG entity lifecycle events.
| Before | After |
|---|---|
on_remote_entity_connect |
on_remote_mu_added |
on_remote_entity_disconnect |
on_remote_mu_removed |
Macro renames:
MA_MPC_LISTENER_ON_REMOTE_ENTITY_CONNECT(obj, entity_addr)
MA_MPC_LISTENER_ON_REMOTE_ENTITY_DISCONNECT(obj, entity_addr)
// →
MA_MPC_LISTENER_ON_REMOTE_MU_ADDED(obj, entity_addr)
MA_MPC_LISTENER_ON_REMOTE_MU_REMOVED(obj, entity_addr)Rename the function pointer fields and the pointed-to functions as above.
A new function allows the MA actor to explicitly request measurement data from a remote MU entity:
EebusError MaMpcReadMeasurementsData(
const MaMpcUseCaseObject* self,
const EntityAddressType* remote_entity_addr,
ReplyMessageCallback cb,
void* ctx
);No existing call sites break. Optionally use this function to trigger a measurement read on demand instead of waiting for the next notify.
MuMpcUseCaseCreate gained a new listener parameter:
// Before
MuMpcUseCaseObject* MuMpcUseCaseCreate(
EntityLocalObject* local_entity,
ElectricalConnectionIdType ec_id,
const MuMpcConfig* cfg
);
// After
MuMpcUseCaseObject* MuMpcUseCaseCreate(
EntityLocalObject* local_entity,
ElectricalConnectionIdType ec_id,
const MuMpcConfig* cfg,
MuMpcListenerObject* listener // NEW — may be NULL
);The new MuMpcListenerInterface allows the application to receive
notifications when a remote MA entity connects or disconnects:
struct MuMpcListenerInterface {
void (*destruct)(MuMpcListenerObject* self);
void (*on_remote_ma_added)(MuMpcListenerObject* self, const EntityAddressType* entity_addr);
void (*on_remote_ma_removed)(MuMpcListenerObject* self, const EntityAddressType* entity_addr);
};-
Update every
MuMpcUseCaseCreatecall to pass a fourth argument. PassNULLto keep the existing behaviour. -
Optionally implement
MuMpcListenerInterfaceif your application needs to react to MA entity lifecycle events.
All three action callbacks now receive the remote compressor entity address as their last argument:
// Before
void on_announce(CemOhpcfListenerObject*, const OptionalPowerConsumption*);
void on_state_report(CemOhpcfListenerObject*, CompressorOhpcfState, const EebusDuration*);
void on_clear_process(CemOhpcfListenerObject*);
// After
void on_announce(CemOhpcfListenerObject*, const OptionalPowerConsumption*,
const EntityAddressType* entity_addr);
void on_state_report(CemOhpcfListenerObject*, CompressorOhpcfState, const EebusDuration*,
const EntityAddressType* entity_addr);
void on_clear_process(CemOhpcfListenerObject*, const EntityAddressType* entity_addr);Macro renames (signatures updated accordingly):
CEM_OHPCF_LISTENER_ON_ANNOUNCE(obj, optional_power_consumption, entity_addr)
CEM_OHPCF_LISTENER_ON_STATE_REPORT(obj, state, start_time, entity_addr)
CEM_OHPCF_LISTENER_ON_CLEAR_PROCESS(obj, entity_addr)Additionally CemOhpcfReadSmartData is new:
EebusError CemOhpcfReadSmartData(
const CemOhpcfUseCaseObject* self,
const EntityAddressType* remote_entity_addr,
ReplyMessageCallback cb,
void* ctx
);-
Add
const EntityAddressType* entity_addras the last parameter to youron_announce,on_state_report, andon_clear_processimplementations. -
Update the
CemOhpcfListenerInterfacestruct literal to point to the updated functions. -
Update
CemOhpcfScheduleOptionalPowerConsumptioncall sites to passResultMessageCallback cbandvoid* ctx(orNULL, NULL).