Alex T ee6e65a5bf mock: use MRAA_PIN_NAME_SIZE for strncpy to avoid truncation
This fixes the following compilation warnings:

mraa/src/src/mock/mock_board.c: In function ‘mraa_mock_board’:
mraa/src/src/mock/mock_board.c:156:5: warning: ‘strncpy’ output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
  156 |     strncpy(b->pins[pos].name, "SPI0MOSI", 8);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mraa/src/src/mock/mock_board.c:162:5: warning: ‘strncpy’ output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
  162 |     strncpy(b->pins[pos].name, "SPI0MISO", 8);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mraa/src/src/mock/mock_board.c:168:5: warning: ‘strncpy’ output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
  168 |     strncpy(b->pins[pos].name, "SPI0SCLK", 8);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Alex T <alext.mkrs@gmail.com>
2025-10-13 09:00:18 -07:00
2024-01-23 08:42:50 -08:00
2025-08-11 17:40:05 -07:00
2019-05-23 10:09:12 -07:00
2024-08-28 07:57:39 -07:00
2019-05-23 10:09:12 -07:00
2019-05-23 10:09:12 -07:00
2017-10-11 14:54:57 -07:00
2025-10-13 08:59:43 -07:00
2019-05-23 10:09:12 -07:00
2025-10-13 08:59:43 -07:00

Eclipse MRAA - Low Level I/O Communications Library for GNU/Linux Platforms

Eclipse MRAA (Libmraa) is a C/C++ library with bindings to Java, Python and JavaScript to interface with the I/O pins and buses on various IoT and Edge platforms, with a structured and sane API where port names/numbering match the board that you are on. Use of libmraa does not tie you to specific hardware. Since board detection is done at runtime you can create portable code that will work across the supported platforms.

The intent is to make it easier for developers and sensor manufacturers to map their sensors & actuators on top of supported hardware and to allow control of low level communication protocol by high level languages & constructs.

The MRAA project is an Eclipse IoT project. A detailed project description can be found here.

Supported Boards

X86

ARM

MIPS

FPGA

USB

I2C

Mock

JSON platform

RISC-V

Installing on Your Board

Installing on Ubuntu

Here is a PPA for installing on Ubuntu Xenial or Bionic: https://launchpad.net/~mraa/+archive/ubuntu/mraa

sudo add-apt-repository ppa:mraa/mraa
sudo apt-get update
sudo apt-get install libmraa2 libmraa-dev libmraa-java python-mraa python3-mraa node-mraa mraa-tools

Running MRAA tools or applications on Ubuntu systems requires elevated permissions (e.g. run with sudo).

Install on Arch Linux

There is an AUR package for mraa here: https://aur.archlinux.org/packages/mraa

Install on openSUSE or SLE

For the latest versions of openSUSE and SLE the project is distributed via native repositories and can be installed by developers with:

sudo zypper install mraa mraa-devel

For ARM boards use:

REPO="openSUSE_Tumbleweed"
if test "$(arch)" == "aarch64"; then
  REPO="openSUSE_Factory_ARM"
fi
sudo zypper ar http://download.opensuse.org/repositories/hardware/$REPO/hardware.repo
sudo zypper in mraa

A full list of packages and instructions for installing MRAA for various openSUSE releases can be found here.

Installing on Other Linux Distributions

The MRAA project does not currently distribute official binaries for other distributions so developers will have to compile the project from sources as described in the next section.

For testing and development purposes it may be possible to share and install .deb and .rpm packages across similar Linux builds.

Compiling

See documentation on building

Examples

See the examples available for various languages

Debugging

Sometimes it just doesn't want to work, let us try and help you, you can file issues in github or join us in #mraa on freenode IRC, hang around for a little while because we're not necessarily on 24/7, but we'll get back to you! Have a glance at our debugging page too.

API Documentation

UNDER CONSTRUCTION: we are working on re-hosting our documentation, so below links don't work. Please use the sources and Markdown files under docs in the meanwhile.

Contact Us

To ask questions either file an issue on Github or send an email to our mailing list. You must be subscribed to the list before you can post. You might also catch us on the mraa channel on freenode IRC.

See the Contribution documentation for more details.

Changelog

Version changelog here.

Description
No description provided
Readme 5.6 MiB
Languages
C 79.1%
C++ 9.6%
CMake 4.6%
Python 4.5%
SWIG 1%
Other 1.2%