zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.04k stars 6.18k forks source link

drivers: modem: modem_cmd_handler: prefer currently assigned handler #27898

Open chris-schra opened 3 years ago

chris-schra commented 3 years ago

sorry, @mike-scott for spamming here regarding the driver ;)

I'm creating a driver which assigns URC handlers (for example) for +CREG. But during the init process, I issue AT+CREG? manually to check the current status. If modem is disconnected, I'll connect it, otherwise I'll skip the connection part of the init process. Currently, the order in which handlers are processed is

  • response handlers[0]
  • unsolicited handlers[1]
  • current assigned handlers[2]

But because my URC handlers don't give the sem, the code will never return from the AT+CREG?'s response. So I suggest to reverse the order, processing the currently assigned handlers first. TBH, the ideal order would be Currently assigned handlers -> Response handlers -> Unsolicited handlers But I think there will be no conflicts between unsolicited and response handlers in real world cases.

zephyrbot commented 4 months ago

Hi @bjarki-trackunit,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@chris-schra you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!