Commit graph

41120 commits

Author SHA1 Message Date
Jukka Rissanen
05d8a096e1 net: apps: test_15_4 fixes when running in one qemu
Made the test_15_4 application to run much faster when it is
running inside qemu (started with make qemu0).

Change-Id: I4455eca4f0426e8acc8b87d93eb80f4d179a1b48
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
b8fb7ebd02 net: apps: Fix the 802.15.4 monitor application
The 802.15.4 monitor application had issues with connecting
pipes together and making sure the first byte from qemu is
not lost. Before starting real data connection we send five
null bytes and the discard them in receiving side.

Change-Id: I376ae4f79aaa1ea742640999ec5b3d9c57a1279a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
83dd828d58 net: apps: Add readme file describing various IP stack examples
Change-Id: I22cd281ae3157f0638c773e2c251289b51da78a9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
9368afd336 net: apps: Connect echo-server and echo-client tests together
It is now possible to loop echo-server and echo-client test
applications together when they are running in qemu.

Start echo-server with "make server" and echo-client using
"make client" in the corresponding samples directory.

Change-Id: Ic852735f7bebc93e42873e98427e282902b3ca03
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
40638b3ad4 net: Additional checks for length of the data to be sent
Dummy 802.15.4 has now some additional check to verify that we
are really sending correct amount of bytes.

Change-Id: I4d223c02e2628966e3b1a3cdcf7b560043d7d788
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
03e0d10ab3 net: contiki: Remember original data length when sending
If the stack is sending network packets by itself, like when
sending router or neighbor solicitation messages, then remember
the original length of the message. This is important because
uIP stack will clear the length of the sent message after it
is sent.
After this change, the lower level drivers can use
the net_buf_datalen() to get the original length of the
buffer. The issue is seen because uIP stack is running in
different fiber than the network device driver.

Change-Id: I6078c5d716bba455a93be9be122e97cd24b8dc0e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
ddab4c11af net: contiki: Print debug information about fragment length
Print information about how much data we are losing if
null fragmentation is used.

Change-Id: I2f18d180a4c75768534de851c7cc27c3e70ca310
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
d9e0f0494a net: User can select the desired 6LoWPAN compression method
Adding selection of 6LoWPAN compression method to Kconfig.
Possible values are:
* no compression
* IP header compression

Change-Id: I8721fa683f7488ec9ad0bf37f6637fa264c2038f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
c890edc687 net: 802.15.4: Allow user to set the PAN id
User can set the desired network id from Kconfig.

Change-Id: Iac9de1deb2b01bcfcb3382849d451dce1a05077a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
3c1f69dcbc net: 802.15.4: Fix the sent network buffer length
When 802.15.4 code is receiving the network buffer, the uIP
stack might have zeroed the buf->len value. Restore it back
here so that other parts of the stack will get sane value.

Change-Id: I8fb3c1d3a3c9b0f41f3915d0f31d78afeccf68b6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Szymon Janc
af98cbc1b6 Bluetooth: Move HCI core code to reduce number of ifdefs
Gather connection and SMP related code togerther to that those can
be places under single blocks of ifdefs.

Change-Id: Ief418536e0e0f389fdde3bb3ac8b85bcfce9ac79
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Szymon Janc
ca9d755073 Bluetooth: Enable stack analysis in tester application
This allows for compile test if analysis code builds.

Change-Id: I500d727a06ef065fc65465140062ec47d31e79fa
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Szymon Janc
68d7688aff Bluetooth: SMP: Add timeout fiber stack analysis
This allows to monitor stack usage in timeout fiber. Since timeout
fiber migth not be even started (eg when there was no SMP command
sent or receive) analysis is done only when timeout fiber is stopped.

Change-Id: I0ff6c081b9077f8f8294386306a3fe0ed77099a8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Szymon Janc
eb42877662 Bluetooth: Use common code for stack usage analysis in HCI code
Change-Id: I5844b9de73391308ab1e4b928a524f1eb4d13813
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Szymon Janc
edf9cc3065 Bluetooth: Add new code for stack usage analysis
This introduces simple API for analysing stack usage. Stack growth
direction is determined on build instead of runtime.

Change-Id: Iacb160d088cc0af57e2e9dedc72cbc5e31fd22f4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra
01bec178dc Bluetooth: Handle read supported gatt server commands
This will be used to poll Zephyr to send it's supported commmands.

Change-Id: I12cb93a238cd14589123d88e9d9ba4d580dd6d71
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra
b75915e366 Bluetooth: Add read characteristic value callback
This is used to respond to the read request of characteristic
value.

Change-Id: Ia0518fae0d70e712621578a7938009345dbfaab4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra
865a087e76 Bluetooth: Handle Set Characteristic/descriptor value
This adds support to handle set attribute value.

