mirror of https://github.com/infosecn1nja/C3.git
Update CONTRIBUTING.md
parent
42b284e114
commit
0f8a7686a3
|
@ -213,11 +213,15 @@ ByteVector TestCommand(ByteView args)
|
|||
|
||||
The `TestCommand` method adds a debug text entry to C3’s *Log*. `DebugInformation` is used which is rendered in a Relay’s console window only when compiled in debug mode. The message consists of two elements: a hard-coded text "Custom Command : " and a string that is provided by a user in the UI. Note the use of the `OBF` macro, this is used to encrypt strings at compile-time, which are decrypted at run-time only when required. Also of note is that the `TestCommand` handler returns an empty `MWR::ByteVector` as there’s nothing to send back to the Gateway.
|
||||
|
||||
**Note:** The `GetCapability` method is compiled only when building Gateway’s executable and therefor it’s not required to use the `OBF` macro to obfuscate its strings.
|
||||
|
||||
After rebuilding the solution once again and launching C3 the Test Command becomes available in `MyChannel’s` Command Center:
|
||||
|
||||
![C3](Res/ContributionGuide/11.png)
|
||||
![C3](Res/ContributionGuide/12.png)
|
||||
|
||||
**Note:** C3 can be launched in a debug mode by running `dotnet run -c Debug` console command from the *Src/WebController/Backend* location. Debug mode enables Node Relay’s console window, allowing to read their local C3 *Log*.
|
||||
|
||||
### Putting it all Together
|
||||
|
||||
After developing a functionally working channel, the next stage is to refactor the code. The `MyChannel` type is still quite small, but for larger classes it’s common to split the implementation between a header and a compilation unit file. For `MyChannel` this involves adding a new *MyChannel.h* file in the same location as *MyChannel.cpp*. This also involves embracing the channel with the appropriate namespace declaration - `MWR::C3::Interfaces::Channels`. Finally, doxygen-style documentation is added to improve readability. *MyChannel.h* is then as such:
|
||||
|
|
Loading…
Reference in New Issue