net_pkt_get_reserve_data ignores the timeout parameter when in isr,
using K_NO_WAIT instead, which can lead to invalid fragment.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Per LwM2M specification 5.3.1 Register, report "ct=11543" when JSON is
supported. Also, report the resource type as rt="oma.lwm2m" when "ct="
presents.
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Per LwM2M specification 5.3.1 Register. When object instances are
available, object ID can be ignored in registration message
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
According to LwM2M specification 5.2.7.3 Bootstrap DISOCVER,
security object is only reported to the bootstrap server.
Correct the behavior to (1) report server object to the server
(2) do not report security object at registration time
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Fix checks for BT_HCI_RAW and move default range after the other range
options, required by Kconfig to avoid overwriting other options.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
This is how it's called in the main docs, so use this same phrase in
Kconfig and samples too.
Also, added some articles to docs.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The RSSI value is an 8-bit signed integer. Since the Link Layer works
only with positive unsigned integers, translate into a negative number
at the HCI layer.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This option enables full debugging output for memory allocations.
As that can produce lot of output and slow down the device under test,
it is disabled by default.
The previous CONFIG_NET_DEBUG_NET_PKT will collect information about
memory allocations but will not print any output. Use "net mem" or
"net allocs" commands in net-shell to see the memory allocation status.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Because the name of the memory pool can be quite long, print
it last so that the columns get aligned nicely.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we are not in ESTABLISHED state, then there is no need to
try to resend any pending data packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the expire send timer expires, then it sends the packet.
If that happens, then we must not try to send the same packet
again if we receive ACK etc. which can cause re-sends to happen.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the packet sending is slow then we must NOT increment the ref
count when re-sending it. This is unlikely but can happen if there
are lot of debug prints etc. extra activities that prevent the driver
to actually send the packet fast enough.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that the sent flag is only set after we have really
sent the packet and the driver has verified that.
If the net_pkt_set_sent() is called while still in tcp.c, then
depending on how fast the device is, it might happen that the
retry timer expires before the packet is actually sent. This was
seen in frdm-k64f with ethernet and various debug prints activated.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If there is a backlog entry when TCP context is released, then
cancel the ACK timer if one exists.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that a network packet is sent after calling
http_response_send_data(). Othwerwise the packets might be
piling up and not sent in timely manner.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Some older C libraries do not have errno for EPFNOSUPPORT.
Fixes issues with newlib in some versions of Xtensa XCC compiler.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The initial function prototype did not have 'inline' in it,
resulting in a compiler warning with XCC.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
It's never a good idea to redefine functions as macros if intended
to be unused in some configuration
- "statement with no effect" warnings
- "unused argument" warnings
- No type checking done if the macros are used
These have been redefined as empty inline functions.
Fixes compiler warnings with XCC.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The second 'const' is misguided, indicating that the returns pointer
value itself cannot be changed, but since pointers are passed by value
anyway this is not useful and was generating warnings with XCC.
The leading 'const' indicates that the memory pointed to is constant,
which is all we needed.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Inline functions declared in header files need to be declared
static. Fixes a compiler warning with XCC compiler.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Older value of 256 was introduced in 1.7 times. Testing on
BOARD=96b_carbon with 2 weeks old codebase however showed that TX
thread stack however can grow to 324 bytes. Finally, with the
latest master, following stacks are reported on BLE disconnect
(with CONFIG_INIT_STACKS enabled):
rx stack (real size 1024): unused 452 usage 572 / 1024 (55 %)
tx stack (real size 384): unused 16 usage 368 / 384 (95 %)
Two outcomes:
1. TX stack needs increase.
2. Over time, the stack usage grows, plus variations in SPI
drivers should also be taken into account.
So, increase the stack size to 416 bytes, to leave some headroom
beyond the immediate values seen on 96b_carbon.
Jira: ZEP-2510
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Currently, the HTTP_NETWORK_TIMEOUT setting is hard-coded as 20 seconds.
Not every application may want to wait that long, so let's change this
to a CONFIG option: CONFIG_HTTP_CLIENT_NETWORK_TIMEOUT
NOTE: This also removes HTTP_NETWORK_TIMEOUT from the public http.h
include file. It was not being used externally to HTTP client sources.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Add a sample application that allows a Zephyr-based Bluetooth
controller to interface with an HCI driver via SPI. This sample
implements the same BT SPI protocol already as Zephyr's HCI SPI
driver.
Currently, the sample only supports the legacy SPI API.
Provide a single configuration file, avoiding board-specific
files. Some board-specific configuration information must be provided
via other means:
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_PIN
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Since Extended Scanner Filter Policies is an independent feature from
Controller-based Privacy, split it out so it can be built independently
and included without it.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
A TCP FIN message is passed on to user apps as a tcp_received_callback
with a NULL pkt parameter. This means the connection is closing and
the app should do whatever cleanup it needs as there will be no further
callbacks for the current TCP connection.
Currently, if a HTTP client request doesn't receive a "body" which
the HTTP parser can use to trigger on_message_complete, then the request
will end up timing out and most apps will think an error has occurred.
Instead, let's handle the TCP FIN message and return the waiting
semaphore, leaving the app to deal with whatever has been set in the
current HTTP context response data (IE: http_status).
This fixes using HTTP client to send POST data to servers which
only respond with HTTP_OK status and no body.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Unless offset was specified, it should default to 0, whereas
previously, value from the last command was used.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
"Network Application Support" itself is renamed from "Network
Applications" and also includes net_app API.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Whenever privacy is enabled, we support the Extended Scan Filter
Policies functionality, and therefore we must show it in the bitfield of
LE supported features for the controller.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Rename the BT_CONTROLLER prefix used in all of the Kconfig variables
related to the Bluetooth controller to BT_CTLR.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Avoiding segmentation in the GATT-based Mesh Proxy protocol requires
having an RX buffer length of at least 77. We could round it up to 80
since there's otherwise wasted space, however there's also
BT_HCI_RESERVE to consider, so to avoid pushing over the 4-byte
boundary for certain HCI drivers just leave the size at 77.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is needed in order to get information which function is
doing the ref. With inline function this was not possible.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of printing [net/net_pkt], print [net/pkt] if debug log
is enabled for network packet allocator. The double net in earlier
print is redundant information.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of always have CONFIG_NET_IPV6_MAX_NEIGHBORS parents,
use CONFIG_NET_RPL_MAX_PARENTS when creating the parent table.
Default value for max parents is the max neighbors so no
functionality changes are introduced here.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of always having CONFIG_NET_IPV6_MAX_NEIGHBORS number
of items in neighbor pool, store the neighbor count in the pool
and use that value when traversing the neighbor table.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Allow user to define what kind of network the RPL should serve.
Currently options will be either ANY or IEEE802154. If there
is only one network interface in the system, then ANY will take
the default network interface and use that. If there are multiple
network interfaces, then one should not use ANY as the default
network interface might not be the expected one.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Print network interface where the DIO, DIS or DAO was sent. This is
useful if we have multiple network interfaces in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When printing network interface specific data, print also
the type of the network interface (ethernet, bluetooth etc).
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the user has not specified CONFIG_NET_APP_MY_IPV4_ADDR or
CONFIG_NET_APP_MY_IPV6_ADDR, the value is set to "" in this case.
This will be converted to ANY IP address which is not useful
to be set to the network interface. So check this and just
continue the init in this case without setting the IP address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The documentation says that the API will automatically append the
net_buf fragment to the end of network packet fragment chain.
This was not the case and current only user for this API in
echo-server sample appended the fragment itself. The fix is to
automatically append the fragment to the end of fragment chain.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>