Skip to content

Commit

Permalink
Moved to new repo, updated for compatibility to 0.95.0-RC
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lee committed Nov 16, 2023
0 parents commit 83d453a
Show file tree
Hide file tree
Showing 72 changed files with 4,136 additions and 0 deletions.
191 changes: 191 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 99
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: BinPack
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: false
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 10
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: false
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: Never
SortJavaStaticImport: Before
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Never
SpaceBeforeParensOptions:
AfterControlStatements: false
AfterForeachMacros: false
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: false
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: c++03
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Flipper Zero Cross Remote

## Current State
- Infrared working
- Pause working
- SubGhz in Development
- Edit/Rename/Delete features in development

## What this is?
This app combines commands used in IR and SubGhz into playlists that can be run with one click
<br><br>

### What good is this?
Imagine you want to sit down and watch a movie after a long days work. <br>
Your probably do something like the following<br>
- Turn on your TV with the IR TV remote<br>
- Turn on your Bluray player with the Blueray IR remote<br>
- Turn on your surround sound with the speaker IR remote<br>
- Turn on your ceiling fan using a subGhz remote<br>
- Turn on your AC using another remote<br>
- etc<br>
<br>
Wouldn't it be nicer to simply click one button and let everything happen? This is what this app wants to do. <br>

### Features
- Select commands from saved subGhz transmissions
- Select commands registered with the IR App (choose from the created remote buttons)<br>
- Chain these commands using an easy UI<br>
- Save chained commands to a file<br>
- Add pauses, becaue target systems are not always fast enough for multiple commands<br>
- Run file containing chained IR & SubGhz commands<br>

## How to install on Flipper Zero
- If you do not have one, download a firmware<br>
- Plug your Flipper Zero in via USB. <br>
- Copy the contents of this folder into the applications_user folder of your firmware. <br>

Then run the command:
```
.\fbt launch_app APPSRC=applications_user/xremote
```
The application will be compiled and copied onto your device.

## Licensing
This code is open-source and may be used for whatever you want to do with it.
22 changes: 22 additions & 0 deletions application.fam
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
App(
appid="xremote",
name="Cross Remote",
apptype=FlipperAppType.EXTERNAL,
entry_point="xremote_app",
cdefines=["APP_XREMOTE"],
requires=[
"gui",
"storage",
"dialogs",
],
stack_size=3 * 1024,
order=10,
fap_libs=["assets"],
fap_icon="icons/xremote_10px.png",
fap_icon_assets="icons",
fap_version="0.8",
fap_category="Infrared",
fap_author="Leedave",
fap_description="One-Click, sends multiple commands",
fap_weburl="https://github.com/leedave/Leeds-Flipper-Zero-Applications"
)
22 changes: 22 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Cross Remote

This app combines your IR commands into a playlist that can be run with one click. Pauses can be set inbetween, as IR devices typically are not so fast.

## Features
- Read out commands you recorded in the IR app
- Combine commands to a chain/playlist
- Add pauses inbetween commands
- Save your command chain / playlist to flipper
- Disable LED effects if not wanted

## In Development
- Ability to also add SubGhz commands

## What good is this?

Example what you command chain (playlist) could do with one click
- Turn on your TV with the IR TV remote
- Turn on your Bluray player with the Blueray IR remote
- Turn on your surround sound with the speaker IR remote
- Turn on your ceiling fan using a subGhz remote
- Turn on your AC using another remote
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## v0.8

First release to Application Catalog
- IR Feature Working
- Pause Features Working
- Added warning for block missing SubGhz Features
76 changes: 76 additions & 0 deletions helpers/xremote_custom_event.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#pragma once

#include <stdint.h>
#include <stddef.h>

enum XRemoteCustomEventType {
// Reserve first 100 events for button types and indexes, starting from 0
XRemoteCustomEventMenuVoid,
XRemoteCustomEventMenuSelected,
XRemoteCustomEventMenuAddSelected,
XRemoteCustomEventMenuAddIrSelected,
};

#pragma pack(push, 1)
typedef union {
uint32_t packed_value;
struct {
uint16_t type;
int16_t value;
} content;
} XRemoteCustomEventMenu;
#pragma pack(pop)

typedef enum {
XRemoteCustomEventInfoscreenUp,
XRemoteCustomEventInfoscreenDown,
XRemoteCustomEventInfoscreenLeft,
XRemoteCustomEventInfoscreenRight,
XRemoteCustomEventInfoscreenOk,
XRemoteCustomEventInfoscreenBack,

XRemoteCustomEventCreateUp,
XRemoteCustomEventCreateDown,
XRemoteCustomEventCreateLeft,
XRemoteCustomEventCreateRight,
XRemoteCustomEventCreateOk,
XRemoteCustomEventCreateBack,

XRemoteCustomEventScene2Up,
XRemoteCustomEventScene2Down,
XRemoteCustomEventScene2Left,
XRemoteCustomEventScene2Right,
XRemoteCustomEventScene2Ok,
XRemoteCustomEventScene2Back,

XRemoteCustomEventTypePopupClosed,
XRemoteCustomEventTextInput,

XRemoteCustomEventPauseSetBack,
XRemoteCustomEventPauseSetUp,
XRemoteCustomEventPauseSetDown,
XRemoteCustomEventPauseSetOk,
} XRemoteCustomEvent;

static inline uint32_t xremote_custom_menu_event_pack(uint16_t type, int16_t value) {
XRemoteCustomEventMenu event = {.content = {.type = type, .value = value}};
return event.packed_value;
}

static inline void xremote_custom_menu_event_unpack(uint32_t packed_value, uint16_t* type, int16_t* value) {
XRemoteCustomEventMenu event = {.packed_value = packed_value};
if(type) *type = event.content.type;
if(value) *value = event.content.value;
}

static inline uint16_t xremote_custom_menu_event_get_type(uint32_t packed_value) {
uint16_t type;
xremote_custom_menu_event_unpack(packed_value, &type, NULL);
return type;
}

static inline int16_t xremote_custom_menu_event_get_value(uint32_t packed_value) {
int16_t value;
xremote_custom_menu_event_unpack(packed_value, NULL, &value);
return value;
}
Loading

0 comments on commit 83d453a

Please sign in to comment.