The Config Model Publication Set message can be used to configure a model to periodically publish its status.
If a model doesn't support publishing the `publish_timeout_cb` member of the struct passed to `access_model_add()` should be set to NULL. This will make the `access_model_publish_period_set()` call return `NRF_ERROR_NOT_SUPPORTED` causing the Config Server model to respond with an error status code of ACCESS_STATUS_FEATURE_NOT_SUPPORTED.
This is wrong as the standard specifies for the error condition "The model defined by ElementAddress and ModelIdentifier does not support
the publish mechanism" the status code name "Invalid Publish Parameters" should be returned.
See section 4.4.1.2.7 in Mesh Profile v1.0.1.
The following patch will make the code reply with the correct status code.
diff --git a/models/foundation/config/src/config_server.c b/models/foundation/config/src/config_server.c
index e7633ad..98c8a22 100644
--- a/models/foundation/config/src/config_server.c
+++ b/models/foundation/config/src/config_server.c
@@ -1281,7 +1281,7 @@ static void handle_config_model_publication_set(access_model_handle_t handle, co
/* Setting publish period when not supported, is an error */
if (publish_period.step_num != 0)
{
- status_error_pub_send(handle, p_message, sig_model, ACCESS_STATUS_FEATURE_NOT_SUPPORTED);
+ status_error_pub_send(handle, p_message, sig_model, ACCESS_STATUS_NOT_A_PUBLISH_MODEL);
return;
}
break;
Thanks.