Skip to content

Commit

Permalink
Template layer for radio HW abstraction (#210)
Browse files Browse the repository at this point in the history
* use template implementation
* modify examples and update CI
* refactor python wrapper
* rename RF24Network class for backward compatibility
  using typedef RF24Network instead ensures no major breakage

---------

Co-authored-by: TMRh20 <[email protected]>
  • Loading branch information
2bndy5 and TMRh20 authored Jun 8, 2023
1 parent 7c41ace commit a334fa6
Show file tree
Hide file tree
Showing 13 changed files with 252 additions and 152 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build_arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ jobs:
libraries: |
- source-url: https://github.com/nRF24/RF24.git
- source-path: ./
# - source-url: https://github.com/TMRh20/nrf_to_nrf.git
# version: v1.0
- name: nrf_to_nrf
fqbn: ${{ matrix.fqbn }}
enable-deltas-report: ${{ matrix.enable-deltas-report }}
platforms: |
Expand Down Expand Up @@ -72,7 +71,7 @@ jobs:
- "arduino:avr:chiwawa"
- "arduino:avr:one"
- "arduino:avr:unowifi"
# - "arduino:mbed:nano33ble" pending nRF5x integration (see #200)
- "arduino:mbed:nano33ble"
- "arduino:samd:mkr1000"
- "arduino:samd:mkrwifi1010"
- "arduino:samd:nano_33_iot"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_platformIO.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
needs: [check_formatting, validate_lib_json]
uses: nRF24/.github/.github/workflows/build_platformio.yaml@main
with:
example-path: ${{ matrix.example }}
board-id: ${{ matrix.board }}
example-path: ${{ matrix.example }}
board-id: ${{ matrix.board }}
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build/
*CMakeUserPresets*.json
*.tar.gz
*env/
*.egg-info/

# Cmake build-in-source generated stuff
CMakeCache.txt
Expand Down
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,36 @@
[![Pico SDK build](https://github.com/nRF24/RF24Network/actions/workflows/build_rp2xxx.yml/badge.svg)](https://github.com/nRF24/RF24Network/actions/workflows/build_rp2xxx.yml)
[![Documentation Status](https://readthedocs.org/projects/rf24network/badge/?version=latest)](https://rf24network.readthedocs.io/en/latest/?badge=latest)

# TMRh20 2014 - Newly Optimized Network Layer for nRF24L01(+) radios
# TMRh20 2014-2023 - Newly Optimized Network Layer for nRF24L01(+) radios
Introducing **RF24Network & RF24Mesh v2.0** with some *significant API changes*, adding the use of C++ Templates in order to support a
range of ESB enabled radios, most recently NRF52x radios.

Please see the full documentation at http://nRF24.github.io/RF24Network/
**Important Notes:**
- Any network layer that uses v2 needs to have RF24Network/RF24Mesh dependencies of v2 or newer. RF24 v1.x is an exception here.
- General usage should remain backward compatible, see the included examples of the related libraries for more info
- Any third party libs that extend the network/mesh layer may also need to be updated to incorporate the new templated class prototypes:
```cpp
template<class radio_t>
class ESBNetwork;

template<class network_t, class radio_t>
class ESBMesh;
```
- Third party libs should also be able to use the backward-compatible typedef in their template:
- ESBGateway.h:
```cpp
template<typename network_t, typename mesh_t>
class ESBGateway
```
and inform the compiler what types they intend to support:
- ESBGateway.cpp:
```cpp
template class ESBGateway<RF24Network, RF24Mesh>;
```
- The auto installers do not perform a version check like package managers, so having the correct versions of the software is important.
- We *will* be maintaining the v1.x versions with bugfixes etc for those who cannot or do not wish to migrate to the newer template approach.
Please see the full documentation at http://nRF24.github.io/RF24Network/ for more information
See http://nRF24.github.io/RF24/index.html for general RF24 configuration and setup
Expand Down
Loading

0 comments on commit a334fa6

Please sign in to comment.