1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4 * Copyright (c) 2009-2019 Frank Meyer - frank(at)fli4l.de
5 * Copyright (c) 2009-2019 René Staffen - r.staffen(at)gmx.de
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *---------------------------------------------------------------------------------------------------------------------------------------------------
23 #ifndef IRMP_DLLEXPORT
25 #if defined WIN32 && defined _MSC_VER
26 # define IRMP_DLLEXPORT __declspec(dllimport)
28 # define IRMP_DLLEXPORT
30 #endif // !IRMP_DLLEXPORT
38 uint32_t protocol; ///< protocol, e.g. NEC_PROTOCOL
39 const char* protocolName; ///< name of the protocol
40 uint32_t address; ///< address
41 uint32_t command; ///< command
42 uint32_t flags; ///< flags currently only repetition (bit 0)
43 uint32_t startSample; ///< the sampleindex there the detected command started
44 uint32_t endSample; ///< the sampleindex there the detected command ended
49 * Returns the sample rate for that the irmp library was compiled for.
50 * Any data provided has resamble this sample rate or detection will fail.
52 IRMP_DLLEXPORT uint32_t IRMP_GetSampleRate(void);
55 * Resets the internal state of the detector
56 * This has to be called before start processing data.
58 IRMP_DLLEXPORT void IRMP_Reset(void);
61 * Feeds a single sample into the detecor.
62 * Returns 1 if a ir command was detected.
63 * Use IRMP_GetData to retrieve the data.
64 * Make sure, that Reset was called before adding first Sample.
66 IRMP_DLLEXPORT uint32_t IRMP_AddSample(const uint8_t i_sample);
70 * Proceses the given buffer and stops on the first found command and returns it data.
71 * Further calls resume the processing at the previously stopped position.
72 * Make sure, that Reset was called before first calling Detect.
74 IRMP_DLLEXPORT IRMP_DataExt IRMP_Detect(const uint8_t* i_buff, uint32_t i_len);
78 * If a valid IR frame was detected the provided output structure is filled
79 * \returns 1 if data was available, 0 else
81 IRMP_DLLEXPORT uint32_t IRMP_GetData(IRMP_DataExt* o_data);
83 /** returns the the name of the given protocol number */
84 IRMP_DLLEXPORT const char* IRMP_GetProtocolName(uint32_t i_protocol);
91 #endif // IRMP_SHARED_H