IRPyro messaging application
Communications program between IRPyro and IRPyro evaluation tool
|
IRPyro evaluation tool with API integration. More...
#include "message_unpack.h"
Go to the source code of this file.
Data Structures | |
struct | command_table |
Macros | |
#define | CMD_BUFFER_SIZE 20 |
#define | PAYLOAD_SIZE 7 |
Enumerations | |
enum | decode_state_type { initialize, get_payload, error_report, complete } |
Functions | |
static void | assign_cmd_code (void) |
on valid crc assigns cmd_code More... | |
static uint8_t | byte_get (uint8_t *output_byte) |
gets a byte from the UART or the byte array More... | |
static void | decode_result_assign (void) |
evaluates the result More... | |
static void | fn_decode_complete (void) |
sets the completion flag and the next state More... | |
static void | fn_decode_error_report (void) |
sets the error flag More... | |
static void | fn_decode_initialize (void) |
On success returns a buffer with command and payload (if any) More... | |
static void | fn_decode_payload_get (void) |
fills the payload buffer if the command requires it More... | |
decode_result_type | message_unpack_decode (void) |
FSM to decode a received command If the command is valid, the command code and the payload (if any) are made available for the caller function. More... | |
void | message_unpack_result (uint8_t *cmd_code_result, uint8_t *sensor_destination, uint8_t *cmd_payload) |
gives access to the command code and the corresponding payload (if any) More... | |
static void | payload_get (uint8_t *payload, uint8_t const *cmd_buffer, uint8_t cmd_tab_idx) |
gets the payload from a command buffer array coming from the GUI More... | |
static void | process_next_byte (void) |
gets the next byte to process More... | |
static void | process_stream (void) |
process stream until crc checks or fails More... | |
static void | search_for_command (void) |
looks for a command in the byte stream More... | |
Variables | |
uint8_t | cmd_buffer [CMD_BUFFER_SIZE] = {0} |
uint8_t | cmd_completed |
uint8_t | cmd_empty |
uint8_t | cmd_error |
uint8_t | cmd_input |
uint8_t | cmd_search_result |
uint8_t | continue_process_stream |
uint8_t | crc_calc |
uint8_t | get_char_result |
uint8_t | idx_buffer |
static const struct command_table | IRPyro_cmd [CMD_LIST_SIZE] |
uint8_t | max_reads |
decode_state_type | next_state |
decode_result_type | op_result |
uint8_t | payload_array [PAYLOAD_SIZE] = {0} |
IRPyro evaluation tool with API integration.
=============================================================================== ##### Description ##### =============================================================================== [..] From a stream of command bytes coming from a GUI the byte indicating a command is found and broken down in it main components: wild card (sensor/ sensors to be applied), payload and crc. [..]
Copyright (c) 2018, _KEMET, Ltd All rights reserved. THIS SOFTWARE IS PROVIDED BY _KEMET, Ltd ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL _KEMET, Ltd BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file message_unpack.c.