-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BusConfig, which allows detailed configuration of the PJON backend.
Also changed default bus configuration to be compatible to PJON defaults
- Loading branch information
1 parent
63d7519
commit b844e83
Showing
4 changed files
with
73 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace PjonHL | ||
{ | ||
|
||
/// Struct representing a PJON bus configuration. All participants in a network | ||
/// should have the same configuration. | ||
/// You can optionally pass an instance of the BusConfig into the PjonHL constructor. | ||
/// All config options will be forwarded to the PJON backend. | ||
/// For detailed documentation please have a look at the PJON protocol spec. | ||
struct BusConfig | ||
{ | ||
enum class BusTopology | ||
{ | ||
Local, | ||
Shared | ||
}; | ||
|
||
enum class AckType | ||
{ | ||
AckEnabled, | ||
AckDisabled | ||
}; | ||
|
||
enum class CommunicationMode | ||
{ | ||
Simplex, | ||
HalfDuplex | ||
}; | ||
|
||
enum class CrcType | ||
{ | ||
Crc8, | ||
Crc32 | ||
}; | ||
|
||
BusTopology busTopology = BusTopology::Local; | ||
CommunicationMode communicationMode = CommunicationMode::HalfDuplex; | ||
AckType ackType = AckType::AckEnabled; | ||
CrcType crcType = CrcType::Crc8; | ||
|
||
// Mac not yet suppored | ||
}; | ||
|
||
} |
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