If mbuf could not be allocated, then do not try to free it.
Change-Id: Idf48f9f2eda260b8560a5388c920a9d9a3ef8f16
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The stack usage was not printed often enough when receiving
and sending 802.15.4 packets.
Change-Id: I61a4b6acdc10cb1681e2aeb63cb6af7a35834dff
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The TX stack usage data and statistics were only printed
if there was an error. This happened very seldom which was
not very helpful.
Change-Id: I059cf9ee3449e5b39d872ef6026df968d86d0209
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If IPv6 packet length is incorrect, then print the actual
length values for debugging aid.
Change-Id: I20d4d73efd1e0103f670e8e53ba6417a4795ab80
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If one has 802.15.4 network and tries to compile without
6lowpan, then print warning as that combination is not a
usable network setup. It can be used for testing but not
for real live setup.
Change-Id: I3b540686c8556ed0306723834ca38633aff63165
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the fragmentation header is missing, then do not discard
the message but pass it to upper layers as is. The fragmentation
header might be missing if the packet fits into 128 bytes.
Change-Id: I39d29e7ad80be5531262a0ac413d8137da0c64f5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
No need to compile sicslowmac.c if we do not have 6lowpan.
Change-Id: I8624089f4b360fb12ef1c4a6d7104f0b190f048c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This collects received statistics from layer 2 (MAC).
Change-Id: Ie869c1209bd06f0a5ccad5094b0cafe5fe74d787
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This collects byte counts from layer 2 (MAC).
Change-Id: I16c25f7ae8b9aa485e3c5f1573154cd2270cff93
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The statistics counts were not initialized so the numbers were
mostly bogus.
Change-Id: If4c33701fbdc4d4603d708c69950a8a18f8eaeaf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
There is no need to define keys types if SMP is disabled.
Change-Id: If6b653906df4623f440b258afd574722498109d0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Gather central and peripheral related code togerther so it can be
placed under single blocks of ifdefs.
Change-Id: Ia5fe45b86173b0e647b582bf2cd96fc7c9cb7feb
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Gather client related code togerther so it can be placed under
single blocks of ifdefs.
Change-Id: I6f2f5a06c0308b885d01fc6af300b162baec0823
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Gather SMP related code together so that it can be placed under
single blocks of ifdefs.
Change-Id: I3c2e71243b694e9984ae8e88025a6ead7969e020
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This fix a regression that cause identity address to be passed to
LE Create Connection HCI command. This was affecting connecting to
iPhone. Regression was introduced in beaf30fda7de1476c742a
(Bluetooth: Simplify check_pending_conn function).
check_pending_conn now takes two addresses: ID and real address.
ID is used to find connection object and real is used in LE Create
Connection HCI command. If no IRK is present both addresses have
same value. This is to avoid double lookup of ID address for every
advertising report.
Change-Id: I6b86a698087889c4e6c2a1cbc9a688a804cfeb84
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This reduces number of idefs cuts and make code much easier to read.
In case of SMP not supported (or connection support since SMP depends
on it) find_id_addr is simplified and will most likely be inlined by
compiler resulting in no-op.
Change-Id: Ib16d1508c5664fcb58f619b090a5d62b2ecfe8c5
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Added -e option to echo-client and it will not quit but just
send data forever to the echo-server.
Change-Id: I9085220844b5bc45b2b7fffc46fb1b9e93235307
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we receive too long message in dummy radio driver,
then we need to discard the packet as we cannot handle
it anyway.
Change-Id: Ibed0ac5f1568dd791dec3e780c7f6c71914d02cd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
User can set the desired network id from Kconfig.
Change-Id: Iac9de1deb2b01bcfcb3382849d451dce1a05077a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
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>
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>
This allows for compile test if analysis code builds.
Change-Id: I500d727a06ef065fc65465140062ec47d31e79fa
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
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>
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>
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>
This is used to respond to the read request of characteristic
value.
Change-Id: Ia0518fae0d70e712621578a7938009345dbfaab4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This adds support to handle set attribute value.
Change-Id: I2631cc8744210cfd76add1be3d30e5a0f54b3a7e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
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>
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>
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>
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>
Parent link metric was incorrectly printed.
Change-Id: I479820f850d8e9a5459667d58bc35c8174a77559
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
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>
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>
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>