This document outlines the progress on the Gossip-over-BLE implementation.
First grab the s110 softdevice folder and put it in the top level directory of this repo.
Use a JLink-speaking programmer and connect one of the devboards.
Run make flash-softdevice
to get the softdevice onto the nrf51822.
Install JLink GDB server. scroll down to "J-Link software & documentation pack for MAC") https://www.segger.com/jlink-software.html
Install Nordic packages. Try the following handy script.
mkdir -p nRF51_SDK_7.1.0
curl http://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_7.1.0_372d17a.zip | tar xvf - -C nRF51_SDK_7.1.0
mkdir -p s110_nrf51822_7.1.0
curl http://www.nordicsemi.com/eng/nordic/download_resource/30082/12/50064729 | tar xvf - -C s110_nrf51822_7.1.0
Install gcc-arm. brew tap tessel/tools
and brew install gcc-arm
. (If your gcc-arm location is different, set make GNU_INSTALL_ROOT=/usr/local/wherever
.)
Use make
to compile and link the application binary.
Use make flash-softdevice
to load the softdevice on the nrf51822.
Use make flash
to load the application on the nrf51822 after the softdevice.
A preliminary draft of the GATT Profile for communicating with Gossip over BLE is in the profiles.json
file in this repo. It currently defines 3 proprietary services: "Gossip IO Protocol Service"
, "Reach Configuration Protocol Service"
, and "Reach OTA Update Protocol Service"
. The former has 2 characteristics used separately for upstream and downstream message passing, mimicking a duplex stream. The latter two services are in place as an example for UUID assignment conventions should more services be deemed necessary.
The nrf51822 client code is mostly contained in /src/main.c
, and outlines all of the GAP (connection) and GATT (profile) set up.
The Tessel client can be found in the client.js
file. The majority of this code is dedicated to establishing a connection with a host over BLE. This file also contains a Gossip
object used for parsing incoming packets, executing the appropriate function, and sending the appropriate response. Current implementation is a port of the Rust parser to JavaScript, and only has the SPI functionality.
The current host implementation uses noble
to interface with the BLE adapter on a computer, source located in the host.js
file. Again, most of this file is dedicated to establishing a BLE connection with a Reach client. Lacks most Gossip logic.
Priorities
npm install
to install necessary dependencies.
tessel run client.js
to run the client on a Tessel. Must have BLE module on port A.
node host.js
to run the host. Must be run on a computer with BLE hardware.