Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add secure_packet_v1 for secure concentrators #194

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
25 changes: 25 additions & 0 deletions src/gps.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
syntax = "proto3";

package helium;

message wgs84_position {
// (deg) 1e-7 scale
sint32 latitude = 1;

// (deg) 1e-7 scale
sint32 longitude = 2;

// Height above ellipsoid (mm)
int32 height = 3;

// Horizontal accuracy estimate (mm)
uint32 hacc = 4;

// Vertical accuracy estimate (mm)
optional uint32 vacc = 5;
}

message gps_time {
// time of beacon was received by concentrator (nanoseconds since GPS Epoch) (can be used for TDOA)
uint64 gps_time = 1;
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub use prost::{DecodeError, EncodeError, Message};
pub mod services {
use crate::{
BlockchainRegionParamsV1, BlockchainTokenTypeV1, BlockchainTxn, DataRate, EntropyReportV1,
GatewayStakingMode, MapperAttach, Region, RoutingAddress,
GatewayStakingMode, MapperAttach, Region, RoutingAddress, GpsTime, Wgs84Position,
};

pub mod iot_config {
Expand Down
33 changes: 33 additions & 0 deletions src/packet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ syntax = "proto3";

package helium;

import "data_rate.proto";
import "gps.proto";

message eui {
uint64 deveui = 1;
uint64 appeui = 2;
Expand Down Expand Up @@ -36,3 +39,33 @@ message packet {
routing_information routing = 9;
window rx2_window = 10;
}

message secure_packet_v1 {
// frequency in Hz
uint64 freq = 1;

data_rate datarate = 2;

// Signal to Noise radio (0.01dB)
int32 snr = 3;

// Received Signal Strength Indicator (1 dBm)
sint32 rssi = 4;

// Internal timestamp of "RX finished" event
uint32 tmst = 5;

// Globally Unique identifier of Concentrator Card
bytes card_id = 6;

// time of beacon was received by concentrator (nanoseconds since GPS Epoch) (can be used for TDOA)
gps_time gps_time = 7;

wgs84_position pos = 8;

// packet payload
bytes data = 9;

// signature of the RX pkt signed by Secure Concentrator Card
bytes sc_signature = 10;
}
34 changes: 34 additions & 0 deletions src/service/packet_router.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,40 @@ message packet_router_packet_up_v1 {
bytes signature = 10;
}

message packet_router_packet_up_v2 {
// frequency in Hz
uint64 freq = 1;

data_rate datarate = 2;

// Signal to Noise radio (0.01dB)
sint32 snr = 3;

// Received Signal Strength Indicator (1 dBm)
sint32 rssi = 4;

// Internal timestamp of "RX finished" event
uint32 tmst = 5;

// Globally Unique identifier of Concentrator Card
bytes card_id = 6;

// time of beacon was received by concentrator (nanoseconds since GPS Epoch) (can be used for TDOA)
gps_time gps_time = 7;

wgs84_position pos = 8;

// packet payload
bytes data = 9;

// signature of the RX pkt signed by Secure Concentrator Card
bytes sc_signature = 10;

// signature from the gateway
bytes gw_signature = 11;

}

message packet_router_register_v1 {
uint64 timestamp = 1;
bytes gateway = 2;
Expand Down
17 changes: 17 additions & 0 deletions src/service/poc_lora.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package helium.poc_lora;

import "data_rate.proto";
import "gps.proto";

enum verification_status {
valid = 0;
Expand Down Expand Up @@ -39,6 +40,19 @@ enum invalid_reason {
duplicate = 20;
}

message secure_packet_v1 {

// Globally Unique identifier of Concentrator Card
bytes card_id = 1;

gps_time gps_time = 2;

wgs84_position pos = 3;

// signature of the RX pkt signed by Secure Concentrator Card
bytes sc_signature = 4;
}

// beacon report as submitted by gateway to ingestor
message lora_beacon_report_req_v1 {
bytes pub_key = 2;
Expand Down Expand Up @@ -75,6 +89,9 @@ message lora_witness_report_req_v1 {
uint64 frequency = 8;
data_rate datarate = 10;
bytes signature = 11;

// optional extra info used for secure concentrators
secure_packet_v1 secure_pkt = 12;
}

// response returned to gateway submitting witness report to ingestor
Expand Down