/**
 * @file multiplex.h
 *
 * @brief This header file was generated by cantools version 0.1.dev1932+g1a0bc71ff Sun Mar 22 09:40:37 2026.
 *
 * @copyright Copyright (c) 2018-2019 Erik Moqvist
 *
 * @par License
 * The MIT License (MIT)
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#ifndef MULTIPLEX_H
#define MULTIPLEX_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>

#ifndef EINVAL
#    define EINVAL 22
#endif

/* Frame ids. */
#define MULTIPLEX_MESSAGE1_FRAME_ID (0x123456u)

/* Frame lengths in bytes. */
#define MULTIPLEX_MESSAGE1_LENGTH (8u)

/* Extended or standard frame types. */
#define MULTIPLEX_MESSAGE1_IS_EXTENDED (1)

/* Frame cycle times in milliseconds. */


/* Signal choices. */


/* Frame Names. */
#define MULTIPLEX_MESSAGE1_NAME "Message1"

/* Signal Names. */
#define MULTIPLEX_MESSAGE1_MULTIPLEXOR_NAME "Multiplexor"
#define MULTIPLEX_MESSAGE1_BIT_J_NAME "BIT_J"
#define MULTIPLEX_MESSAGE1_BIT_C_NAME "BIT_C"
#define MULTIPLEX_MESSAGE1_BIT_G_NAME "BIT_G"
#define MULTIPLEX_MESSAGE1_BIT_L_NAME "BIT_L"
#define MULTIPLEX_MESSAGE1_BIT_A_NAME "BIT_A"
#define MULTIPLEX_MESSAGE1_BIT_K_NAME "BIT_K"
#define MULTIPLEX_MESSAGE1_BIT_E_NAME "BIT_E"
#define MULTIPLEX_MESSAGE1_BIT_D_NAME "BIT_D"
#define MULTIPLEX_MESSAGE1_BIT_B_NAME "BIT_B"
#define MULTIPLEX_MESSAGE1_BIT_H_NAME "BIT_H"
#define MULTIPLEX_MESSAGE1_BIT_F_NAME "BIT_F"

/**
 * Signals in message Message1.
 *
 * All signal values are as on the CAN bus.
 */
struct multiplex_message1_t {
    /**
     * Defines data content for response messages.
     *
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t multiplexor;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_j;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_c;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_g;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_l;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_a;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_k;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_e;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_d;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_b;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_h;

    /**
     * Range: -
     * Scale: 1
     * Offset: 0
     */
    uint8_t bit_f;
};

/**
 * Pack message Message1.
 *
 * @param[out] dst_p Buffer to pack the message into.
 * @param[in] src_p Data to pack.
 * @param[in] size Size of dst_p.
 *
 * @return Size of packed data, or negative error code.
 */
int multiplex_message1_pack(
    uint8_t *dst_p,
    const struct multiplex_message1_t *src_p,
    size_t size);

/**
 * Unpack message Message1.
 *
 * @param[out] dst_p Object to unpack the message into.
 * @param[in] src_p Message to unpack.
 * @param[in] size Size of src_p.
 *
 * @return zero(0) or negative error code.
 */
int multiplex_message1_unpack(
    struct multiplex_message1_t *dst_p,
    const uint8_t *src_p,
    size_t size);

/**
 * Init message fields to default values from Message1.
 *
 * @param[in] msg_p Message to init.
 *
 * @return zero(0) on success or (-1) in case of nullptr argument.
 */
int multiplex_message1_init(struct multiplex_message1_t *msg_p);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_multiplexor_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_multiplexor_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_multiplexor_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_multiplexor_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_j_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_j_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_j_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_j_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_c_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_c_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_c_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_c_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_g_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_g_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_g_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_g_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_l_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_l_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_l_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_l_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_a_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_a_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_a_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_a_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_k_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_k_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_k_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_k_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_e_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_e_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_e_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_e_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_d_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_d_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_d_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_d_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_b_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_b_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_b_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_b_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_h_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_h_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_h_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_h_is_in_phys_range(double value);

/**
 * Encode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to encode.
 *
 * @return Encoded signal.
 */
uint8_t multiplex_message1_bit_f_encode(double value);

/**
 * Decode given signal by applying scaling and offset.
 *
 * @param[in] value Signal to decode.
 *
 * @return Decoded signal.
 */
double multiplex_message1_bit_f_decode(uint8_t value);

/**
 * Check that given signal is in allowed range.
 *
 * @param[in] value Signal to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_f_is_in_range(uint8_t value);

/**
 * Check that given physical value is in allowed range before encoding.
 *
 * Use this BEFORE calling _encode() to avoid silent integer overflow:
 *   encode(-1.0) on a [0,100] signal wraps to 255 and passes is_in_range().
 *   is_in_phys_range(-1.0) correctly returns false.
 *
 * @param[in] value Physical signal value to check.
 *
 * @return true if in range, false otherwise.
 */
bool multiplex_message1_bit_f_is_in_phys_range(double value);


#ifdef __cplusplus
}
#endif

#endif
