You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
6
11
7
12
The following are some guidelines to observe when creating discussions / PRs:
8
13
- 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:
11
16
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.
12
17
To beautify your code, you may use the online formatter [here](https://www.freecodeformat.com/c-format.php).
13
18
- 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.
0 commit comments