From 43a2c87c61573fbeb1df0e47aa8f9de9072eda17 Mon Sep 17 00:00:00 2001 From: christianrowlands Date: Sun, 18 Aug 2024 20:16:27 -0400 Subject: [PATCH] Adds support for streaming phone state and bluetooth messages over gRPC --- README.md | 7 +++---- .../craxiom/messaging/grpc/wireless_survey.proto | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4d4babd..aa187a6 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ To publish a new version of the Network Survey Messaging API HTML page, use the This will overwrite the current HTML content from the docs directory with the last API definition from the yaml file. -#### Building the protobuf Java and Python libraries +#### Building the protobuf Java library The Java library is built and published with Java 8 to support older Android versions, however it can be built with Java 11 if needed. @@ -111,9 +111,8 @@ Generated code is here: - Java: build/generated/source/proto/main/java/com/craxiom/messaging - Python: build/generated/source/proto/main/python/com/craxiom/messaging -#### Generating Go code -The Go code is generated using the `protoc` compiler. The `protoc` compiler can be installed using the following command: - - `brew install protobuf` +## Generating Go code +The Go code is generated using the `protoc` compiler. The Go code is generated using the following command: - `protoc --go_out=go/ --go_opt=paths=source_relative --go-grpc_out=go/ --go-grpc_opt=paths=source_relative src/main/proto/*.proto` diff --git a/src/main/proto/com/craxiom/messaging/grpc/wireless_survey.proto b/src/main/proto/com/craxiom/messaging/grpc/wireless_survey.proto index 6d1bdbd..9d91a6d 100644 --- a/src/main/proto/com/craxiom/messaging/grpc/wireless_survey.proto +++ b/src/main/proto/com/craxiom/messaging/grpc/wireless_survey.proto @@ -15,11 +15,13 @@ import "com/craxiom/messaging/cdma_record.proto"; import "com/craxiom/messaging/umts_record.proto"; import "com/craxiom/messaging/lte_record.proto"; import "com/craxiom/messaging/nr_record.proto"; +import "com/craxiom/messaging/phone_state.proto"; import "com/craxiom/messaging/lte_rrc.proto"; import "com/craxiom/messaging/lte_nas.proto"; import "com/craxiom/messaging/wifi_beacon_record.proto"; import "com/craxiom/messaging/wifi_probe_request_record.proto"; import "com/craxiom/messaging/wifi_ota_record.proto"; +import "com/craxiom/messaging/bluetooth_record.proto"; import "com/craxiom/messaging/gnss_record.proto"; import "com/craxiom/messaging/energy_detection.proto"; import "com/craxiom/messaging/signal_detection.proto"; @@ -39,12 +41,16 @@ service WirelessSurvey { } rpc StreamNrSurvey (stream NrRecord) returns (NrSurveyResponse) { } + rpc StreamPhoneState (stream PhoneState) returns (PhoneStateResponse) { + } rpc StreamWifiBeaconSurvey (stream WifiBeaconRecord) returns (WifiBeaconSurveyResponse) { } rpc StreamWifiProbeRequestSurvey (stream WifiProbeRequestRecord) returns (WifiProbeRequestSurveyResponse) { } rpc StreamWifiOtaSurvey (stream WifiOtaRecord) returns (WifiOtaSurveyResponse) { } + rpc StreamBluetoothSurvey (stream BluetoothRecord) returns (BluetoothSurveyResponse) { + } rpc StreamGnssSurvey (stream GnssRecord) returns (GnssSurveyResponse) { } rpc StreamEnergyDetections (stream EnergyDetection) returns (EnergyDetectionResponse) { @@ -77,6 +83,10 @@ message NrSurveyResponse { } +message PhoneStateResponse { + +} + message WifiBeaconSurveyResponse { } @@ -89,6 +99,10 @@ message WifiOtaSurveyResponse { } +message BluetoothSurveyResponse { + +} + message GnssSurveyResponse { }