Skip to content

Commit fce5a3e

Browse files
committed
samples: boards: st: ble ieee802.15.4 concurrent mode cleaning
Clean sample Bluetooth Heart Rate - 802154 Echo Client to keep only useful coding Signed-off-by: Vincent Tardy <[email protected]>
1 parent bbc71af commit fce5a3e

File tree

12 files changed

+82
-538
lines changed

12 files changed

+82
-538
lines changed

samples/boards/st/ble_802154/ble_hr_802154_echo_client/CMakeLists.txt

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,10 @@
33
cmake_minimum_required(VERSION 3.20.0)
44

55
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6-
project(sockets_echo_client)
7-
8-
if(CONFIG_NET_SOCKETS_SOCKOPT_TLS AND
9-
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED AND
10-
(CONFIG_NET_SAMPLE_PSK_HEADER_FILE STREQUAL "dummy_psk.h"))
11-
add_custom_target(development_psk
12-
COMMAND ${CMAKE_COMMAND} -E echo "----------------------------------------------------------"
13-
COMMAND ${CMAKE_COMMAND} -E echo "--- WARNING: Using dummy PSK! Only suitable for ---"
14-
COMMAND ${CMAKE_COMMAND} -E echo "--- development. Set NET_SAMPLE_PSK_HEADER_FILE to use ---"
15-
COMMAND ${CMAKE_COMMAND} -E echo "--- own pre-shared key. ---"
16-
COMMAND ${CMAKE_COMMAND} -E echo "----------------------------------------------------------"
17-
)
18-
add_dependencies(app development_psk)
19-
endif()
6+
project(st_ble_802154_echo_client)
207

218
target_sources( app PRIVATE src/echo-client.c)
229
target_sources( app PRIVATE src/app_ble.c)
2310
target_sources_ifdef(CONFIG_NET_UDP app PRIVATE src/udp.c)
24-
target_sources_ifdef(CONFIG_NET_TCP app PRIVATE src/tcp.c)
2511

2612
include(${ZEPHYR_BASE}/samples/net/common/common.cmake)
27-
28-
set(gen_dir ${ZEPHYR_BINARY_DIR}/include/generated/)
29-
30-
generate_inc_file_for_target(
31-
app
32-
src/echo-apps-cert.der
33-
${gen_dir}/echo-apps-cert.der.inc
34-
)

samples/boards/st/ble_802154/ble_hr_802154_echo_client/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ config NET_SAMPLE_IFACE3_VLAN_TAG
4444
Set VLAN (virtual LAN) tag (id) that is used in the sample
4545
application.
4646

47-
config NET_SAMPLE_PSK_HEADER_FILE
48-
string "Header file containing PSK"
49-
default "dummy_psk.h"
50-
depends on MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
51-
help
52-
Name of a header file containing a
53-
pre-shared key.
54-
5547
config NET_SAMPLE_SEND_ITERATIONS
5648
int "Send sample data this many times"
5749
default 0

samples/boards/st/ble_802154/ble_hr_802154_echo_client/README.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Overview
1111

1212
The sample application for Zephyr implements a concurrent mode
1313
BLE - IEEE 802.15.4.
14-
The 802.15.4 part implements UDP/TCP client that will send IPv4
15-
or IPv6 packets, wait for the data to be sent back, and then verify
16-
it matches the data that was sent.
14+
The 802.15.4 part implements UDP client that will send IPv6 packets,
15+
wait for the data to be sent back, and then verify it matches
16+
the data that was sent.
1717
The BLE part exposes the HR (Heart Rate) GATT Service. Once a device
1818
connects it will generate dummy heart-rate values.
1919

@@ -33,10 +33,7 @@ There are configuration files for different boards and setups in the
3333
samples directory:
3434

3535
- :file:`prj.conf`
36-
Generic config file, normally you should use this.
37-
38-
- :file:`overlay-802154.conf`
39-
This overlay config enables support for native IEEE 802.15.4 connectivity.
36+
This config enables support for native IEEE 802.15.4 connectivity.
4037
Note that by default IEEE 802.15.4 L2 uses unacknowledged communication.
4138
To improve connection reliability, acknowledgments can be enabled with shell
4239
command: ``ieee802154 ack set``.
@@ -55,18 +52,17 @@ Example building for the IEEE 802.15.4 on nucleo_wba65ri:
5552
.. zephyr-app-commands::
5653
:zephyr-app: samples/boards/st/ble_802154/ble_hr_802154_echo_client
5754
:board: nucleo_wba65ri
58-
:gen-args: -DEXTRA_CONF_FILE=overlay-802154.conf
5955
:goals: build
6056
:compact:
6157

