MicroOcpp icon indicating copy to clipboard operation
MicroOcpp copied to clipboard

AuthorizeRemoteTxRequests key functional implementation

Open imanolmc opened this issue 1 year ago • 1 comments

Hello Matth,

We are considering the functional implementation of AuthorizeRemoteTxRequests key in the library. Could you provide any guidance on how to get started?

Thank you in advance for your assistance.

Regards,

Imanol

imanolmc avatar Jun 26 '24 05:06 imanolmc

Hi @imanolmc,

The relevant point in the code is here:

https://github.com/matth-x/MicroOcpp/blob/8b1f0fdbae8785c49453f0b2d54a1a8db2fbe3ed/src/MicroOcpp/Operations/RemoteStartTransaction.cpp#L100

beginTransaction_authorized assumes that the given idTag is already successfully authorized. In constrast, beginTransaction would try authorizing it again, including sending an Authorize request.

You can alter the configuration mutability here: https://github.com/matth-x/MicroOcpp/blob/8b1f0fdbae8785c49453f0b2d54a1a8db2fbe3ed/src/MicroOcpp/Model/ConnectorBase/ConnectorsCommon.cpp#L39

The parameters for R/W configs look like this:

https://github.com/matth-x/MicroOcpp/blob/8b1f0fdbae8785c49453f0b2d54a1a8db2fbe3ed/src/MicroOcpp/Model/ConnectorBase/Connector.cpp#L50

Again back to RemoteStartTransaction, you can read the configuration value by declaring it there and using the getBool() function similar to here:

https://github.com/matth-x/MicroOcpp/blob/8b1f0fdbae8785c49453f0b2d54a1a8db2fbe3ed/src/MicroOcpp/Model/ConnectorBase/Connector.cpp#L264

matth-x avatar Jun 26 '24 11:06 matth-x