Skip to content

Commit e93216f

Browse files
author
Anas Nashif
committed
Merge "Merge net branch into master"
2 parents cdf754f + 77b387b commit e93216f

File tree

14 files changed

+346
-172
lines changed

14 files changed

+346
-172
lines changed

include/net/mqtt_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ enum mqtt_qos {
5656
struct mqtt_connect_msg {
5757
uint8_t clean_session:1;
5858
char *client_id;
59-
uint16_t client_id_len; /* only required for unpacking */
59+
uint16_t client_id_len;
6060
uint8_t will_flag:1;
6161
enum mqtt_qos will_qos;
6262
uint8_t will_retain:1;
@@ -66,7 +66,7 @@ struct mqtt_connect_msg {
6666
uint16_t will_msg_len;
6767
uint16_t keep_alive;
6868
const char *user_name;
69-
uint16_t user_name_len; /*only required for unpacking */
69+
uint16_t user_name_len;
7070
uint8_t *password;
7171
uint16_t password_len;
7272
};

include/net/net_if.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ struct net_if {
178178
ATOMIC_DEFINE(flags, NET_IF_NUM_FLAGS);
179179

180180
/** Interface's L2 layer */
181-
const struct net_l2 const *l2;
181+
const struct net_l2 * const l2;
182182

183183
/** Interface's private L2 data pointer */
184184
void *l2_data;

include/net/net_l2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct net_l2 {
5858

5959
#define NET_L2_GET_NAME(_name) (__net_l2_##_name)
6060
#define NET_L2_DECLARE_PUBLIC(_name) \
61-
extern const struct net_l2 const NET_L2_GET_NAME(_name)
61+
extern const struct net_l2 NET_L2_GET_NAME(_name)
6262
#define NET_L2_GET_CTX_TYPE(_name) _name##_CTX_TYPE
6363

6464
extern struct net_l2 __net_l2_start[];
@@ -95,7 +95,7 @@ NET_L2_DECLARE_PUBLIC(IEEE802154_L2);
9595
extern struct net_l2 __net_l2_end[];
9696

9797
#define NET_L2_INIT(_name, _recv_fn, _send_fn, _reserve_fn, _enable_fn) \
98-
const struct net_l2 const (NET_L2_GET_NAME(_name)) __used \
98+
const struct net_l2 (NET_L2_GET_NAME(_name)) __used \
9999
__attribute__((__section__(".net_l2.init"))) = { \
100100
.recv = (_recv_fn), \
101101
.send = (_send_fn), \

samples/net/README

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

samples/net/echo_client/README.rst

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
Echo Client
2+
###########
3+
4+
Overview
5+
********
6+
7+
The echo-client sample application for Zephyr implements a UDP/TCP client
8+
that will send IPv4 or IPv6 packets, wait for the data to be sent back,
9+
and then verify it matches the data that was sent.
10+
11+
The source code for this sample application can be found at:
12+
:file:`samples/net/echo_client`.
13+
14+
Building and Running
15+
********************
16+
17+
There are multiple ways to use this application. One of the most common
18+
usage scenario is to run echo-client application inside QEMU. This is
19+
described in :ref:`networking with QEMU <networking_with_qemu>`.
20+
21+
There are configuration files for different boards and setups in the
22+
echo-client directory:
23+
24+
- :file:`prj_arduino_101_cc2520.conf`
25+
Use this for Arduino 101 with external IEEE 802.15.4 cc2520 board.
26+
27+
- :file:`prj_arduino_101.conf`
28+
Use this for Arduino 101 with external enc28j60 ethernet board.
29+
30+
- :file:`prj_bt.conf`
31+
Use this for Bluetooth IPSP connectivity.
32+
33+
- :file:`prj_cc2520.conf`
34+
Use this for devices that have support for IEEE 802.15.4 cc2520 chip.
35+
36+
- :file:`prj_frdm_k64f_cc2520.conf`
37+
Use this for FRDM-K64F board with external IEEE 802.15.4 cc2520 board.
38+
39+
- :file:`prj_frdm_k64f.conf`
40+
Use this for FRDM-K64F board with built-in ethernet.
41+
42+
- :file:`prj_frdm_k64f_mcr20a.conf`
43+
Use this for FRDM-K64F board with IEEE 802.15.4 mcr20a board.
44+
45+
- :file:`prj_qemu_802154.conf`
46+
Use this when simulating IEEE 802.15.4 network using two QEMU's that
47+
are connected together.
48+
49+
- :file:`prj_qemu_cortex_m3.conf`
50+
Use this for ARM QEMU.
51+
52+
- :file:`prj_qemu_x86.conf`
53+
Use this for x86 QEMU.
54+
55+
- :file:`prj_sam_e70_xplained.conf`
56+
Use this for Atmel SMART SAM E70 Xplained board with ethernet.
57+
58+
Build echo-client sample application like this:
59+
60+
.. code-block:: console
61+
62+
$ cd $ZEPHYR_BASE/samples/net/echo_client
63+
$ make pristine && make CONF_FILE=<your desired conf file> \
64+
BOARD=<board to use>
65+
66+
Make can select the default configuration file based on the BOARD you've
67+
specified automatically so you might not always need to mention it.
68+
69+
Running echo-server Linux Host
70+
==============================
71+
72+
There is one useful testing scenario that can be used with Linux host.
73+
Here echo-client is run in QEMU and echo-server is run in Linux host.
74+
75+
Run 'loop_socat' and 'loop-slip-tap' scripts from net-tools in Linux host.
76+
77+
.. code-block:: console
78+
79+
$ ./loop_socat.sh
80+
81+
In another window:
82+
83+
.. code-block:: console
84+
85+
$ sudo ./loop-slip-tap.sh
86+
87+
In third window:
88+
89+
.. code-block:: console
90+
91+
$ sudo ./echo-server -i tap0
92+
93+
Run echo-client application in QEMU:
94+
95+
.. code-block:: console
96+
97+
$ cd $ZEPHYR_BASE/samples/net/echo-client
98+
$ make pristine && make qemu

samples/net/echo_client/prj_slip.conf

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

samples/net/echo_server/README.rst

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
Echo Server
2+
###########
3+
4+
Overview
5+
********
6+
7+
The echo-server sample application for Zephyr implements a UDP/TCP server
8+
that complements the echo-client sample application: the echo-server listens
9+
for incoming IPv4 or IPv6 packets (sent by the echo client) and simply sends
10+
them back.
11+
12+
The source code for this sample application can be found at:
13+
:file:`samples/net/echo_server`.
14+
15+
Building and Running
16+
********************
17+
18+
There are multiple ways to use this application. One of the most common
19+
usage scenario is to run echo-server application inside QEMU. This is
20+
described in :ref:`networking with QEMU <networking_with_qemu>`.
21+
22+
There are configuration files for different boards and setups in the
23+
echo-server directory:
24+
25+
- :file:`prj_arduino_101_cc2520.conf`
26+
Use this for Arduino 101 with external IEEE 802.15.4 cc2520 board.
27+
28+
- :file:`prj_arduino_101.conf`
29+
Use this for Arduino 101 with external enc28j60 ethernet board.
30+
31+
- :file:`prj_bt.conf`
32+
Use this for Bluetooth IPSP connectivity.
33+
34+
- :file:`prj_cc2520.conf`
35+
Use this for devices that have support for IEEE 802.15.4 cc2520 chip.
36+
37+
- :file:`prj_frdm_k64f_cc2520.conf`
38+
Use this for FRDM-K64F board with external IEEE 802.15.4 cc2520 board.
39+
40+
- :file:`prj_frdm_k64f.conf`
41+
Use this for FRDM-K64F board with built-in ethernet.
42+
43+
- :file:`prj_frdm_k64f_mcr20a.conf`
44+
Use this for FRDM-K64F board with IEEE 802.15.4 mcr20a board.
45+
46+
- :file:`prj_qemu_802154.conf`
47+
Use this when simulating IEEE 802.15.4 network using two QEMU's that
48+
are connected together.
49+
50+
- :file:`prj_qemu_cortex_m3.conf`
51+
Use this for ARM QEMU.
52+
53+
- :file:`prj_qemu_x86.conf`
54+
Use this for x86 QEMU.
55+
56+
- :file:`prj_sam_e70_xplained.conf`
57+
Use this for Atmel SMART SAM E70 Xplained board with ethernet.
58+
59+
Build echo-server sample application like this:
60+
61+
.. code-block:: console
62+
63+
$ cd $ZEPHYR_BASE/samples/net/echo_server
64+
$ make pristine && make CONF_FILE=<your desired conf file> \
65+
BOARD=<board to use>
66+
67+
Make can select the default configuration file based on the BOARD you've
68+
specified automatically so you might not always need to mention it.
69+
70+
Running echo-client in Linux Host
71+
=================================
72+
73+
There is one useful testing scenario that can be used with Linux host.
74+
Here echo-server is run in QEMU and echo-client is run in Linux host.
75+
76+
Run 'loop_socat' and 'loop-slip-tap' scripts from net-tools in Linux host.
77+
78+
.. code-block:: console
79+
80+
$ ./loop_socat.sh
81+
82+
In another window:
83+
84+
.. code-block:: console
85+
86+
$ sudo ./loop-slip-tap.sh
87+
88+
Run echo-server application in QEMU:
89+
90+
.. code-block:: console
91+
92+
$ cd $ZEPHYR_BASE/samples/net/echo-server
93+
$ make pristine && make qemu
94+
95+
In third window:
96+
97+
.. code-block:: console
98+
99+
$ sudo ./echo-client -i tap0 2001:db8::1
100+
101+
Note that echo-server must be running in QEMU before you start the
102+
echo-client application in host terminal window.

samples/net/mqtt_publisher/README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ Max number of MQTT PUBLISH iterations
6767
6868
#define APP_MAX_ITERATIONS 5
6969
70+
IBM BlueMix IoT Watson topic format
71+
72+
.. code block:: c
73+
74+
#define ENABLE_BLUEMIX_TOPIC 0
75+
7076
On your Linux host computer, open a terminal window, locate the source code
7177
of this sample application (i.e. :file:`samples/net/mqtt_publisher`) and type:
7278

0 commit comments

Comments
 (0)