Skip to content

Commit 64e66f8

Browse files
committed
Documentation
1 parent 946c8cd commit 64e66f8

File tree

6 files changed

+212
-137
lines changed

6 files changed

+212
-137
lines changed

Contributing.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Contribution Guidelines
22

33
This library is the culmination of the expertise of many members of the open source community who have dedicated their time and hard work.
4-
The best way to ask for help or propose a new idea is to create a new discussion and / or a new Pull Request
5-
with your code changes to allow you to share your own innovations with the rest of the community.
4+
5+
If you want to contribute to this project:
6+
- Report bugs and errors
7+
- Ask for enhancements
8+
- Create issues and pull requests
9+
- Tell other people about this library
10+
- Contribute new protocols
611

712
The following are some guidelines to observe when creating discussions / PRs:
813
- Be friendly; it is important that we can all enjoy a safe space as we are all working on the same project and **it is okay for people to have different ideas**.
@@ -11,3 +16,28 @@ The following are some guidelines to observe when creating discussions / PRs:
1116
In short: 4 spaces indentation, no tabs, opening braces on the same line, braces are mandatory on all if/while/do, no hard line length limit.
1217
To beautify your code, you may use the online formatter [here](https://www.freecodeformat.com/c-format.php).
1318
- Cover **all** occurences of the problem / addition you address with your PR. Do not forget the documentation like it is done for existing code. Code changes without proper documentation will be rejected!
19+
20+
## Adding new protocols
21+
To add a new protocol is quite straightforward. Best is too look at the existing protocols to find a similar one and modify it.<br/>
22+
As a rule of thumb, it is easier to work with a description of the protocol rather than trying to entirely reverse-engineer the protocol.
23+
Please include a link to the description in the header, if you found one.<br/>
24+
The **durations** you receive are likely to be longer for marks and shorter for spaces than the protocol suggests,
25+
but this depends on the receiver circuit in use. Most protocols use multiples of one time-unit for marks and spaces like e.g. [NEC](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_NEC.hpp#L62). It's easy to be off-by-one with the last bit, since the last space is not recorded by IRremote.
26+
27+
Try to make use of the template functions `decodePulseDistanceData()` and `sendPulseDistanceData()`.
28+
If your protocol supports address and code fields, try to reflect this in your api like it is done in [`sendNEC(uint16_t aAddress, uint8_t aCommand, uint_fast8_t aNumberOfRepeats, bool aIsRepeat)`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_NEC.hpp#L96)
29+
and [`decodeNEC()`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_NEC.hpp#L194).<br/>
30+
31+
### Integration
32+
To integrate your protocol, you need to extend the two functions `decode()` and `getProtocolString()` in *IRreceice.hpp*,
33+
add macros and function declarations for sending and receiving and extend the `enum decode_type_t` in *IRremote.h*.<br/>
34+
And at least it would be wonderful if you can provide an example how to use the new protocol.
35+
A detailed description can be found in the [ir_Template.hpp](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_Template.hpp#L11) file.
36+
37+
### Creating API documentation
38+
To generate the API documentation, Doxygen, as well as [Graphviz](http://www.graphviz.org/) should be installed.
39+
(Note that on Windows, it is useful to specify the installer to add Graphviz to PATH or to do it manually.
40+
With Doxygen and Graphviz installed, issue the command
41+
`doxygen` from the command line in the main project directory, which will
42+
generate the API documentation in HTML format.
43+
The just generated `docs/index.html` can now be opened in a browser.

Contributors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ These are the active contributors of this project that you may contact if there
2525
- [eshicks4](https://github.com/eshicks4)
2626
- [Jim-2249](https://github.com/Jim-2249)
2727
- [pmalasp](https://github.com/pmalasp )
28-
28+
- [ElectronicsArchiver}(https://github.com/ElectronicsArchiver) improving documentation
2929

3030
Note: Please let [ArminJo](https://github.com/ArminJo) know if you have been missed.

0 commit comments

Comments
 (0)