nRF Connect for Desktop

Developer documentation

Logo

Basics

API

Misc


NordicSemiconductor/pc-nrfconnect-docs on GitHub

Modules

List of modules

nRF Connect includes several modules that apps can import:

Module name Description
electron

The electron API for the renderer process. Refer to the electron documentation.

nrfconnect/core

Functions and properties for interacting with nRF Connect:

getAppDir

Function returning absolute path to where the app is loaded from.

getUserDataDir

Function returning absolute path to the data directory of the current user.

logger

The application logger, which is a Winston logger instance. Log messages will appear in the log viewer. See the Winston documentation on Github.

pc-ble-driver-js

Bluetooth® low energy driver for Nordic Semiconductor's nRF5x SoCs. Refer to the pc-ble-driver-js repository on Github.

pc-nrfjprog-js

Library for programming/flashing Nordic Semiconductor's nRF5x SoCs. Refer to the pc-nrfjprog-js repository on Github.

react

The React library instance used by nRF Connect. Refer to the React documentation.

nrf-device-setup

Library for setting up devices from Nordic Semiconductor. Refer to the nrf-device-setup repository on Github.

react

The React library instance used by nRF Connect. Refer to the React documentation.

react-dom

The ReactDOM library instance used by nRF Connect. Refer to the ReactDOM documentation.

react-redux

The react-redux library instance, containing React bindings for Redux. Refer to the react-redux documentation.

serialport

Node.js serialport library. Refer to the serialport documentation on Github.

nrf-usb

Forked Node.js usb library. Nothing has been changed but generating binaries. Refer to the node-usb documentation on Github.

Example

The modules are imported using import or require(), e.g.:

import SerialPort from 'serialport';
import { logger } from 'nrfconnect/core';

const port = new SerialPort('/dev/ttyACM0', err => {
    if (err) {
        logger.error(err.message);
    } else {
        logger.info('Port is open');
    }
});