@@ -24,7 +24,7 @@ using namespace MicroOcpp;
2424
2525AuthorizationService::AuthorizationService (Context& context, std::shared_ptr<FilesystemAdapter> filesystem) : MemoryManaged(" v16.Authorization.AuthorizationService" ), context(context), filesystem(filesystem) {
2626
27- localAuthListEnabledBool = declareConfiguration<bool >(" LocalAuthListEnabled" , true );
27+ localAuthListEnabledBool = declareConfiguration<bool >(" LocalAuthListEnabled" , true , CONFIGURATION_FN, false , true );
2828 declareConfiguration<int >(" LocalAuthListMaxLength" , MO_LocalAuthListMaxLength, CONFIGURATION_VOLATILE, true );
2929 declareConfiguration<int >(" SendLocalListMaxLength" , MO_SendLocalListMaxLength, CONFIGURATION_VOLATILE, true );
3030
@@ -75,7 +75,7 @@ bool AuthorizationService::loadLists() {
7575}
7676
7777AuthorizationData *AuthorizationService::getLocalAuthorization (const char *idTag) {
78- if (!localAuthListEnabledBool-> getBool ()) {
78+ if (!localAuthListEnabled ()) {
7979 return nullptr ; // auth cache will follow
8080 }
8181
@@ -101,7 +101,14 @@ size_t AuthorizationService::getLocalListSize() {
101101 return localAuthorizationList.size ();
102102}
103103
104+ bool AuthorizationService::localAuthListEnabled () const {
105+ return localAuthListEnabledBool && localAuthListEnabledBool->getBool ();
106+ }
107+
104108bool AuthorizationService::updateLocalList (JsonArray localAuthorizationListJson, int listVersion, bool differential) {
109+ // TC_043_3_CS-Send Local Authorization List - Failed
110+ // return false;
111+
105112 bool success = localAuthorizationList.readJson (localAuthorizationListJson, listVersion, differential, false );
106113
107114 if (success) {
@@ -127,7 +134,7 @@ bool AuthorizationService::updateLocalList(JsonArray localAuthorizationListJson,
127134void AuthorizationService::notifyAuthorization (const char *idTag, JsonObject idTagInfo) {
128135 // check local list conflicts. In future: also update authorization cache
129136
130- if (!localAuthListEnabledBool-> getBool ()) {
137+ if (!localAuthListEnabled ()) {
131138 return ; // auth cache will follow
132139 }
133140
0 commit comments