Change-Id: I2631cc8744210cfd76add1be3d30e5a0f54b3a7e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra
cc3949fec4 Bluetooth: Handle Add Characteristic command
This adds support for adding characteristic declaration and characteristic
value to the tester defined database of GATT attributes.

Change-Id: I108fc5a9bc5c7491fc354c71457d452baaedd868
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra
9624fe8732 Bluetooth: Add support for GATT Server to tester application
This adds support for tester application to cover GATT Server
automated tests. BTP ptotocol commands are used do drive stack to
build attributes database specified by the external tester.

Two commands: to add a service and to start the GATT server are
implemented.

Change-Id: I236c3e4d8636e97926514b2099779cb4334e95cd
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra
7bb885198d Bluetooth: Extend BTP Specification to cover GATT Server
This adds protocol specification for GATT Server.

Change-Id: I2f6083b15c483fb1348f6c108fd54f890d45b83d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Szymon Janc
10c56223c9 Bluetooth: SMP: Add support for SMP timeout
Add support for timing out SMP commands. Timer is restarted on sending
any SMP PDU and if reached 30 seconds pairing procedure shall be
considered to have failed.

This was affecting TC_PROT_BV_01_C and TC_PROT_BV_02_C SMP
qualification tests.

Stack size used by timeout fiber is based on observation:
smp timeout (real size 128):    unused 16       usage 80 / 96 (83 %)

Change-Id: I87a16cc51046b6a2487a0a1a736035d64b011d09
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Johan Hedberg
02b06acf8d Bluetooth: Fix reported name for RX prio fiber
Change-Id: Id2e5bfe42658f4b579258ac2855a384a558d27a0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:25 -05:00
Szymon Janc
1ffed52c45 Bluetooth: SMP: Don't start pairing if it is already in progress
Change-Id: Ie720e4facb00de3c2fe8b8635a84b4b96a1bee53
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Szymon Janc
e8bcb6afc0 Bluetooth: SMP: Track if pairing is in progress
This patch adds additional flag that is used for tracking if pairing
is in progress.

Change-Id: Ie21b8d9440ea4bc64dd552d49eaebfd4b569f176
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
c8830c8a14 net: rpl: Fix compile error when debugging is activated
Parent link metric was incorrectly printed.

Change-Id: I479820f850d8e9a5459667d58bc35c8174a77559
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
c295cd5b62 net: rpl: User can enable RPL probing support
When enabled, probes will be sent periodically to keep
parent link estimates up to date.

Change-Id: Ia7f1fe7cd28bb487c64a41159fffdf3665e9e1df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Jukka Rissanen
0ddb10f155 net: rpl: User can configure used objective function
User needs to be able to configure used OF as all RPL nodes
in DODAG need to use the same OF. Default OF is MRHOF RFC 6719.
Other alternative is OF0 RFC 6552.

Change-Id: I6d135a6a2c6880a919993e29b0985d4c686b8a9d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:25 -05:00
Arkadiusz Lichwa
c52cae5366 Bluetooth: GATT: Fix differentiate errors on write ccc
Refines errors check when attempting to write over the boundary
of attribute room.

Change-Id: Ia27b86ce380a178b8e7834adf6da4009a6d60233
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra
5438f7b96b Bluetooth: tester: Handle Set Connectable command
This patch is needed to be able to test zephyr against tests
which require Zephyr to be non-connectable.

This adds handler for the opcode 0x06 - Set Connectable command.
Based on connectable flag in current settings, the corresponding
advertising type is set after issuing Start Advertising command.
If connectable, Connectable undirected advertising type is set,
if non-connectable Non connectable undirected advertising type
is set.

Change-Id: I77865b67c4b717548095ac5e398a873d1b739d6a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra
926e65fe3b Bluetooth: tester: Handle disconnect command
This feature is needed to pass some tests which require termination
of ACL link.

Change-Id: Idab03c569172ea6deb3bc5cf6744e5e73bd5de3e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra
8505cc9b37 Bluetooth: tester: Fix Start/Stop Advertising responses
According to new tester API in case of success Current_settings
shall be returned.

Change-Id: I1caf05180bff4756b8e7271098611d23200af8ee
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Jukka Rissanen
1dedbd28e6 net: contiki: Remove unused variable declaration
The etimer.c does not need to know about ctimer_process so
remove the extra variable.

Change-Id: I761a9d79c09876c5270e294dd008a8821705e9a2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:24 -05:00
Jukka Rissanen
2734af4742 net: rpl: Free received net_buf in case of error
The code did not mark net_buf to be freed in a case of error
when receiving data. This caused the system run out of network
buffers very fast. It is necessary to set uip_len variable to 0 so
that the upper stack can free the buffer in this case.

