Closed brice-morin closed 2 months ago
Hi @brice-morin , thanks for your question and nice to hear that you try to migrate to a newer SDK.
I think the change forcing the new function was a deprecation of GTimeVal
in AXIS OS that was replaced by GDateTime
.
There were two new Event API functions added to handle this:
ax_event_new2
ax_event_get_time_stamp2
From a quick look in the code and your snippet use NULL
(not setting a timestamp), it looks like ax_event_new
and ax_event_new2
should give the same result. The change was introduced in AXIS OS 10.2 and the new API functions were available in ACAP SDK 3.2.
Not sure if this give you any help.
Describe the bug
The app is quite simple, and was initially develop from various examples provided by Axis for SDK3. Every 2 minutes, it will collect some metrics from the camera and emit an event (which will be published to MQTT). Now that SDK3 is becoming deprecated, I am migrating this app to the new SDK4. However, both versions of the app do not behave the same, to the point the version using SDK4 can be declared as broken.
When compiled with the legacy SDK3 and using ax_event_new() from the Event API
everything works as expected. In fact, this code has been running for several years on several hundreds of cameras.
When compiled with the new SDK4 and using the non-deprecated ax_event_new2() from the Event API
The behavior is more chaotic, though very systematic
The two version of the app use the very same code. The only difference is isolated in a function where we use conditional compilation directives, like this:
To reproduce
A this point, I do not have a minimal reproduceable setup that I can share.
Before I invest time on making this reproduceable setup, I would appreciate if you have any feedback, hints, etc that could help me fixing the issue with SDK4. Are there any more changes in the Event API that could explain the issue?
Screenshots
None. Logs have been provided
Environment
Additional context
Add any other context about the problem here.