// generated from rosidl_typesupport_fastrtps_c/resource/idl__type_support_c.cpp.em
// with input from g29_msg:msg/G29Msg.idl
// generated code does not contain a copyright notice
#include "g29_msg/msg/detail/g29_msg__rosidl_typesupport_fastrtps_c.h"


#include <cassert>
#include <limits>
#include <string>
#include "rosidl_typesupport_fastrtps_c/identifier.h"
#include "rosidl_typesupport_fastrtps_c/wstring_conversion.hpp"
#include "rosidl_typesupport_fastrtps_cpp/message_type_support.h"
#include "g29_msg/msg/rosidl_typesupport_fastrtps_c__visibility_control.h"
#include "g29_msg/msg/detail/g29_msg__struct.h"
#include "g29_msg/msg/detail/g29_msg__functions.h"
#include "fastcdr/Cdr.h"

#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-parameter"
# ifdef __clang__
#  pragma clang diagnostic ignored "-Wdeprecated-register"
#  pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
# endif
#endif
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif

// includes and forward declarations of message dependencies and their conversion functions

#if defined(__cplusplus)
extern "C"
{
#endif


// forward declare type support functions


using _G29Msg__ros_msg_type = g29_msg__msg__G29Msg;

static bool _G29Msg__cdr_serialize(
  const void * untyped_ros_message,
  eprosima::fastcdr::Cdr & cdr)
{
  if (!untyped_ros_message) {
    fprintf(stderr, "ros message handle is null\n");
    return false;
  }
  const _G29Msg__ros_msg_type * ros_message = static_cast<const _G29Msg__ros_msg_type *>(untyped_ros_message);
  // Field name: heartbeat
  {
    cdr << ros_message->heartbeat;
  }

  // Field name: axis0
  {
    cdr << ros_message->axis0;
  }

  // Field name: axis1
  {
    cdr << ros_message->axis1;
  }

  // Field name: axis2
  {
    cdr << ros_message->axis2;
  }

  // Field name: axis3
  {
    cdr << ros_message->axis3;
  }

  // Field name: axis4
  {
    cdr << ros_message->axis4;
  }

  // Field name: axis5
  {
    cdr << ros_message->axis5;
  }

  // Field name: button0
  {
    cdr << (ros_message->button0 ? true : false);
  }

  // Field name: button1
  {
    cdr << (ros_message->button1 ? true : false);
  }

  // Field name: button2
  {
    cdr << (ros_message->button2 ? true : false);
  }

  // Field name: button3
  {
    cdr << (ros_message->button3 ? true : false);
  }

  // Field name: button4
  {
    cdr << (ros_message->button4 ? true : false);
  }

  // Field name: button5
  {
    cdr << (ros_message->button5 ? true : false);
  }

  // Field name: button6
  {
    cdr << (ros_message->button6 ? true : false);
  }

  // Field name: button7
  {
    cdr << (ros_message->button7 ? true : false);
  }

  // Field name: button8
  {
    cdr << (ros_message->button8 ? true : false);
  }

  // Field name: button9
  {
    cdr << (ros_message->button9 ? true : false);
  }

  // Field name: button10
  {
    cdr << (ros_message->button10 ? true : false);
  }

  // Field name: button11
  {
    cdr << (ros_message->button11 ? true : false);
  }

  // Field name: button12
  {
    cdr << (ros_message->button12 ? true : false);
  }

  // Field name: button13
  {
    cdr << (ros_message->button13 ? true : false);
  }

  // Field name: button14
  {
    cdr << (ros_message->button14 ? true : false);
  }

  // Field name: button15
  {
    cdr << (ros_message->button15 ? true : false);
  }

  // Field name: button16
  {
    cdr << (ros_message->button16 ? true : false);
  }

  // Field name: button17
  {
    cdr << (ros_message->button17 ? true : false);
  }

  // Field name: button18
  {
    cdr << (ros_message->button18 ? true : false);
  }

  // Field name: button19
  {
    cdr << (ros_message->button19 ? true : false);
  }

  // Field name: button20
  {
    cdr << (ros_message->button20 ? true : false);
  }

  // Field name: button21
  {
    cdr << (ros_message->button21 ? true : false);
  }

  // Field name: button22
  {
    cdr << (ros_message->button22 ? true : false);
  }

  // Field name: button23
  {
    cdr << (ros_message->button23 ? true : false);
  }

  // Field name: button24
  {
    cdr << (ros_message->button24 ? true : false);
  }

  return true;
}

static bool _G29Msg__cdr_deserialize(
  eprosima::fastcdr::Cdr & cdr,
  void * untyped_ros_message)
{
  if (!untyped_ros_message) {
    fprintf(stderr, "ros message handle is null\n");
    return false;
  }
  _G29Msg__ros_msg_type * ros_message = static_cast<_G29Msg__ros_msg_type *>(untyped_ros_message);
  // Field name: heartbeat
  {
    cdr >> ros_message->heartbeat;
  }

  // Field name: axis0
  {
    cdr >> ros_message->axis0;
  }

  // Field name: axis1
  {
    cdr >> ros_message->axis1;
  }

  // Field name: axis2
  {
    cdr >> ros_message->axis2;
  }

  // Field name: axis3
  {
    cdr >> ros_message->axis3;
  }

  // Field name: axis4
  {
    cdr >> ros_message->axis4;
  }

  // Field name: axis5
  {
    cdr >> ros_message->axis5;
  }

  // Field name: button0
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button0 = tmp ? true : false;
  }

  // Field name: button1
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button1 = tmp ? true : false;
  }

  // Field name: button2
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button2 = tmp ? true : false;
  }

  // Field name: button3
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button3 = tmp ? true : false;
  }

  // Field name: button4
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button4 = tmp ? true : false;
  }

  // Field name: button5
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button5 = tmp ? true : false;
  }

  // Field name: button6
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button6 = tmp ? true : false;
  }

  // Field name: button7
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button7 = tmp ? true : false;
  }

  // Field name: button8
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button8 = tmp ? true : false;
  }

  // Field name: button9
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button9 = tmp ? true : false;
  }

  // Field name: button10
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button10 = tmp ? true : false;
  }

  // Field name: button11
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button11 = tmp ? true : false;
  }

  // Field name: button12
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button12 = tmp ? true : false;
  }

  // Field name: button13
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button13 = tmp ? true : false;
  }

  // Field name: button14
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button14 = tmp ? true : false;
  }

  // Field name: button15
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button15 = tmp ? true : false;
  }

  // Field name: button16
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button16 = tmp ? true : false;
  }

  // Field name: button17
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button17 = tmp ? true : false;
  }

  // Field name: button18
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button18 = tmp ? true : false;
  }

  // Field name: button19
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button19 = tmp ? true : false;
  }

  // Field name: button20
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button20 = tmp ? true : false;
  }

  // Field name: button21
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button21 = tmp ? true : false;
  }

  // Field name: button22
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button22 = tmp ? true : false;
  }

  // Field name: button23
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button23 = tmp ? true : false;
  }

  // Field name: button24
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message->button24 = tmp ? true : false;
  }

  return true;
}  // NOLINT(readability/fn_size)

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_g29_msg
size_t get_serialized_size_g29_msg__msg__G29Msg(
  const void * untyped_ros_message,
  size_t current_alignment)
{
  const _G29Msg__ros_msg_type * ros_message = static_cast<const _G29Msg__ros_msg_type *>(untyped_ros_message);
  (void)ros_message;
  size_t initial_alignment = current_alignment;

  const size_t padding = 4;
  const size_t wchar_size = 4;
  (void)padding;
  (void)wchar_size;

  // field.name heartbeat
  {
    size_t item_size = sizeof(ros_message->heartbeat);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name axis0
  {
    size_t item_size = sizeof(ros_message->axis0);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name axis1
  {
    size_t item_size = sizeof(ros_message->axis1);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name axis2
  {
    size_t item_size = sizeof(ros_message->axis2);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name axis3
  {
    size_t item_size = sizeof(ros_message->axis3);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name axis4
  {
    size_t item_size = sizeof(ros_message->axis4);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name axis5
  {
    size_t item_size = sizeof(ros_message->axis5);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button0
  {
    size_t item_size = sizeof(ros_message->button0);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button1
  {
    size_t item_size = sizeof(ros_message->button1);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button2
  {
    size_t item_size = sizeof(ros_message->button2);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button3
  {
    size_t item_size = sizeof(ros_message->button3);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button4
  {
    size_t item_size = sizeof(ros_message->button4);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button5
  {
    size_t item_size = sizeof(ros_message->button5);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button6
  {
    size_t item_size = sizeof(ros_message->button6);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button7
  {
    size_t item_size = sizeof(ros_message->button7);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button8
  {
    size_t item_size = sizeof(ros_message->button8);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button9
  {
    size_t item_size = sizeof(ros_message->button9);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button10
  {
    size_t item_size = sizeof(ros_message->button10);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button11
  {
    size_t item_size = sizeof(ros_message->button11);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button12
  {
    size_t item_size = sizeof(ros_message->button12);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button13
  {
    size_t item_size = sizeof(ros_message->button13);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button14
  {
    size_t item_size = sizeof(ros_message->button14);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button15
  {
    size_t item_size = sizeof(ros_message->button15);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button16
  {
    size_t item_size = sizeof(ros_message->button16);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button17
  {
    size_t item_size = sizeof(ros_message->button17);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button18
  {
    size_t item_size = sizeof(ros_message->button18);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button19
  {
    size_t item_size = sizeof(ros_message->button19);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button20
  {
    size_t item_size = sizeof(ros_message->button20);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button21
  {
    size_t item_size = sizeof(ros_message->button21);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button22
  {
    size_t item_size = sizeof(ros_message->button22);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button23
  {
    size_t item_size = sizeof(ros_message->button23);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // field.name button24
  {
    size_t item_size = sizeof(ros_message->button24);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }

  return current_alignment - initial_alignment;
}

static uint32_t _G29Msg__get_serialized_size(const void * untyped_ros_message)
{
  return static_cast<uint32_t>(
    get_serialized_size_g29_msg__msg__G29Msg(
      untyped_ros_message, 0));
}

ROSIDL_TYPESUPPORT_FASTRTPS_C_PUBLIC_g29_msg
size_t max_serialized_size_g29_msg__msg__G29Msg(
  bool & full_bounded,
  bool & is_plain,
  size_t current_alignment)
{
  size_t initial_alignment = current_alignment;

  const size_t padding = 4;
  const size_t wchar_size = 4;
  size_t last_member_size = 0;
  (void)last_member_size;
  (void)padding;
  (void)wchar_size;

  full_bounded = true;
  is_plain = true;

  // member: heartbeat
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }
  // member: axis0
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }
  // member: axis1
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }
  // member: axis2
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }
  // member: axis3
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }
  // member: axis4
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }
  // member: axis5
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }
  // member: button0
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button1
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button2
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button3
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button4
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button5
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button6
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button7
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button8
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button9
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button10
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button11
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button12
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button13
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button14
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button15
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button16
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button17
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button18
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button19
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button20
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button21
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button22
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button23
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }
  // member: button24
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  size_t ret_val = current_alignment - initial_alignment;
  if (is_plain) {
    // All members are plain, and type is not empty.
    // We still need to check that the in-memory alignment
    // is the same as the CDR mandated alignment.
    using DataType = g29_msg__msg__G29Msg;
    is_plain =
      (
      offsetof(DataType, button24) +
      last_member_size
      ) == ret_val;
  }

  return ret_val;
}

static size_t _G29Msg__max_serialized_size(char & bounds_info)
{
  bool full_bounded;
  bool is_plain;
  size_t ret_val;

  ret_val = max_serialized_size_g29_msg__msg__G29Msg(
    full_bounded, is_plain, 0);

  bounds_info =
    is_plain ? ROSIDL_TYPESUPPORT_FASTRTPS_PLAIN_TYPE :
    full_bounded ? ROSIDL_TYPESUPPORT_FASTRTPS_BOUNDED_TYPE : ROSIDL_TYPESUPPORT_FASTRTPS_UNBOUNDED_TYPE;
  return ret_val;
}


static message_type_support_callbacks_t __callbacks_G29Msg = {
  "g29_msg::msg",
  "G29Msg",
  _G29Msg__cdr_serialize,
  _G29Msg__cdr_deserialize,
  _G29Msg__get_serialized_size,
  _G29Msg__max_serialized_size
};

static rosidl_message_type_support_t _G29Msg__type_support = {
  rosidl_typesupport_fastrtps_c__identifier,
  &__callbacks_G29Msg,
  get_message_typesupport_handle_function,
};

const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_fastrtps_c, g29_msg, msg, G29Msg)() {
  return &_G29Msg__type_support;
}

#if defined(__cplusplus)
}
#endif
