Coder Social home page Coder Social logo

sigurdnev / multi-nus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nordicmatt/multi-nus

0.0 0.0 0.0 12 KB

A central Nordic UART Service, NUS, application that can connect to up to 20 Nordic UART Service peripherals.

CMake 2.02% C 97.98%

multi-nus's Introduction

Bluetooth: Central UART, Multi-NUS

The Central UART sample demonstrates how to use the :ref:`nus_client_readme`. This application is an extension of the Central UART sample. This version of the central UART is able to connect to multiple peripherals, up to 20, at the same time. This application was built using v1.4.1 of NCS.

It uses the NUS Client to send data back and forth between a UART connection and a Bluetooth LE connection, emulating a serial port over Bluetooth LE.

When connected, the sample forwards any data received on the RX pin of the UART 1 peripheral to the Bluetooth LE unit. On Nordic Semiconductor's development kits, the UART 1 peripheral is typically gated through the SEGGER chip to a USB CDC virtual serial port.

Any data sent from the Bluetooth LE unit is sent out of the UART 1 peripheral's TX pin.

This new version broadcasts any data received on the UART to all connections.

In this sample, a UART console is used to send and read data over the NUS Client. Debug messages are not displayed in the UART console, but are printed by the RTT logger instead.

If you want to view the debug messages, follow the procedure in :ref:`testing_rtt_connect`.

The sample supports the following development kits:

.. table-from-rows:: /includes/sample_board_rows.txt
   :header: heading
   :rows: nrf5340dk_nrf5340_cpuapp_and_cpuappns, nrf52840dk_nrf52840, nrf52dk_nrf52832, nrf52833dk_nrf52833, nrf52833dk_nrf52820

The sample also requires another development kit running a compatible application (see :ref:`peripheral_uart`).

After programming the sample to your board, test it by performing the following steps:

  1. Connect the board to the computer using a USB cable. The board is assigned a COM port (Windows) or ttyACM device (Linux), which is visible in the Device Manager.
  2. |connect_terminal_specific|
  3. Optionally, connect the RTT console to display debug messages. See :ref:`central_uart_debug`.
  4. Reset the board.
  5. Observe that the text "Starting NUS Client example" is printed on the COM listener running on the computer and the device starts scanning for Peripheral boards with NUS.
  6. Program the :ref:`peripheral_uart` sample to the second board. See the documentation for that sample for detailed instructions.
  7. Observe that the boards connect. When service discovery is completed, the event logs are printed on the Central board's terminal.
  8. Now you can send data between the two boards. To do so, type some characters in the terminal of one of the boards and hit Enter. Observe that the data is displayed on the UART on the other board.
  9. Disconnect the devices by, for example, pressing the Reset button on the Central board. Observe that the boards automatically reconnect and that it is again possible to send data between the two boards.

This sample uses the following |NCS| libraries:

In addition, it uses the following Zephyr libraries:

multi-nus's People

Contributors

nordicmatt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.