Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions c/include/libsbp/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,12 @@ struct MessageTraits<msg_gnss_time_offset_t> {
};


template<>
struct MessageTraits<msg_group_meta_t> {
static constexpr u16 id = 65290;
};


template<>
struct MessageTraits<msg_heartbeat_t> {
static constexpr u16 id = 65535;
Expand Down
17 changes: 17 additions & 0 deletions c/include/libsbp/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,23 @@ typedef struct SBP_ATTR_PACKED {
} msg_gnss_time_offset_t;


/** Solution Group Metadata
*
* This leading message lists the time metadata of the Solution Group.
* It also lists the atomic contents (i.e. types of messages included) of the Solution Group.
*/
#define SBP_MSG_GROUP_META 0xFF0A
typedef struct SBP_ATTR_PACKED {
u16 wn; /**< GPS Week Number or zero if Reference epoch is not GPS [weeks] */
u32 tom; /**< Time of Measurement in Milliseconds since reference epoch [ms] */
s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOM (ranges
from -500000 to 500000)
[ns] */
u8 flags; /**< Status flags (reserved) */
u16 group_msgs[0]; /**< An inorder list of message types included in the Solution Group */
} msg_group_meta_t;


/** \} */

SBP_PACK_END
Expand Down
4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_acquisition_39.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_bootload_40.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_ext_events_41.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
221 changes: 212 additions & 9 deletions c/test/auto_check_sbp_logging_42.c

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_logging_43.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_navigation_44.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_observation_45.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_piksi_46.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
19 changes: 12 additions & 7 deletions c/test/auto_check_sbp_system_36.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do not modify by hand!
// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do not modify by hand!

#include <check.h>
#include <stdio.h> // for debugging
Expand Down Expand Up @@ -97,12 +97,12 @@ START_TEST( test_auto_check_sbp_system_36 )

logging_reset();

sbp_register_callback(&sbp_state, 0xffff, &logging_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n);
sbp_register_callback(&sbp_state, 0xFF0A, &logging_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n);

u8 test_data[] = {85,255,255,246,215,4,0,50,0,0,249,216, };
u8 test_data[] = {85,10,255,238,238,15,192,7,64,226,1,0,0,0,0,0,3,10,2,2,255,156,76, };

dummy_reset();
sbp_send_message(&sbp_state, 0xffff, 55286, sizeof(test_data), test_data, &dummy_write);
sbp_send_message(&sbp_state, 0xFF0A, 61166, sizeof(test_data), test_data, &dummy_write);

while (dummy_rd < dummy_wr) {
fail_unless(sbp_process(&sbp_state, &dummy_read) >= SBP_OK,
Expand All @@ -111,7 +111,7 @@ START_TEST( test_auto_check_sbp_system_36 )

fail_unless(n_callbacks_logged == 1,
"one callback should have been logged");
fail_unless(last_sender_id == 55286,
fail_unless(last_sender_id == 61166,
"sender_id decoded incorrectly");
fail_unless(last_len == sizeof(test_data),
"len decoded incorrectly");
Expand All @@ -122,10 +122,15 @@ START_TEST( test_auto_check_sbp_system_36 )
"context pointer incorrectly passed");

// Cast to expected message type - the +6 byte offset is where the payload starts
msg_heartbeat_t* msg = ( msg_heartbeat_t *)((void *)last_msg + 6);
msg_group_meta_t* msg = ( msg_group_meta_t *)((void *)last_msg + 6);
// Run tests against fields
fail_unless(msg != 0, "stub to prevent warnings if msg isn't used");
fail_unless(msg->flags == 12800, "incorrect value for flags, expected 12800, is %d", msg->flags);
fail_unless(msg->flags == 3, "incorrect value for flags, expected 3, is %d", msg->flags);
fail_unless(msg->group_msgs[0] == 522, "incorrect value for group_msgs[0], expected 522, is %d", msg->group_msgs[0]);
fail_unless(msg->group_msgs[1] == 65282, "incorrect value for group_msgs[1], expected 65282, is %d", msg->group_msgs[1]);
fail_unless(msg->ns_residual == 0, "incorrect value for ns_residual, expected 0, is %d", msg->ns_residual);
fail_unless(msg->tom == 123456, "incorrect value for tom, expected 123456, is %d", msg->tom);
fail_unless(msg->wn == 1984, "incorrect value for wn, expected 1984, is %d", msg->wn);
}
}
END_TEST
Expand Down
16 changes: 7 additions & 9 deletions c/test/auto_check_sbp_system_37.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do not modify by hand!
// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do not modify by hand!

#include <check.h>
#include <stdio.h> // for debugging
Expand Down Expand Up @@ -97,12 +97,12 @@ START_TEST( test_auto_check_sbp_system_37 )

logging_reset();

sbp_register_callback(&sbp_state, 0xff00, &logging_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n);
sbp_register_callback(&sbp_state, 0xffff, &logging_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n);

u8 test_data[] = {85,0,255,66,0,4,0,0,0,0,70,160, };
u8 test_data[] = {85,255,255,246,215,4,0,50,0,0,249,216, };

dummy_reset();
sbp_send_message(&sbp_state, 0xff00, 66, sizeof(test_data), test_data, &dummy_write);
sbp_send_message(&sbp_state, 0xffff, 55286, sizeof(test_data), test_data, &dummy_write);

while (dummy_rd < dummy_wr) {
fail_unless(sbp_process(&sbp_state, &dummy_read) >= SBP_OK,
Expand All @@ -111,7 +111,7 @@ START_TEST( test_auto_check_sbp_system_37 )

fail_unless(n_callbacks_logged == 1,
"one callback should have been logged");
fail_unless(last_sender_id == 66,
fail_unless(last_sender_id == 55286,
"sender_id decoded incorrectly");
fail_unless(last_len == sizeof(test_data),
"len decoded incorrectly");
Expand All @@ -122,12 +122,10 @@ START_TEST( test_auto_check_sbp_system_37 )
"context pointer incorrectly passed");

// Cast to expected message type - the +6 byte offset is where the payload starts
msg_startup_t* msg = ( msg_startup_t *)((void *)last_msg + 6);
msg_heartbeat_t* msg = ( msg_heartbeat_t *)((void *)last_msg + 6);
// Run tests against fields
fail_unless(msg != 0, "stub to prevent warnings if msg isn't used");
fail_unless(msg->cause == 0, "incorrect value for cause, expected 0, is %d", msg->cause);
fail_unless(msg->reserved == 0, "incorrect value for reserved, expected 0, is %d", msg->reserved);
fail_unless(msg->startup_type == 0, "incorrect value for startup_type, expected 0, is %d", msg->startup_type);
fail_unless(msg->flags == 12800, "incorrect value for flags, expected 12800, is %d", msg->flags);
}
}
END_TEST
Expand Down
4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_system_38.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions c/test/auto_check_sbp_system_47.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swiftnav.com>
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be be distributed together with this source. All other rights reserved.
Expand Down
Loading