Modbus Vault v1.0
Loading...
Searching...
No Matches
modbus_parser.h File Reference

Parser for Modbus. More...

#include "esp_err.h"
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for modbus_parser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MODBUS_PARSER_MINIMUM_FRAME_LENGTH   (4)
 

Functions

esp_err_t modbus_parser_check_crc (const uint8_t *data_ptr, size_t length)
 Checks CRC16-Modbus of data validity.
 

Detailed Description

Parser for Modbus.

Author
Abanoub Salah

Provides CRC16 check abstraction for Modbus

Macro Definition Documentation

◆ MODBUS_PARSER_MINIMUM_FRAME_LENGTH

#define MODBUS_PARSER_MINIMUM_FRAME_LENGTH   (4)

Minimum Modbus frame: |Address|Function|CRC16_Lo|CRC16_Hi|

Function Documentation

◆ modbus_parser_check_crc()

esp_err_t modbus_parser_check_crc ( const uint8_t *  data_ptr,
size_t  length 
)

Checks CRC16-Modbus of data validity.

Parameters
data_ptrPointer to data
lengthData length
Returns
esp_err_t CRC check result
Return values
ESP_OKCRC OK
ESP_ERR_INVALID_ARGProvided invalid argument(s)
ESP_ERR_INVALID_SIZEData size invalid
ESP_ERR_INVALID_CRCCRC invalid
Here is the call graph for this function:
Here is the caller graph for this function: