One-to-many event handling for Zephyr with data transfer?

We have been looking for a standard (in Zepyhyr or SDK) way of handling communications between our software modules (drivers, modules, threads) that generate multiple streams of data. Everything from ADC samples to battery SOC updates that may need to be streamed to file, or sent over Bluetooth.

Looking at the (App) Event Manager (AEM) we find a few issues with using it in our case.
Examining the source leads me to think that event handlers are being called from the AEM worker thread and thus, they should not do lenghty processing like signal analysis or waiting for filesystems. Further they receive a pointer to an event which will be deallocated upon their return (unless other listeners still need to be notified) and as such, they would have to copy the data to process later. The AEM framework also does not then solve the "many queues" issue of data it creates with this copying as there will still have to be some sort of communication between the event handler and the consumer of the data.

Am I missing something?
Is there a system that allows these notifications to be "pending" on multiple listeners such that they can then be processed at their leisure?

Parents
  • I asked a developer internally that's been working with the AEM and got some insight.

    Regarding the question about needing to copy data when there is a lot of consumers (since the data will be lost after it's delivered to all listeners), this will be the case in most similar systems, as amount of memory is limited and you can't hold data indefinitely.

    AEM is asynchronous (messages (events) are delivered in strictly defined order), and is used to simplify applications by reducing the amount of threads. It seems like you're looking for a system to transfer data between multiple threads. In that case Zbus might be a better option: https://github.com/zephyrproject-rtos/zephyr/issues/45910 

    Best regards,

    Simon

Reply
  • I asked a developer internally that's been working with the AEM and got some insight.

    Regarding the question about needing to copy data when there is a lot of consumers (since the data will be lost after it's delivered to all listeners), this will be the case in most similar systems, as amount of memory is limited and you can't hold data indefinitely.

    AEM is asynchronous (messages (events) are delivered in strictly defined order), and is used to simplify applications by reducing the amount of threads. It seems like you're looking for a system to transfer data between multiple threads. In that case Zbus might be a better option: https://github.com/zephyrproject-rtos/zephyr/issues/45910 

    Best regards,

    Simon

Children
Related