Infrared signal library. More...
Go to the source code of this file.
Data Structures | |
| struct | InfraredRawSignal |
| Raw signal type definition. More... | |
Typedefs | |
| typedef struct InfraredSignal | InfraredSignal |
| InfraredSignal opaque type declaration. | |
Functions | |
| InfraredSignal * | infrared_signal_alloc (void) |
| Create a new InfraredSignal instance. | |
| void | infrared_signal_free (InfraredSignal *signal) |
| Delete an InfraredSignal instance. | |
| bool | infrared_signal_is_raw (const InfraredSignal *signal) |
| Test whether an InfraredSignal instance holds a raw signal. | |
| bool | infrared_signal_is_valid (const InfraredSignal *signal) |
| Test whether an InfraredSignal instance holds any signal. | |
| void | infrared_signal_set_signal (InfraredSignal *signal, const InfraredSignal *other) |
| Set an InfraredInstance to hold the signal from another one. | |
| void | infrared_signal_set_raw_signal (InfraredSignal *signal, const uint32_t *timings, size_t timings_size, uint32_t frequency, float duty_cycle) |
| Set an InfraredInstance to hold a raw signal. | |
| const InfraredRawSignal * | infrared_signal_get_raw_signal (const InfraredSignal *signal) |
| Get the raw signal held by an InfraredSignal instance. | |
| void | infrared_signal_set_message (InfraredSignal *signal, const InfraredMessage *message) |
| Set an InfraredInstance to hold a parsed signal. | |
| const InfraredMessage * | infrared_signal_get_message (const InfraredSignal *signal) |
| Get the parsed signal held by an InfraredSignal instance. | |
| InfraredErrorCode | infrared_signal_read (InfraredSignal *signal, FlipperFormat *ff, FuriString *name) |
| Read a signal and its name from a FlipperFormat file into an InfraredSignal instance. | |
| InfraredErrorCode | infrared_signal_read_name (FlipperFormat *ff, FuriString *name) |
| Read a signal name from a FlipperFormat file. | |
| InfraredErrorCode | infrared_signal_read_body (InfraredSignal *signal, FlipperFormat *ff) |
| Read a signal from a FlipperFormat file. | |
| InfraredErrorCode | infrared_signal_search_by_name_and_read (InfraredSignal *signal, FlipperFormat *ff, const char *name) |
| Read a signal with a particular name from a FlipperFormat file into an InfraredSignal instance. | |
| InfraredErrorCode | infrared_signal_search_by_index_and_read (InfraredSignal *signal, FlipperFormat *ff, size_t index) |
| Read a signal with a particular index from a FlipperFormat file into an InfraredSignal instance. | |
| InfraredErrorCode | infrared_signal_save (const InfraredSignal *signal, FlipperFormat *ff, const char *name) |
| Save a signal contained in an InfraredSignal instance to a FlipperFormat file. | |
| void | infrared_signal_transmit (const InfraredSignal *signal) |
| Transmit a signal contained in an InfraredSignal instance. | |
Infrared signal library.
Infrared signals may be of two types:
| InfraredSignal * infrared_signal_alloc | ( | void | ) |
Create a new InfraredSignal instance.
| void infrared_signal_free | ( | InfraredSignal * | signal | ) |
Delete an InfraredSignal instance.
| [in,out] | signal | pointer to the instance to be deleted. |
| const InfraredMessage * infrared_signal_get_message | ( | const InfraredSignal * | signal | ) |
Get the parsed signal held by an InfraredSignal instance.
| [in] | signal | pointer to the instance to be queried. |
| const InfraredRawSignal * infrared_signal_get_raw_signal | ( | const InfraredSignal * | signal | ) |
Get the raw signal held by an InfraredSignal instance.
| [in] | signal | pointer to the instance to be queried. |
| bool infrared_signal_is_raw | ( | const InfraredSignal * | signal | ) |
Test whether an InfraredSignal instance holds a raw signal.
| [in] | signal | pointer to the instance to be tested. |
| bool infrared_signal_is_valid | ( | const InfraredSignal * | signal | ) |
Test whether an InfraredSignal instance holds any signal.
| [in] | signal | pointer to the instance to be tested. |
| InfraredErrorCode infrared_signal_read | ( | InfraredSignal * | signal, |
| FlipperFormat * | ff, | ||
| FuriString * | name ) |
Read a signal and its name from a FlipperFormat file into an InfraredSignal instance.
The file must be allocated and open prior to this call. The seek position determines which signal will be read (if there is more than one in the file). Calling this function repeatedly will result in all signals in the file to be read until no more are left.
| [in,out] | signal | pointer to the instance to be read into. |
| [in,out] | ff | pointer to the FlipperFormat file instance to read from. |
| [out] | name | pointer to the string to hold the signal name. Must be properly allocated. |
| InfraredErrorCode infrared_signal_read_body | ( | InfraredSignal * | signal, |
| FlipperFormat * | ff ) |
Read a signal from a FlipperFormat file.
Same behaviour as infrared_signal_read(), but only the body is read.
| [in,out] | ff | pointer to the FlipperFormat file instance to read from. |
| [out] | signal | pointer to the InfraredSignal instance to hold the signal body. Must be properly allocated. |
| InfraredErrorCode infrared_signal_read_name | ( | FlipperFormat * | ff, |
| FuriString * | name ) |
Read a signal name from a FlipperFormat file.
Same behaviour as infrared_signal_read(), but only the name is read.
| [in,out] | ff | pointer to the FlipperFormat file instance to read from. |
| [out] | name | pointer to the string to hold the signal name. Must be properly allocated. |
| InfraredErrorCode infrared_signal_save | ( | const InfraredSignal * | signal, |
| FlipperFormat * | ff, | ||
| const char * | name ) |
Save a signal contained in an InfraredSignal instance to a FlipperFormat file.
The file must be allocated and open prior to this call. Additionally, an appropriate header must be already written into the file.
| [in] | signal | pointer to the instance holding the signal to be saved. |
| [in,out] | ff | pointer to the FlipperFormat file instance to write to. |
| [in] | name | pointer to a zero-terminated string contating the name of the signal. |
| InfraredErrorCode infrared_signal_search_by_index_and_read | ( | InfraredSignal * | signal, |
| FlipperFormat * | ff, | ||
| size_t | index ) |
Read a signal with a particular index from a FlipperFormat file into an InfraredSignal instance.
This function will look for a signal with the given index and if found, attempt to read it. Same considerations apply as to infrared_signal_read().
| [in,out] | signal | pointer to the instance to be read into. |
| [in,out] | ff | pointer to the FlipperFormat file instance to read from. |
| [in] | index | the requested signal index. |
| InfraredErrorCode infrared_signal_search_by_name_and_read | ( | InfraredSignal * | signal, |
| FlipperFormat * | ff, | ||
| const char * | name ) |
Read a signal with a particular name from a FlipperFormat file into an InfraredSignal instance.
This function will look for a signal with the given name and if found, attempt to read it. Same considerations apply as to infrared_signal_read().
| [in,out] | signal | pointer to the instance to be read into. |
| [in,out] | ff | pointer to the FlipperFormat file instance to read from. |
| [in] | name | pointer to a zero-terminated string containing the requested signal name. |
| void infrared_signal_set_message | ( | InfraredSignal * | signal, |
| const InfraredMessage * | message ) |
Set an InfraredInstance to hold a parsed signal.
Any instance's previous contents will be automatically deleted before copying the raw signal.
After this call, infrared_signal_is_raw() will return false.
| [in,out] | signal | pointer to the destination instance. |
| [in] | message | pointer to the message containing the parsed signal. |
| void infrared_signal_set_raw_signal | ( | InfraredSignal * | signal, |
| const uint32_t * | timings, | ||
| size_t | timings_size, | ||
| uint32_t | frequency, | ||
| float | duty_cycle ) |
Set an InfraredInstance to hold a raw signal.
Any instance's previous contents will be automatically deleted before copying the raw signal.
After this call, infrared_signal_is_raw() will return true.
| [in,out] | signal | pointer to the destination instance. |
| [in] | timings | pointer to an array containing the raw signal timings. |
| [in] | timings_size | number of elements in the timings array. |
| [in] | frequency | signal carrier frequency, in Hertz. |
| [in] | duty_cycle | signal duty cycle, fraction between 0 and 1. |
| void infrared_signal_set_signal | ( | InfraredSignal * | signal, |
| const InfraredSignal * | other ) |
Set an InfraredInstance to hold the signal from another one.
Any instance's previous contents will be automatically deleted before copying the source instance's contents.
| [in,out] | signal | pointer to the destination instance. |
| [in] | other | pointer to the source instance. |
| void infrared_signal_transmit | ( | const InfraredSignal * | signal | ) |
Transmit a signal contained in an InfraredSignal instance.
The transmission happens once per call using the built-in hardware (via HAL calls).
| [in] | signal | pointer to the instance holding the signal to be transmitted. |