forked from theheraldproject/herald-for-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Part of theheraldproject#113. Added initial Mesh Protobuf message for…
…mats. Signed off by: Adam Fowler <[email protected]>
- Loading branch information
1 parent
2aee243
commit 98592fb
Showing
12 changed files
with
302 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Commands for Bluetooth MESH and ProtoBuf | ||
|
||
We use ProtoBuf messages to communicate to the mesh modem app from a USB controller device. | ||
We use similar messages over the wire on RabbitMQ to pass around commands and information | ||
to and from the controller host. | ||
|
||
We use protobuf as a language independent layer to define these messages. The primary | ||
source of these is the herald-for-cpp project and the proto files can be found under | ||
/herald/src/mesh/commands/*.proto. This is also where the C++ files are generated and | ||
vendored (stored). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2022 Herald Project Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// This file holds mesh level general purpose data formats | ||
// which may be used by mesh devices, or the mesh modem itself | ||
|
||
syntax = "proto3"; | ||
|
||
package io.heraldprox.sensor.mesh.messages.mesh; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
option cc_enable_arenas = true; | ||
|
||
// INITIAL CONNECTION FUNCTIONS | ||
|
||
message MeshGet { | ||
uint32 nodeId = 0; | ||
uint32 modelId = 0; | ||
uint32 fieldId = 0; | ||
} | ||
|
||
message MeshSet { | ||
uint32 nodeId = 0; | ||
uint32 modelId = 0; | ||
uint32 fieldId = 0; | ||
bool reply = false; | ||
} | ||
|
||
message MeshSubscribe { | ||
uint32 nodeId = 0; | ||
uint32 modelId = 0; | ||
uint32 activityId = 0; | ||
} | ||
|
||
message MeshUnsubscribe { | ||
uint32 nodeId = 0; | ||
uint32 modelId = 0; | ||
uint32 activityId = 0; | ||
} | ||
|
||
message MeshPublish { | ||
uint32 topicId = 0; | ||
|
||
repeated bytes message; | ||
} | ||
|
||
message MeshSend { | ||
uint32 nodeId = 0; | ||
uint32 modelId = 0; | ||
|
||
repeated bytes message; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2022 Herald Project Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// This file holds the message formats for data | ||
// being sent around the MESH by the Herald Mesh Models. | ||
// We do not include any administration messages here. | ||
|
||
syntax = "proto3"; | ||
|
||
package io.heraldprox.sensor.mesh.messages.models; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
option cc_enable_arenas = true; | ||
|
||
// A presence information message. E.g. a nearby Bluetooth | ||
// device has been detected. | ||
message Presence { | ||
// Variable Int encoding means we use max the first 6 bytes for the | ||
// Mac (uint8_t[6]) | ||
uint64 mac = 0; | ||
// RSSI is normally negative and single byte (int8) | ||
int32 rssi = 0; | ||
enum Status { | ||
OBSERVED = 0; | ||
IDENTIFIED = 1; | ||
VANISHED = 2; | ||
} | ||
Status status = 0; | ||
} | ||
|
Oops, something went wrong.