RFS API

The RFS component defines the functionality of a RF sensor device, and it is specified in src/protobuf/mdif/rfs/rfs.proto.

Protobuf specification

The following documentation is generated from the Protobuf specification in src/protobuf/mdif/rfs/rfs.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/rfs/rfs.proto

Message allocation for the RFS component are in the range:

Start

End

Radix

0x80

0x9F

Hex

128

159

Dec

RfsService

Defines the relationship between requests and responses in the RFS component

Method Name

Request Type

Response Type

Description

Start

StartReq

StartRes

Use to start the RFS detection algorithms

Stop

StopReq

StopRes

Use to stop the RFS detection algorithms

GetDroneInfo

GetDroneInfoReq

GetDroneInfoRes

Use to get individual drone info

RemoteIdStream

RemoteIdStreamReq

RemoteIdStreamRes

Use to request a stream of remote ID messages.

DroneInfo

Description of a drone.

Field

Type

Description

type_id

uint32

Identifier for detection filter

type_id_name

string

Name of RF protocol/Family (e.g Lightbridge)

drone_name

string

Name of drone(s) (e.g Phantom 3)

vendor_id

uint32

Identifier to rf emitter vendor (e.g 1)

vendor_id_name

string

Name of rf emitter vendor (e.g DJI)

category_id

uint32

Identifier of rf emitter category drone/controller/wifi (e.g 1)

category_id_name

string

Name of rf emitter category (e.g Drone)

band

ScanBand

Bands where detector looks (e.g 2G4 and 5G8)

GetDroneInfoReq

Get individual drone description, just in time or loop through and build library.

Field

Type

Description

type_id

uint32

Id of detection filter associated with drone. 0 is first in library.

GetDroneInfoRes

Response to GetDroneInfoReq

Field

Type

Description

status

mdif.common.Status

drone_info

DroneInfo

Description of drone.

next_drone_type_id

uint32

Id to next drone, 0 indicates end of library.

GetDronelistReq

Get drone descriptions for all drones in target device library. Deprecated, use GetDroneInfoReq instead

GetDronelistRes

Response to GetDronelistReq Deprecated

Field

Type

Description

status

mdif.common.Status

drone_info

DroneInfo

RemoteIdInd

Remote ID indication with binary message pack.

Field

Type

Description

mac_adr

bytes

MAC address from which the remote ID was received.

payload

bytes

Remote ID message pack, as per ASTM-F3411

RemoteIdStreamReq

Request that remote ID results be streamed from the device.

Field

Type

Description

enable

bool

Enable or disable the stream.

RemoteIdStreamRes

Response to RemoteIdStreamReq.

Field

Type

Description

status

mdif.common.Status

Status of the request.

RfsMsg

Rfs wire format messages

This message dictates the final format on the wire for rfs 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 RfsService through RPC patterns.

Indications (ind) are pushed without a request at any time

Field

Type

Description

start_req

StartReq

Request RFS start

start_res

StartRes

RFS start response

stop_req

StopReq

Request RFS stop

stop_res

StopRes

RFS stop response

get_dronelist_req

GetDronelistReq

Deprecated. use GetDroneInfoReq instead

get_dronelist_res

GetDronelistRes

Deprecated.

get_drone_info_req

GetDroneInfoReq

Get individual drone info

get_drone_info_res

GetDroneInfoRes

Individual drone info response

rfs_threat_ind

RfsThreatInd

RFS threat indication

wifi_threat_ind

WifiThreatInd

Wifi threat indication

threat_stopped_ind

ThreatStoppedInd

Threat stopped indication

remote_id_stream_req

RemoteIdStreamReq

Remote drone ID stream start - Request

remote_id_stream_res

RemoteIdStreamRes

Remote Drone ID stream start - Response

remote_id_ind

RemoteIdInd

Remote Drone ID detection - Indication

RfsThreatInd

Post rfs threat indication.

Field

Type

Description

id

uint32

Instance of detection thread.

type_id

uint32

Detection type id.

start_time

uint32

Start time of detection thread.

power

float

Power at time of reporting.

current_band

ScanBand

Band(s) where detected occurs.

relative_bearing

RfsThreatInd.RelativeBearing

Relative bearing of rfs at time of reporting.

last_seen

uint32

Last time of detection

msg_timestamp

float

Time message is compiled.

RfsThreatInd.RelativeBearing

Field

Type

Description

valid

bool

Valid when applicable.

bearing

float

Calculated Bearing.

var_bearing

float

Variance in bearing.

timestamp

float

Time bearing is calculated.

StartReq

Request RFS start detection.

StartRes

Response to StartReq

Field

Type

Description

status

mdif.common.Status

StopReq

Request RFS stop detection.

StopRes

Response to StopReq

Field

Type

Description

status

mdif.common.Status

ThreatStoppedInd

Post stop of threat indication.

Field

Type

Description

id

uint32

Instance of detection thread.

msg_timestamp

float

Time message is compiled.

WifiThreatInd

Post wifi threat indication.

Field

Type

Description

id

uint32

Instance of detection thread.

type_id

uint32

Detection type id.

start_time

uint32

Start time of detection thread.

power

float

Power at time of reporting.

channel

uint32

Wifi channel as per international standards 802.11 a/b/g/n.

mac_adr

bytes

Mac address of wifi threat.

msg_timestamp

float

Time message is compiled.

ScanBand

Enumeration of frequncies bands scanned.

Name

Number

Description

Invalid

0

Default, before overwriting with detection band.

MHz433

1

ISM band ~433

MHz900

2

ISM band ~900

MHz1200

3

ISM band 1G2

MHz2400

4

ISM band 2G4

MHz5800

5

ISM band 5G8

MHz5200

6

ISM band 5G2

StartMode

Enumeration of possible start-modes.

Name

Number

Description

Default

0

RFS runs on internal antenna and external if present

ExtAntOnly

1

RFS runs on external antenna only. Will signal error if not present

IntAntOnly

2

RFS runs on internal antenna only, even if external is present

UAVModeSearch

3

RFS runs on internal antenna in search/direction finding mode

Scalar Value Types

.proto Type

Notes

C++

Java

Python

Go

C#

PHP

Ruby

double

double

double

float

float64

double

float

Float

float

float

float

float

float32

float

float

Float

int32

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)

int64

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

uint32

Uses variable-length encoding.

uint32

int

int/long

uint32

uint

integer

Bignum or Fixnum (as required)

uint64

Uses variable-length encoding.

uint64

long

int/long

uint64

ulong

integer/string

Bignum or Fixnum (as required)

sint32

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)

sint64

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

fixed32

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)

fixed64

Always eight bytes. More efficient than uint64 if values are often greater than 2^56.

uint64

long

int/long

uint64

ulong

integer/string

Bignum

sfixed32

Always four bytes.

int32

int

int

int32

int

integer

Bignum or Fixnum (as required)

sfixed64

Always eight bytes.

int64

long

int/long

int64

long

integer/string

Bignum

bool

bool

boolean

boolean

bool

bool

boolean

TrueClass/FalseClass

string

A string must always contain UTF-8 encoded or 7-bit ASCII text.

string

String

str/unicode

string

string

string

String (UTF-8)

bytes

May contain any arbitrary sequence of bytes.

string

ByteString

str

[]byte

ByteString

string

String (ASCII-8BIT)