Skip to content

Commit 416da16

Browse files
authored
Don't use deprecated functions in sbp impl [AP-1089] (#1397)
# Description @swift-nav/devinfra Reimplement `sbp_all_payload_callback_payload` so that it doesn't use deprecated functions This function is part of the legacy API and is marked for deprecation. In its current implementation it calls another function in the legacy API (`sbp_frame_callback_register`) which is also marked as deprecated. This will cause a compile time warning from the compiler about the use of deprecated functions. There are a few ways to solve it, but since the functions in question are so simple the quickest and least intrusive way is to simple duplicate the functionality of `sbp_frame_callback_register` in `sbp_all_payload_callback_register` and tailor it to cope with the different parameters. # API compatibility Does this change introduce a API compatibility risk? No ## API compatibility plan If the above is "Yes", please detail the compatibility (or migration) plan: N/A # JIRA Reference https://swift-nav.atlassian.net/browse/AP-1089
1 parent 13f7836 commit 416da16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

c/src/sbp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,10 @@ s8 sbp_frame_callback_register(sbp_state_t* s, u16 msg_type,
774774
s8 sbp_all_payload_callback_register(sbp_state_t *s, sbp_frame_callback_t cb,
775775
void *context, sbp_msg_callbacks_node_t *node)
776776
{
777-
return sbp_frame_callback_register(s, SBP_MSG_ALL, cb, context, node);
777+
sbp_callback_t callback;
778+
callback.frame = cb;
779+
return sbp_register_callback_generic(s, SBP_MSG_ALL, callback,
780+
SBP_FRAME_CALLBACK, context, node);
778781
}
779782

780783
s8 sbp_frame_process(sbp_state_t *s, u16 sender_id, u16 msg_type,

0 commit comments

Comments
 (0)