apache / apache/mynewt-nimble

build blemesh shell demo for linux

Open
#1,945 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
893
Forks
512
Avg merge
13d 31m
Merged PRs (30d)
7

Description

I am trying to build the blemesh shell demo on linux platform. so it could be a ble mesh provisioner.
Maybe someone else also want to build this demo, so i pushed a commit here. [commit](https://github.com/apache/mynewt-nimble/pull/1939)

This commit want to keep nimble/host/mesh/src/shell.c not changed since it is in the nimble stack core directory.

Notes:
1. `provisioner.c` should work without marco `BLE_MESH_CDB` (for a simple demo)

Modification not be committed :

2. `nimble/host/mesh/src/shell.c` prints 'uint32_t' variable with "%lx" format, it cause compile warnning. (should switch to PRIx32 or %x)

3. `bt_rand(void *buf, size_t len)` calls `ble_hs_hci_rand()` to generate random numbers. My ble controller is buggly to support this.
so i changed this function to read the random number from '/dev/urandom' for testing.

The test reuslt:

>
>$sudo ./nimble-linux-blemesh-shell
>...
> mesh>provision 0 1 0
> ...
>mesh>provision-adv dddd7cdfa1c215020000000000000000 0 2 0
>...
>send_prov_data: SessionKey: 608edf6774fdb2c01ae41c7dae59e21d
>send_prov_data: Nonce: 20bf4ed33c6d6a8fe0a5f707c1
>send_prov_data: DevKey: 9d588e3a77ec66919d770cb23cc7ae72
>send_prov_data: net_idx 0, iv_index 0x00000000, addr 0x0002
>
>prov_complete: key 9d588e3a77ec66919d770cb23cc7ae72, net_idx 0, num_elem 3, addr 0x0002>
>...

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the referenced PR 1939 and the Linux build for nimble-linux-blemesh-shell. Read provisioner.c and nimble/host/mesh/src/shell.c, including the bt_rand path and format warning noted in the issue. Done means the demo builds and runs on Linux as a BLE Mesh provisioner without changing the core shell.c file.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
cli, embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.