<commit_before>﻿/**
 * Implementation of the Modbus protocol
 *
 * Copyright (c) 2017, <NAME>
 * All rights reserved.
 *
 * This software may be modified and distributed under the terms of the BSD license.
 * See LICENSE.txt for more details.
 *
 */


#ifndef MODBUS_H
#define MODBUS_H

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>

//--------------------------------------------------------------------------
// Definitions 
//--------------------------------------------------------------------------

#define MB_PACKET_ERROR_SIZE    -1
#define MB_PACKET_ERROR_CRC     -2
#define MB_PACKET_ERROR_ADDR    -3
#define MB_PACKET_ERROR_UNKOWN  -4

/* Official modbus errors */
#define MODBUS_NO_ERROR             0
#define MODBUS_ILLEGAL_FUNCTION     1
#define MODBUS_ILLEGAL_ADDRESS      2
#define MODBUS_ILLEGAL_DATA_VALUE   3
#define MODBUS_DEVICE_FAILURE       4
#define MODBUS_ACKNOWLEDGE          5
#define MODBUS_DEVICE_BUSY          6
#define MODBUS_NO_ACKNOWLEDGE       7
#define MODBUS_WRITE_ERROR          8
#define MODBUS_OVERLAPPED_AREA      9

/* Définitions MODBUS */
#define MAX_WORD_TO_READ      125
#define MAX_WORD_TO_WRITE     123
#define MAX_MODBUS_LENGTH     256
#define MAX_DATA_LENGTH       253
<commit_msg>Add func 23<commit_after>﻿/**
 * Implementation of the Modbus protocol
 *
 * Copyright (c) 2017, <NAME>
 * All rights reserved.
 *
 * This software may be modified and distributed under the terms of the BSD license.
 * See LICENSE.txt for more details.
 *
 */


#ifndef MODBUS_H
#define MODBUS_H

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>

//--------------------------------------------------------------------------
// Definitions 
//--------------------------------------------------------------------------

#define MB_PACKET_ERROR_SIZE    -1
#define MB_PACKET_ERROR_CRC     -2
#define MB_PACKET_ERROR_ADDR    -3
#define MB_PACKET_ERROR_UNKOWN  -4

/* Official modbus errors */
#define MODBUS_NO_ERROR             0
#define MODBUS_ILLEGAL_FUNCTION     1
#define MODBUS_ILLEGAL_ADDRESS      2
#define MODBUS_ILLEGAL_DATA_VALUE   3
#define MODBUS_DEVICE_FAILURE       4
#define MODBUS_ACKNOWLEDGE          5
#define MODBUS_DEVICE_BUSY          6
#define MODBUS_NO_ACKNOWLEDGE       7
#define MODBUS_WRITE_ERROR          8
#define MODBUS_OVERLAPPED_AREA      9

/* Définitions MODBUS */
#define MAX_WORD_TO_READ      125
#define MAX_WORD_TO_WRITE     123
#define MAX_MODBUS_LENGTH     256
#define MAX_DATA_LENGTH       253
#define MAX_WORD_TO_WRITE_FUNC23    121
#define MAX_BYTES_FUNC_23     (MAX_WORD_TO_WRITE_FUNC23 * 2)
{'fraction_non_alphanumeric': 0.1729876160990712, 'fraction_numerical': 0.02786377708978328, 'mean_word_length': 2.1333333333333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2379850', 'n_tokens_mistral': 845, 'n_tokens_neox': 794, 'n_words': 215}