6258
The LED 1 toggles while application is BLE advertising. Once a remote device
6359
connects, the LED 1 turns ON and application will generate dummy heart-rate values.
64-
Once remote device disconnects, the ammplication restarts BLE advertising and LED 1
60+
Once remote device disconnects, the application restarts BLE advertising and LED 1
6561
toggles.
6662

6763
Simultaneously, IEEE 802.15.4 feature is enabled.
6864
In remote device, you can run a echo-server sample application with
6965
:file:`overlay-802154.conf`.
70-
Once both devices are connected, local device will send IPv4 or IPv6 packets,
71-
wait for the data to be sent back from the remote echo-server device, and then
72-
verify it matches the data that was sent.
66+
Once both devices are connected, local device will send IPv6 packets,wait for
67+
the data to be sent back from the remote echo-server device, and then verify it
68+
matches the data that was sent.

samples/boards/st/ble_802154/ble_hr_802154_echo_client/overlay-802154.conf

Lines changed: 0 additions & 20 deletions
This file was deleted.

samples/boards/st/ble_802154/ble_hr_802154_echo_client/prj.conf

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Generic networking options
22
CONFIG_NETWORKING=y
33
CONFIG_NET_UDP=y
4-
CONFIG_NET_TCP=y
4+
CONFIG_NET_TCP=n
55
CONFIG_NET_IPV6=y
6-
CONFIG_NET_IPV4=y
6+
CONFIG_NET_IPV4=n
77
CONFIG_NET_SOCKETS=y
88
CONFIG_ZVFS_POLL_MAX=5
99
CONFIG_NET_CONNECTION_MANAGER=y
@@ -40,17 +40,25 @@ CONFIG_NET_IF_MAX_IPV4_COUNT=3
4040
# Network shell
4141
CONFIG_NET_SHELL=y
4242

43-
# The addresses are selected so that qemu<->qemu connectivity works ok.
44-
# For linux<->qemu connectivity, create a new conf file and swap the
45-
# addresses (so that peer address is ending to 2).
43+
# Network Config
4644
CONFIG_NET_CONFIG_SETTINGS=y
4745
CONFIG_NET_CONFIG_NEED_IPV6=y
4846
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2"
4947
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1"
50-
CONFIG_NET_CONFIG_NEED_IPV4=y
51-
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.2"
52-
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.1"
48+
CONFIG_NET_CONFIG_NEED_IPV4=n
49+
CONFIG_NET_CONFIG_MY_IPV4_ADDR=""
50+
CONFIG_NET_CONFIG_PEER_IPV4_ADDR=""
5351
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
52+
CONFIG_NET_RX_STACK_SIZE=2048
53+
54+
CONFIG_NET_L2_IEEE802154=y
55+
CONFIG_NET_L2_IEEE802154_SHELL=y
56+
CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y
57+
58+
CONFIG_NET_CONFIG_IEEE802154_CHANNEL=26
59+
60+
CONFIG_NET_L2_IEEE802154_FRAGMENT_REASS_CACHE_SIZE=5
61+
5462

5563
# Bluetootn configuration
5664
CONFIG_BT=y

samples/boards/st/ble_802154/ble_hr_802154_echo_client/src/ca_certificate.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

samples/boards/st/ble_802154/ble_hr_802154_echo_client/src/common.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,24 @@ int start_udp(void);
9090
int process_udp(void);
9191
void stop_udp(void);
9292
#else
93-
static inline void init_udp(void) { }
94-
static inline int start_udp(void) { return 0; }
95-
static inline int process_udp(void) { return 0; }
96-
static inline void stop_udp(void) { }
93+
static inline void init_udp(void)
94+
{
95+
/*nothing to do*/
96+
}
97+
static inline int start_udp(void)
98+
{
99+
return 0;
100+
}
101+
static inl
102+
{
103+
return 0;
104+
}
105+
static inline void stop_udp(void)
106+
{
107+
/*nothing to do*/
108+
}
97109
#endif /* defined(CONFIG_NET_UDP) */
98110

99-
int start_tcp(void);
100-
int process_tcp(void);
101-
void stop_tcp(void);
102111

103112
#if defined(CONFIG_BT)
104113
extern int ble_init(void);

samples/boards/st/ble_802154/ble_hr_802154_echo_client/src/dummy_psk.h

Lines changed: 0 additions & 14 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)