Change-Id: Id5e009affcb2ce916f21fcf60060efb1c6d1ec0c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:24 -05:00
Jukka Rissanen
5ca530c5cb net: rpl: Fix the net_buf handling
Allocate a net_buf when a network packet is about to be sent.
Earlier one statistically allocated buffer was used for sending
RPL packets but this did not work well enough and it cluttered
the RPL APIs with redundant net_buf parameter.

Change-Id: Ib4160167f8deac83c30852af2346acdf6c6f711b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:24 -05:00
Jukka Rissanen
62b67666d8 net: contiki: etimer should call proper handler
When the timer is set, the caller needs to specify the function
that is called when timer expires.

Change-Id: Iae69986c6f32b789d708247b187d143e45d73828
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:24 -05:00
Jukka Rissanen
9b18a6d0bb net: Increse the size of timer stack to 1K
The RPL support needs bigger stack than 600 bytes.

Change-Id: If61fb2b4874d32d6e02c8e510cccd45246332da5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:24 -05:00
Jukka Rissanen
a9c39988ed net: rpl: Print RPL statistics if enabled
Print RPL statistics in the general IP statistics printing
function if CONFIG_RPL_STATS is defined.

Change-Id: Iefc3a1e5186b052e91b17309a6e9fdeb2fa70886
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:24 -05:00
Jukka Rissanen
aa73046f24 net: rpl: Fix compilation error if debugging is enabled
Need to use pointer when printing link address.

Change-Id: Ied7fcbefc02034e0ddbe714716b883de33d1e724
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:24 -05:00
Jukka Rissanen
ae97505279 net: contiki: If we do not have 802.15.4 then use nullrdc driver
For RDC (Radio Duty Cycling) we activate nullrdc driver
if 802.15.4 is not used.

Change-Id: I793b84ee8e81cdbc8315758f1b83f7ad3bd7555a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra
fa48de9e9a Bluetooth: Add connect/disconnect commands to BTP spec
These commands are necessary to pass some of the GAP tests.

Change-Id: Ia599e7dc3dd06aa5ac4130e0d878fcddad7b37dd
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra
85c6194670 Bluetooth: shell: Replace xtoi with strtoul from libc
Change-Id: Ibb6356f5d2dc041b5637abfdfcf5e3dc1a00ea77
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc
68382388ce Bluetooth: Disable parts of public API if not configured
Depending on selected Kconfig options some parts of public API
are disabled with #ifdefs. This should make it easy for user to
figure out which options should be enabled to specific API.

Change-Id: I4ae1bfd7bf535ea45869772c429ccd3d3d4c214e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc
c0650518d6 Bluetooth: Make BT buffers connection support optional
This allows to reduce BT buffers used if connection
support is disabled.

Sample beacon application size reduced from 15212 to 14956 bytes.

Change-Id: I431ea5087706a06eaea76d572839c3afebfb963e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc
a766fd1851 Bluetooth: Refactor bt_buf_put function
Make connection related code splitable. This is in preparation for
not compiling connection related code.

Change-Id: I24e21eb553da4a3522916e5cfe17e4b51526ad4d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc
9ecbd34f89 Bluetooth: Add support for disabling GATT client support
Binary size reduction of sample peripheral app:
45940 -> 45772

Change-Id: Ia8c463c9642a2928c2cb2ec48d9e9c4eeef20fe7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc
9c2ad108b8 Bluetooth: Add option for disabling SMP support
This allows to not compile SMP support for devices that don't
require pairing. It is required to support SMP channel and reply
with error for any command received even if pairing is not supported.
To handle this cleanly a null smp implementation is used that case.

Change-Id: I656a52dac882839db904eee65f25a4e29ea2d8c2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc
4c901ac75d Bluetooth: Add option for disabling data signing support
This allows to not compile data signing support if it is not
required. Reduces image size of peripheral sample app from
45772 to 44436 bytes.

Change-Id: I2cd3515973d1a70f478cbd68426ec84fd1645d19
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc
8ff443b1c9 Bluetooth: Add initial Kconfig split options
This allows to specify which roles are supported. Broadcaster and
Observer roles are always supported.

Image size reduction for samples apps:
beacon     43148 -> 15196
central    46892 -> 46356
peripheral 47532 -> 45940

Change-Id: If260c13d63651b9b54df5bafc2c412b01dcb1eb0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc
46ad2cf69a Bluetooth: SMP: Fix pairing method in gen_table
If remote IO capabilities is KeyboardOnly and local is KeboardDisplay
passkey should be displayed on local side.

This was affecting TC_PKE_BV_01_C Security Manager qualification test.

Change-Id: I4d21925f3f0903250b190ae83eee7f4529114579
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00