-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.h
157 lines (135 loc) · 4.91 KB
/
settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
* 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.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/
/*****************************************************************************
* Automatically generated from yaml/swiftnav/sbp/settings.yaml
* with generate.py. Please do not hand edit!
*****************************************************************************/
/** \defgroup settings Settings
*
* * Messages for reading and writing the device's device settings.
*
* Note that some of these messages share the same message type ID for both the
* host request and the device response. See the accompanying document for
* descriptions of settings configurations and examples:
*
* https://github.com/swift-nav/piksi\_firmware/blob/master/docs/settings.pdf
* \{ */
#ifndef LIBSBP_SETTINGS_MESSAGES_H
#define LIBSBP_SETTINGS_MESSAGES_H
#include "common.h"
/** Save settings to flash (host => device)
*
* The save settings message persists the device's current settings
* configuration to its onboard flash memory file system.
*/
#define SBP_MSG_SETTINGS_SAVE 0x00A1
/** Write device configuration settings (host => device)
*
* The setting message writes the device configuration.
*/
#define SBP_MSG_SETTINGS_WRITE 0x00A0
typedef struct {
char setting
[0]; /**< A NULL-terminated and delimited string with contents
[SECTION_SETTING, SETTING, VALUE]. A device will only
process to this message when it is received from sender ID
0x42.
*/
} msg_settings_write_t;
/** Acknowledgement with status of MSG_SETTINGS_WRITE
*
* Return the status of a write request with the new value of the
* setting. If the requested value is rejected, the current value
* will be returned.
*/
#define SBP_MSG_SETTINGS_WRITE_RESP 0x00AF
typedef struct {
u8 status; /**< Write status */
char setting
[0]; /**< A NULL-terminated and delimited string with contents
[SECTION_SETTING, SETTING, VALUE].
*/
} msg_settings_write_resp_t;
/** Read device configuration settings (host => device)
*
* The setting message reads the device configuration.
*/
#define SBP_MSG_SETTINGS_READ_REQ 0x00A4
typedef struct {
char setting
[0]; /**< A NULL-terminated and delimited string with contents
[SECTION_SETTING, SETTING]. A device will only respond to
this message when it is received from sender ID 0x42.
*/
} msg_settings_read_req_t;
/** Read device configuration settings (host <= device)
*
* The setting message reads the device configuration.
*/
#define SBP_MSG_SETTINGS_READ_RESP 0x00A5
typedef struct {
char setting
[0]; /**< A NULL-terminated and delimited string with contents
[SECTION_SETTING, SETTING, VALUE].
*/
} msg_settings_read_resp_t;
/** Read setting by direct index (host => device)
*
* The settings message for iterating through the settings
* values. It will read the setting at an index, returning a
* NULL-terminated and delimited string with contents
* [SECTION_SETTING, SETTING, VALUE]. A device will only respond to
* this message when it is received from sender ID 0x42.
*/
#define SBP_MSG_SETTINGS_READ_BY_INDEX_REQ 0x00A2
typedef struct {
u16 index; /**< An index into the device settings, with values ranging from
0 to length(settings)
*/
} msg_settings_read_by_index_req_t;
/** Read setting by direct index (host <= device)
*
* The settings message for iterating through the settings
* values. It will read the setting at an index, returning a
* NULL-terminated and delimited string with contents
* [SECTION_SETTING, SETTING, VALUE].
*/
#define SBP_MSG_SETTINGS_READ_BY_INDEX_RESP 0x00A7
typedef struct {
u16 index; /**< An index into the device settings, with values ranging from
0 to length(settings)
*/
char setting
[0]; /**< A NULL-terminated and delimited string with contents
[SECTION_SETTING, SETTING, VALUE].
*/
} msg_settings_read_by_index_resp_t;
/** Finished reading settings (host <= device)
*
* The settings message for indicating end of the settings values.
*/
#define SBP_MSG_SETTINGS_READ_BY_INDEX_DONE 0x00A6
/** Register setting and default value (device => host)
*
* This message registers the presence and default value of a setting
* with a settings daemon. The host should reply with MSG_SETTINGS_WRITE
* for this setting to set the initial value.
*/
#define SBP_MSG_SETTINGS_REGISTER 0x00AE
typedef struct {
char setting
[0]; /**< A NULL-terminated and delimited string with contents
[SECTION_SETTING, SETTING, VALUE].
*/
} msg_settings_register_t;
/** \} */
#endif /* LIBSBP_SETTINGS_MESSAGES_H */