Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tool to convert protocol & code to raw timing info. #1708

Merged
merged 3 commits into from
Dec 23, 2021

Conversation

crankyoldgit
Copy link
Owner

Usage: code_to_raw --protocol PROTOCOL_NAME --code <hexidecimal> [--bits 1-424] [--timinginfo]

e.g.

# Convert an A/C code to rawData[] & Timinginfo
tools/code_to_raw --protocol KELVINATOR --code 0x190B8050000000E0190B8070000010F0 --timinginfo

# Convert a Samsung TV code to rawData[].
tools/code_to_raw --protocol SAMSUNG --code 0xE0E09966

# Convert a Sony 12 bit message to rawData[].
tools/code_to_raw --protocol Sony --code 0xf50 --bits 12

For #1707
For #1703

Usage: tools/code_to_raw --protocol PROTOCOL_NAME --code <hexidecimal> [--bits 1-424] [--timinginfo]

e.g.
```
# Convert an A/C code to rawData[] & Timinginfo
tool/code_to_raw --protocol KELVINATOR --code 0x190B8050000000E0190B8070000010F0 --timinginfo

# Convert a Samsung TV code to rawData[].
tools/code_to_raw --protocol SAMSUNG --code 0xE0E09966
# Convert a Sony 12 bit message to rawData[].
tools/code_to_raw --protocol Sony --code 0xf50 --bits 12
```

For #1707
For #1703
Copy link
Collaborator

@PtilopsisLeucotis PtilopsisLeucotis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tool and great work!

Copy link
Collaborator

@NiKiZe NiKiZe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have a minimal test for the tool as well?

tools/Makefile Outdated
Comment on lines 83 to 88
%_decode : $(COMMON_OBJ) %_decode.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@

code_to_raw : $(COMMON_OBJ) code_to_raw.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move down _decode and change to % to cover both cases

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I can easily do that with Make's wildcards. If you know how, I'm all ears.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't that easy, but I think I got a working solution, pushed commit 8bb8c6e to PR branch

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks. Looks good to me.

@crankyoldgit
Copy link
Owner Author

Maybe we can have a minimal test for the tool as well?

Yep. I've added some end-to-end tests.

@crankyoldgit crankyoldgit requested a review from NiKiZe December 23, 2021 05:19
@NiKiZe
Copy link
Collaborator

NiKiZe commented Dec 23, 2021

Didn't find any good way to share Makefile changes, so pushed to the PR, hopefully @crankyoldgit don't get to mad on me for doing that.

Please review, maybe it is some magic in the Makefile now that breaks somewhere, but seems to be standard stuff.

@crankyoldgit
Copy link
Owner Author

Didn't find any good way to share Makefile changes, so pushed to the PR, hopefully @crankyoldgit don't get to mad on me for doing that.

Please review, maybe it is some magic in the Makefile now that breaks somewhere, but seems to be standard stuff.

Haha. No need to hope. Why on earth would I be mad about that?!? :-)

@crankyoldgit crankyoldgit merged commit 705c8c4 into master Dec 23, 2021
@NiKiZe
Copy link
Collaborator

NiKiZe commented Dec 23, 2021

hopefully @crankyoldgit don't get to mad on me for doing that.

Haha. No need to hope. Why on earth would I be mad about that?!? :-)

😁 Just wanted to convey that I avoid to change PRs and know that it can be a touch subject for some. ;)

@crankyoldgit crankyoldgit deleted the code_to_raw branch December 24, 2021 06:14
crankyoldgit added a commit that referenced this pull request Dec 31, 2021
_v2.8.1 (20220101)_

**[Bug Fixes]**
- Arduino ESP32 Core v2.0.2+ crashes due to our timer hack. (#1715 #1715)
- SONY: Fix old Sony CD-Player Remote (12 Bit) (#1714)

**[Features]**
- Add tool to convert protocol & code to raw timing info. (#1708 #1707 #1703)
- Add basic support for COOLIX48 protocol. (#1697 #1694)
- MITSUBISHI_AC: Added support for i-SAVE mode. (#1666)
- TOSHIBA_AC: Add Filter setting support. aka. Pure. (#1693 #1692)
- Airton: Add detailed A/C support. (#1688 #1670)

**[Misc]**
- Add a structured library version number. (#1717)
- Workflows Split UnitTests (#1712)
- Reduce time for workflow/Build (#1709)
- Fix some compiler & linter warnings (#1699 #1700)
- Fujitsu: Update supported A/C models (#1690 #1689 #1702 #1701)
- Remove extra `const` qualifier for char pointer (#1704)
- TCL: Update supported devices. (#1698)
- ESP32-C3: Work around for some C3 specific compiler issues. (#1696 #1695)
@crankyoldgit crankyoldgit mentioned this pull request Dec 31, 2021
crankyoldgit added a commit that referenced this pull request Jan 1, 2022
## _v2.8.1 (20220101)_

**[Bug Fixes]**
- Arduino ESP32 Core v2.0.2+ crashes due to our timer hack. (#1715 #1713 )
- SONY: Fix old Sony CD-Player Remote (12 Bit) (#1714)

**[Features]**
- Add tool to convert protocol & code to raw timing info. (#1708 #1707 #1703)
- Add basic support for COOLIX48 protocol. (#1697 #1694)
- MITSUBISHI_AC: Added support for i-SAVE mode. (#1666)
- TOSHIBA_AC: Add Filter setting support. aka. Pure. (#1693 #1692)
- Airton: Add detailed A/C support. (#1688 #1670)

**[Misc]**
- Add a structured library version number. (#1717)
- Workflows Split UnitTests (#1712)
- Reduce time for workflow/Build (#1709)
- Fix some compiler & linter warnings (#1699 #1700)
- Fujitsu: Update supported A/C models (#1690 #1689 #1702 #1701)
- Remove extra `const` qualifier for char pointer (#1704)
- TCL: Update supported devices. (#1698)
- ESP32-C3: Work around for some C3 specific compiler issues. (#1696 #1695)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants