2023-05-09: v7.0.3: Bug fixes

Fixed
- Prevent a parent object's parameters being spread across more than one
resolved_path_result in the GetResponse, if it has many child object
instances
- Example mqtt factory reset database should not contain wildcard in
ResponseTopicConfigured (GH#78)
This commit is contained in:
Richard Holme
2023-05-09 09:14:02 +01:00
parent d363c50a35
commit d18bdd6875
4 changed files with 61 additions and 4 deletions

View File

@@ -1,5 +1,10 @@
# OB-USP-AGENT Changelog since Release 7.0.0
## 2023-05-09 v7.0.3
### Fixed
- Prevent a parent object's parameters being spread across more than one resolved_path_result in the GetResponse, if it has many child object instances
- Example mqtt factory reset database should not contain wildcard in ResponseTopicConfigured (GH#78)
## 2023-03-13 v7.0.2
### Fixed
- USP Agent should attempt to restart all async operations, even if one restart fails

View File

@@ -31,7 +31,7 @@ Device.LocalAgent.Subscription.1.NotifType Event
Device.LocalAgent.Subscription.1.ReferenceList Device.Boot!
Device.LocalAgent.Subscription.1.Persistent true
Device.LocalAgent.MTP.1.MQTT.ResponseTopicConfigured "/usp/endpoint/#"
Device.LocalAgent.MTP.1.MQTT.ResponseTopicConfigured "/usp/agent"
Device.LocalAgent.MTP.1.MQTT.Reference "Device.MQTT.Client.1"
Device.MQTT.Client.1.BrokerAddress "mqtt.eclipse.org"
Device.MQTT.Client.1.ProtocolVersion "5.0"

View File

@@ -135,6 +135,7 @@ int GetAllInstancePathsRecursive(dm_node_t *node, dm_instances_t *inst, str_vect
void DumpDataModelNodeMap(void);
int GetVendorParam(dm_node_t *node, char *path, dm_instances_t *inst, char *buf, int len, dm_req_t *req);
int SetVendorParam(dm_node_t *node, char *path, dm_instances_t *inst, char *value, dm_req_t *req);
double_link_t *FindLinkToFirstObject(double_linked_list_t *list);
/*********************************************************************//**
**
@@ -3150,8 +3151,26 @@ dm_node_t *DM_PRIV_AddSchemaPath(char *path, dm_node_type_t type, unsigned flags
return NULL;
}
// Add the node to it's parent
DLLIST_LinkToTail(&parent->child_nodes, child);
// Add the node to it's parent, ensuring that all child parameters are placed before all child objects
// This prevents the parameters being separated in different resolved_path results (of a GetResponse), if RESOLVED_PATH_SEARCH_LIMIT is exceeded
// This code also ensures that the order of registering the nodes is respected for each type in the child list
if (IsObject(child))
{
DLLIST_LinkToTail(&parent->child_nodes, child);
}
else
{
double_link_t *insert_point;
insert_point = FindLinkToFirstObject(&parent->child_nodes);
if (insert_point != NULL)
{
DLLIST_InsertLinkBefore(insert_point, &parent->child_nodes, child);
}
else
{
DLLIST_LinkToTail(&parent->child_nodes, child);
}
}
// Add this node to the instance node array, if it is a multi-instance object
if (seg->type == kDMNodeType_Object_MultiInstance)
@@ -4638,6 +4657,39 @@ dm_node_t *FindNodeFromHash(dm_hash_t hash)
return node;
}
/*********************************************************************//**
**
** FindLinkToFirstObject
**
** Finds the first object in the list of child nodes
**
** \param list - pointer to the list containing child nodes
**
** \return pointer to first object found in the list of child nodes or NULL if no objects are found
**
**************************************************************************/
double_link_t *FindLinkToFirstObject(double_linked_list_t *list)
{
double_link_t *item;
dm_node_t *child;
item = list->head;
while (item != NULL)
{
child = (dm_node_t *) item;
if (IsObject(child))
{
return item;
}
// move to next item in linked list
item = item->next;
}
// Got to end of list and no objects found
return NULL;
}
/*********************************************************************//**
**
** RegisterDefaultControllerTrust

View File

@@ -40,4 +40,4 @@
*/
/* Lines below main version may include patch version numbers */
#define AGENT_SOFTWARE_VERSION "7.0.2"
#define AGENT_SOFTWARE_VERSION "7.0.3"