Core API
All devices supporting MDIF must implement the Core component. The
Core component defines the basic functionality of a device, and it is specified
in src/protobuf/mdif/core/core.proto
.
Protobuf specification
The following documentation is generated from the Protobuf specification in
src/protobuf/mdif/core/core.proto
.
Table of Contents
mdif/common.proto
Common to all mdif protobuffers.
Status
Defines the status of a request
Name |
Number |
Description |
---|---|---|
SUCCESS |
0 |
The request was successful |
FAILURE |
1 |
The request failed |
ERR_INVALID |
2 |
The request was invalid |
ERR_NOT_SUPPORTED |
3 |
The request is not supported |
ERR_NOT_IMPLEMENTED |
4 |
The request is not implemented |
ERR_NOT_READY |
5 |
The device is not ready to process the request |
ERR_SIZE |
6 |
The device cannot process the size |
mdif/core/core.proto
Message allocation for the Core component are in the range:
Start |
End |
Radix |
---|---|---|
0x01 |
0x1F |
Hex |
1 |
31 |
Dec |
CoreService
Defines the relationship between requests and responses in the Core component
Method Name |
Request Type |
Response Type |
Description |
---|---|---|---|
Ping |
Used to ping the target device |
||
Reset |
Used to reset the device |
||
GetDeviceInfo |
Used to get the device info |
||
GetBatteryStatus |
Used to get the battery status |
||
GetIpConfig |
Used to get the IP configuration |
||
SetIpConfig |
Used to set the IP configuration |
||
GnssCompassStream |
Used to enable or disable streaming of GNSS and compass data. |
||
CompassCalibrate |
Used to calibrate compass |
||
CompassCalibrationStore |
Used to store current compass calibration |
ApiErrorInd
Api Error indication
This message is used to indicate an error in the API. E.g if a request is not properly decoded.
Field |
Type |
Description |
---|---|---|
error |
CompassCalibrateReq
Start a calibration of the compass.
The device will respond with a CompassCalibrateRes message and, if the calibration was successfully started, will follow up with a CompassCalibrationCompleteInd once calibration has either succeeded, or timed out (20s-110s duration).
When the calibration is running, the device must be on a level mount or surface, and should be rotated through 360 degrees within 20s. It may be necessary to rotate the device multiple times before the calibration succeeds.
CompassCalibrateRes
Compass calibration response.
Indicates whether the calibration was started successfully.
Field |
Type |
Description |
---|---|---|
status |
The status of the request |
CompassCalibrationAdjustedInd
Indication that opportunistic adjustment of compass calibration has happened. This happens when the device detects that is has moved a full circle within max 128 samples at the period set in GnssCompassStreamReq. The new calibration values are volatile, and will be reset on a power-cycle.
Field |
Type |
Description |
---|---|---|
heading_diff |
Difference in heading for the latest measurement, due to calibration adjustment. |
|
offset_x |
The updated calibration data. Internal use only. Calculated offset for X axis (Internal use only) |
|
offset_y |
Calculated offset for Y axis (Internal use only) |
|
scale_x |
Calculated scaling for X axis (Internal use only) |
|
scale_y |
Calculated scaling for Y axis (Internal use only) |
CompassCalibrationCompleteInd
Indication of a completed compass calibration.
On succesful completion, the new calibration values automatically replace the previous set in non-volatile memory.
Field |
Type |
Description |
---|---|---|
status |
The status of the calibration |
|
offset_x |
Calculated offset for X axis (Internal use only) |
|
offset_y |
Calculated offset for Y axis (Internal use only) |
|
scale_x |
Calculated scaling for X axis (Internal use only) |
|
scale_y |
Calculated scaling for Y axis (Internal use only) |
CompassCalibrationStoreReq
Request that the current calibration values be written to non-volatile memory.
The device will respond with a CompassCalibrationStoreRes message.
CompassCalibrationStoreRes
Indicates if the calibration data has been written succesfully.
Field |
Type |
Description |
---|---|---|
status |
CompassHeading
Defines a compass heading
Note that the reported heading is not compensated for magnetic declination. For details on how to compensate, see resources at NOAA:
Field |
Type |
Description |
---|---|---|
calibrated |
Indicates presence of calibration data. Note that moving a device to a new mount or location will require a new calibration. |
|
heading |
Uncompensated magnetic heading. Degrees, 0 to 360. North is 0, East is 90. |
|
x |
X. Raw reading from magnetometer. For calibration purposes only. |
|
y |
Y. Raw reading from magnetometer. For calibration purposes only. |
|
z |
Z. Raw reading from magnetometer. For calibration purposes only. |
CoreMsg
Core wire format message
This message dictates the final format on the wire for core messages. It is a oneof construct to wrap a single message at a time.
Every request (req) has a corresponding response (res). The req/res pairs are defined in the CoreService through RPC patterns.
Indications (ind) are pushed without a request at any time
Field |
Type |
Description |
---|---|---|
ping_req |
Request Ping response |
|
ping_res |
Ping response |
|
reset_req |
Request reset of device |
|
reset_res |
Reset response |
|
get_device_info_req |
Request device info |
|
get_device_info_res |
Device info response |
|
get_battery_status_req |
Request battery status |
|
get_battery_status_res |
Battery status response |
|
get_ip_config_req |
Request IP configuration |
|
get_ip_config_res |
IP configuration response |
|
set_ip_config_req |
Set IP configuration request |
|
set_ip_config_res |
Set IP configuration response |
|
gnss_compass_stream_req |
Request streamed GNSS and compass updates |
|
gnss_compass_stream_res |
Response to GNSS and compass stream request. |
|
gnss_compass_stream_ind |
GNSS and compass stream data indication. |
|
compass_calibrate_req |
Request a compass calibration |
|
compass_calibrate_res |
Response to a compass calibration request. |
|
compass_calibration_complete_ind |
Indication that a compass calibration has completed. |
|
compass_calibration_adjusted_ind |
Indication that compass calibration has been updated. |
|
compass_calibration_store_req |
Request to store calibration data to non-volatile memory. |
|
compass_calibration_store_res |
Response to a compass calibration store request. |
|
device_announce_ind |
Device Announce Indication |
|
api_error_ind |
Api Error indication |
DeviceInfo
Device info
Used in GetDeviceInfoRes and DeviceAnnounceInd
Field |
Type |
Description |
---|---|---|
serial_number |
Serial number of the device |
|
device_type |
The type of device |
|
device_version |
The version of the device |
|
sw_version |
The version of the software |
|
gnss_present |
Does this device have GNSS |
|
compass_present |
Does this device have a compass |
|
gnss_configurable |
Can GNSS settings be configured for this device. |
GetBatteryStatusReq
Request battery status
The device will respond with a GetBatteryStatusRes message.
GetBatteryStatusRes
Battery status response
Field |
Type |
Description |
---|---|---|
status |
The status of the request |
|
bat_low |
Is the battery low |
|
bat_charging |
Is the battery charging |
|
bat_volt |
The battery voltage |
GetDeviceInfoReq
Request device info
The device will respond with a GetDeviceInfoRes message.
GetIpConfigReq
Request IP configuration
The device will respond with a GetIpConfigRes message.
GetIpConfigRes
IP configuration response
Field |
Type |
Description |
---|---|---|
status |
The status of the request |
|
current_ip_config |
The current IP configuration |
|
nvm_ip_config |
The IP configuration set in NVM and used on boot |
|
mac_address |
The MAC address of the device |
|
dhcp_enabled |
Is DHCP enabled |
GnssCompassStreamInd
GNSS and compass stream data indication
Field |
Type |
Description |
---|---|---|
gnss_status |
GNSS status |
|
compass_heading |
Compass heading |
GnssCompassStreamReq
Request GNSS and compass data stream
The device will respond with a GnssCompassStreamRes message.
Field |
Type |
Description |
---|---|---|
enable |
Enable or disable the stream. The device will include only the elements of the stream that it supports, as indicated in GetDeviceInfoRes. A device without GNSS does not support the stream. |
|
period |
Period between GNSS updates in miliseconds. Valid range 250-1000. The compass updates are tied to the GNSS update rate. Note on Wolfpack 210: A WP210 is composite in nature - there are four zones, each addressable via MDIF as its own device. The GNSS and compass stream setup in this case is split across two zones. In the GetDeviceInfoRes message, one zone will reply compass_present=true and gnss_configurable=false. Enable the stream on this device to receive compass headings. Another zone will reply compass_present=false and gnss_configurable=true. Enable the stream on this device to change the GNSS timing. |
|
auto_update_calibration |
Enable opportunistic calibration. If enabled, the calibration values will be incrementally updated when the device describes a full circle within 128 * period. Updates will be signalled with the CompassCalibrationAdjustedInd signal, and the updated values may be persisted with the CompassCalibrationStoreReq signal. |
GnssCompassStreamRes
GNSS and compass stream response
Indicates whether the stream was started successfully.
Field |
Type |
Description |
---|---|---|
status |
The status of the request. |
|
error_string |
Error description string |
GnssStatus
Defines a GNSS status
Field |
Type |
Description |
---|---|---|
pos_valid |
Validity of the reported position. |
|
time_valid |
Validity of the reported system time. The time is considered valid if there is currently a valid GNSS time avaliable, or it has previously been available, and the system estimates that it has drifted less than 100us since it was lost. |
|
pos_hacc |
Horizontal accuracy estimate, meters. |
|
pos_hmsl |
Height over mean sea level, meters. |
|
pos_vacc |
Vertical accuracy estimate, meters. |
|
sol_time |
GPS time in microseconds for this navigation solution. |
|
p_acc |
ECEF position accuracy estimate, meters. |
|
ground_speed |
Speed over ground, meters/second |
|
heading_2d |
2D heading. Degrees, 0 to 360. North is 0, East is 90. |
|
sacc |
Speed accuracy estimate, meters/s |
|
heading_acc |
Heading accuracy estimeate, degrees |
|
num_sv |
The number of satellites used in the current navigation solution. |
|
fix_type |
The type of fix currently provided |
|
t_acc |
The estimated timing accuracy from the GNSS receiver, nanoseconds. |
|
systime_drift |
The estimated drift between the system time, and GNSS time. Microseconds. |
|
pos_lat |
Latitude in degrees (WGS84 ellipsoid) |
|
pos_lon |
Longditude in degrees (WGS84 ellipsoid) |
|
ecef_x |
ECEF X coordinate, meters. |
|
ecef_y |
ECEF Y coordinate, meters. |
|
ecef_z |
ECEF Z coordinate, meters. |
IpConfig
Defines the IP configuration
Field |
Type |
Description |
---|---|---|
ip |
The IP address of the device. 4 bytes. 192.168.0.13 is encoded as ip[0]=192, ip[1]=168, ip[2]=0, ip[3]=13 |
|
netmask |
The netmask of the device. 4 bytes. 255.255.255.0 is encoded as netmask[0]=255, netmask[1]=255, netmask[2]=255, netmask[3]=0 |
|
gateway |
The gateway of the device. 4 bytes. 192.168.0.1 is encoded as gateway[0]=192, gateway[1]=168, gateway[2]=0, gateway[3]=1 |
PingReq
Request Ping response
The device will respond with a PingRes message.
PingRes
Ping response
ResetReq
Request reset of device.
The device will respond with a ResetRes message, and the device will reset.
ResetRes
Reset response
Field |
Type |
Description |
---|---|---|
status |
The status of the reset request |
SetIpConfigReq
Set IP configuration request
The device will respond with a SetIpConfigRes message. Depending on the connection used to send the request and the IP configuration set, the response may not be received.
Field |
Type |
Description |
---|---|---|
persist |
Persist the IP configuration to NVM |
|
ip_config |
The IP configuration to set |
|
dhcp_enable |
Enable DHCP |
SetIpConfigRes
Set IP configuration response
Field |
Type |
Description |
---|---|---|
status |
The status of the request |
DeviceType
Defines the type of device
Name |
Number |
Description |
---|---|---|
NOTSET |
0 |
|
WINGMAN |
1 |
Wingman man-borne RF sensor |
WATCHDOG |
2 |
Watchdog fixed RF direction finding sensor |
WOLFPACK |
3 |
Wolfpack fixed 360 degree RF direction finding sensor |
PITBULL |
8 |
Pitbull man-borne RF effector |
DOBERMANN |
9 |
Dobermann fixed RF effector |
DOBERMANN_DUAL |
12 |
Dobermann dual fixed 90 degree RF effector |
DOBERMANN360 |
13 |
Dobermann 360 degree RF effector |
FALCON |
14 |
Falcon air-borne RF direction finding sensor |
DhcpEnable
Defines the DHCP enable options
Name |
Number |
Description |
---|---|---|
DHCP_NO_CHANGE |
0 |
|
DHCP_DISABLE |
1 |
|
DHCP_ENABLE |
2 |
GnssFixType
The type of GNSS fix.
Name |
Number |
Description |
---|---|---|
GNSS_FIX_NONE |
0 |
No fix available. |
GNSS_FIX_2D |
2 |
2-dimensional fix. |
GNSS_FIX_3D |
3 |
3-dimensional fix. |
SysTimeStatus
Defines the state of the system time.
Name |
Number |
Description |
---|---|---|
VALID |
0 |
The system time is valid, and is currently being synchronized with GNSS. |
VALID_DRIFTING |
1 |
The system time was previously synchronized with GNSS, but is free-running with an estimated drift less than 100us. |
NOT_VALID |
2 |
The system time is free-running, with no synchronization. |
Scalar Value Types
.proto Type |
Notes |
C++ |
Java |
Python |
Go |
C# |
PHP |
Ruby |
---|---|---|---|---|---|---|---|---|
double |
double |
float |
float64 |
double |
float |
Float |
||
float |
float |
float |
float32 |
float |
float |
Float |
||
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. |
int32 |
int |
int |
int32 |
int |
integer |
Bignum or Fixnum (as required) |
|
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. |
int64 |
long |
int/long |
int64 |
long |
integer/string |
Bignum |
|
Uses variable-length encoding. |
uint32 |
int |
int/long |
uint32 |
uint |
integer |
Bignum or Fixnum (as required) |
|
Uses variable-length encoding. |
uint64 |
long |
int/long |
uint64 |
ulong |
integer/string |
Bignum or Fixnum (as required) |
|
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. |
int32 |
int |
int |
int32 |
int |
integer |
Bignum or Fixnum (as required) |
|
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. |
int64 |
long |
int/long |
int64 |
long |
integer/string |
Bignum |
|
Always four bytes. More efficient than uint32 if values are often greater than 2^28. |
uint32 |
int |
int |
uint32 |
uint |
integer |
Bignum or Fixnum (as required) |
|
Always eight bytes. More efficient than uint64 if values are often greater than 2^56. |
uint64 |
long |
int/long |
uint64 |
ulong |
integer/string |
Bignum |
|
Always four bytes. |
int32 |
int |
int |
int32 |
int |
integer |
Bignum or Fixnum (as required) |
|
Always eight bytes. |
int64 |
long |
int/long |
int64 |
long |
integer/string |
Bignum |
|
bool |
boolean |
boolean |
bool |
bool |
boolean |
TrueClass/FalseClass |
||
A string must always contain UTF-8 encoded or 7-bit ASCII text. |
string |
String |
str/unicode |
string |
string |
string |
String (UTF-8) |
|
May contain any arbitrary sequence of bytes. |
string |
ByteString |
str |
[]byte |
ByteString |
string |
String (ASCII-8BIT) |