Loading...
Searching...
No Matches
infrared_brute_force.h File Reference

Infrared signal brute-forcing library. More...

#include <stdint.h>
#include <stdbool.h>
#include "infrared_error_code.h"

Go to the source code of this file.

Typedefs

typedef struct InfraredBruteForce InfraredBruteForce
 InfraredBruteForce opaque type declaration.
 

Functions

InfraredBruteForceinfrared_brute_force_alloc (void)
 Create a new InfraredBruteForce instance.
 
void infrared_brute_force_free (InfraredBruteForce *brute_force)
 Delete an InfraredBruteForce instance.
 
void infrared_brute_force_set_db_filename (InfraredBruteForce *brute_force, const char *db_filename)
 Set an InfraredBruteForce instance to use a signal database contained in a file.
 
InfraredErrorCode infrared_brute_force_calculate_messages (InfraredBruteForce *brute_force)
 Build a signal dictionary from a previously set database file.
 
bool infrared_brute_force_start (InfraredBruteForce *brute_force, uint32_t index, uint32_t *record_count)
 Start transmitting signals from a category stored in the dictionary.
 
bool infrared_brute_force_is_started (const InfraredBruteForce *brute_force)
 Determine whether the transmission was started.
 
void infrared_brute_force_stop (InfraredBruteForce *brute_force)
 Stop transmitting the signals.
 
bool infrared_brute_force_send (InfraredBruteForce *brute_force, uint32_t signal_index)
 Send an arbitrary signal from the chosen category.
 
void infrared_brute_force_add_record (InfraredBruteForce *brute_force, uint32_t index, const char *name)
 Add a signal category to an InfraredBruteForce instance's dictionary.
 
void infrared_brute_force_reset (InfraredBruteForce *brute_force)
 Reset an InfraredBruteForce instance.
 

Detailed Description

Infrared signal brute-forcing library.

The BruteForce library is used to send large quantities of signals, sorted by a category. It is used to implement the Universal Remote feature.

Function Documentation

◆ infrared_brute_force_add_record()

void infrared_brute_force_add_record ( InfraredBruteForce * brute_force,
uint32_t index,
const char * name )

Add a signal category to an InfraredBruteForce instance's dictionary.

Parameters
[in,out]brute_forcepointer to the instance to be updated.
[in]indexindex of the category to be added.
[in]namename of the category to be added.

◆ infrared_brute_force_alloc()

InfraredBruteForce * infrared_brute_force_alloc ( void )

Create a new InfraredBruteForce instance.

Returns
pointer to the created instance.

◆ infrared_brute_force_calculate_messages()

InfraredErrorCode infrared_brute_force_calculate_messages ( InfraredBruteForce * brute_force)

Build a signal dictionary from a previously set database file.

This function must be called each time after setting the database via a infrared_brute_force_set_db_filename() call.

Parameters
[in,out]brute_forcepointer to the instance to be updated.
Returns
InfraredErrorCodeNone on success, otherwise error code.

◆ infrared_brute_force_free()

void infrared_brute_force_free ( InfraredBruteForce * brute_force)

Delete an InfraredBruteForce instance.

Parameters
[in,out]brute_forcepointer to the instance to be deleted.

◆ infrared_brute_force_is_started()

bool infrared_brute_force_is_started ( const InfraredBruteForce * brute_force)

Determine whether the transmission was started.

Parameters
[in]brute_forcepointer to the instance to be tested.
Returns
true if transmission was started, false otherwise.

◆ infrared_brute_force_reset()

void infrared_brute_force_reset ( InfraredBruteForce * brute_force)

Reset an InfraredBruteForce instance.

Parameters
[in,out]brute_forcepointer to the instance to be reset.

◆ infrared_brute_force_send()

bool infrared_brute_force_send ( InfraredBruteForce * brute_force,
uint32_t signal_index )

Send an arbitrary signal from the chosen category.

Parameters
[in]brute_forcepointer to the instance
signal_indexthe index of the signal within the category, must be between 0 and record_count as told by infrared_brute_force_start
Returns
true on success, false otherwise

◆ infrared_brute_force_set_db_filename()

void infrared_brute_force_set_db_filename ( InfraredBruteForce * brute_force,
const char * db_filename )

Set an InfraredBruteForce instance to use a signal database contained in a file.

Parameters
[in,out]brute_forcepointer to the instance to be configured.
[in]db_filenamepointer to a zero-terminated string containing a full path to the database file.

◆ infrared_brute_force_start()

bool infrared_brute_force_start ( InfraredBruteForce * brute_force,
uint32_t index,
uint32_t * record_count )

Start transmitting signals from a category stored in the dictionary.

The function locates the category identified by index, reports the number of records it contains via record_count, and prepares the brute-force instance to transmit those signals. On failure record_count is set to zero.

Parameters
[in,out]brute_forcepointer to the instance to be started.
[in]indexindex of the signal category in the dictionary.
[out]record_countpointer that receives the number of records in the category.
Returns
true if the category is found and the backing database file is opened, false otherwise.

◆ infrared_brute_force_stop()

void infrared_brute_force_stop ( InfraredBruteForce * brute_force)

Stop transmitting the signals.

Parameters
[in]brute_forcepointer to the instance to be stopped.