BroadbandForum / obuspa

OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent. https://github.com/BroadbandForum/obuspa/wiki
BSD 3-Clause "New" or "Revised" License
93 stars 62 forks source link

Enabling/Disabling Bulk data Collection for USP Command Operation #76

Closed shanthakumarks closed 1 year ago

shanthakumarks commented 1 year ago

Hi ,

We have an use case where we want to enable Bulkdata collection while performing an asynchronous USP Command . Once the USP Command sends out the Operation Complete, the Bulkdata collection needs to be disabled. We set the parameter Device.BulkData.Profile.1.Enable to True and False in order to enable and disable.

We thought we can enable the bulkdata collection before spawning the asynchronous thread and disable the bulkdata collection from inside spawned thread after the operation is complete as we don't want to block the datamodel thread until the asynchronous operation is complete. But as per OBUSPA design , setting any datamodel parameter from a non datamodel thread is not allowed. So we are unable to disable the bulkdata collection from the spawned asynchronous thread.

is there any other API available to perform the SetParameterValue from a Non datamodel thread or Do you have any other suggestion to implement this differently ?

holme-r commented 1 year ago

There isn't currently an API that allows you to set an arbitrary parameter from another thread. You could add code like USP_SIGNAL_OperationStatus() and a case in the data model thread (ProcessMessageQueueSocketActivity) to do it.

shanthakumarks commented 1 year ago

Thanks for the response. Adding a case in the data model thread would require us to touch the core directory. isn't it ? We are trying not to touch the core code as an integrator. We are still looking for an alternative approach to handle this from vendor code.

I wish we had a switch case in the data model thread(ProcessMessageQueueSocketActivity) that invokes Vendor specific callback Function pointer. This will enable Vendor code to perform a datamodel operation at the completion of an asynchronous operation. Can we consider this idea for the upcoming release ?

holme-r commented 1 year ago

We will discuss this at our next BBF OBUSPA meeting.

johnblackford commented 1 year ago

Closing this as we believe there was a work around performed. Please re-open if this is still an issue.