It is useful to clone just the net_pkt which does not have any
data fragments linked to it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
While importing the nrf_power.h to use the nrf_power_resetreas_get()
function the missing header file error was presented.
Origin: Nordic SDK 12.2.0 (components/drivers_nrf/hal)
URL: http://developer.nordicsemi.com/nRF5_SDK/
License: 3-clause BSD
Maintained-by: External
Signed-off-by: Flavio Arieta Netto <flavio@exati.com.br>
Signed-off-by: flavio <flavio@exati.com.br>
With logging enabled, this leads to type mismatch warning, which is
promoted to error when building under CI.
Also, reomove extra "\n" from the logging messages.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Add a simple test which generates a file that can be included
into a .c file. Then verify in zephyr that the file contains
the same bytes as the original file.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is useful if there is a need to generate a file
that can be included into the application at build time.
The file can also be compressed automatically when embedding it.
Files to be generated are listed in
generate_inc_file
generate_inc_gz_file
variables.
How to use this commit in your application:
1. Add this to your application Makefile
SRC = $(ZEPHYR_BASE)/<your-app-dir>/src
include $(ZEPHYR_BASE)/scripts/Makefile.gen
2. Add needed binary/other embedded files into src/Makefile
to "generate_inc_file" or "generate_inc_gz_file" variables:
# List of files that are used to generate a file that can be
# included into .c file.
generate_inc_file += \
echo-apps-cert.der \
echo-apps-key.der \
file.bin
generate_inc_gz_file += \
index.html
include $(ZEPHYR_BASE)/scripts/Makefile.gen
3. In the application, do something with the embedded file
static const unsigned char inc_file[] = {
#include "file.bin.inc"
};
static const unsigned char gz_inc_file[] = {
#include "index.html.gz.inc"
};
The generated files in ${SRC}/*.inc are automatically removed
when you do "make pristine"
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This file is no longer needed as IPSS service is already enabled with
CONFIG_NET_L2_BT.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This is useful to enable error/warning logging across the net
codebase (less useful for debug level logging, but that's true
for CONFIG_NET_LOG_GLOBAL already).
Implementation-wise, instead of keeping adding to long list of
"select"'s in CONFIG_NET_LOG_GLOBAL and thus introduce component
inter-dependencies, add "default y if NET_LOG_GLOBAL" to
individual components' logging options.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
At the moment we print "Sending ARP packet" even if we found ARP entry
and send the packet directly.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This is the first part of a large refactoring of LwM2M library
message functions and will simplify observer handling later.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
All throughout the LwM2M library we use sockaddr values which are
basically the same as the net_app_ctx's remote addr. There's no
reason to keep these extra sockaddr values around. The net_app
framework client won't accept incoming requests on sockaddr other
than the one we're connected to.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
This is the final stage of moving the LwM2M library internals to
the net_app APIs. This means we can support DTLS and other
built-in features in the future. All of the logic for
establishing the network connection is removed from the sample
app.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
In preparation for the move to net_app APIs, we will need
to pass net_app_ctx structures around to the following
functions:
lwm2m_udp_sendto()
udp_request_handler()
Let's add the parameter as net_context for now so the
transition will be smoother later.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
This allows use to associate easily the replies / pending operations
with a specific network connection.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
The LwM2M library does not use net_app APIs internally. To help
this effort let's establish a user facing structure "lwm2m_ctx"
(similar to http_client_ctx and mqtt_ctx) and start it off by
wrappering the net_context structure.
Future patches will add user setup options to this structure and
eventually remove the net_context structure in favor of a net_app_ctx.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
If no gateway is set, an ARP request for 0.0.0.0 will be sent out,
which is confusing, so log as an error. Of course, logging will
happen only if enabled.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The IPv4 multicast address to MAC address mapping was missing
the 4th byte high bit clearing.
We also need to have some storage for the multicast MAC address.
This was missing which could cause NULL pointer access.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The DNS resolver example enables mDNS client support and then
queries zephyr.local hostname. The net-tools project has example
avahi-daemon script that will response these .local queries and
can be used in testing.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This implements mDNS client from RFC 6762. What this means that
caller is able to resolve "hostname.local" names using multicast DNS.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Allow the script to take multiple -f (fixup) file options. We output
the fixup files in order that the -f options are passed. This will
allow us to have a common soc fixup and board fixup if we desire.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
If there's any key in the alias which length is larger than other keys
in the node, the include file will be incorrect, there will be no tab
between the key and value.
We need to take into account the max length of alias keys.
Signed-off-by: Aska Wu <aska.wu@linaro.org>
* Instead of a common system call entry function, we instead create a
table mapping system call ids to handler skeleton functions which are
invoked directly by the architecture code which receives the system
call.
* system call handler prototype specified. All but the most trivial
system calls will implement one of these. They validate all the
arguments, including verifying kernel/device object pointers, ensuring
that the calling thread has appropriate access to any memory buffers
passed in, and performing other parameter checks that the base system
call implementation does not check, or only checks with __ASSERT().
It's only possible to install a system call implementation directly
inside this table if the implementation has a return value and requires
no validation of any of its arguments.
A sample handler implementation for k_mutex_unlock() might look like:
u32_t _syscall_k_mutex_unlock(u32_t mutex_arg, u32_t arg2, u32_t arg3,
u32_t arg4, u32_t arg5, void *ssf)
{
struct k_mutex *mutex = (struct k_mutex *)mutex_arg;
_SYSCALL_ARG1;
_SYSCALL_IS_OBJ(mutex, K_OBJ_MUTEX, 0, ssf);
_SYSCALL_VERIFY(mutex->lock_count > 0, ssf);
_SYSCALL_VERIFY(mutex->owner == _current, ssf);
k_mutex_unlock(mutex);
return 0;
}
* the x86 port modified to work with the system call table instead of
calling a common handler function. fixed an issue where registers being
changed could confuse the compiler has been fixed; all registers, even
ones used for parameters, must be preserved across the system call.
* a new arch API for producing a kernel oops when validating system call
arguments added. The debug information reported will be from the system
call site and not inside the handler function.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
gitlint was complaining about use of the word "title"
in PR #1512 doc: fix link title in linux installation guide
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Previous description of counter_set_alarm() was insufficient and
could be ambiguously interpreted.
Signed-off-by: Michał Kruszewski <michal.kruszewski@nordicsemi.no>
Fixes a tx_pkts slab leak since the cloned pkt was referencing the
original pkt slab but was not originated from it (net_pkt_unref uses
pkt->slab when releasing the pkt).
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Removing internal boolean in order to use the proper error code hold in
spi_context which was relevantly added in commit 6c717095b8.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Because a next networking API call will lead to a crash. Given that
logging can be easily disabled (disabled by default so far!), don't
be shy and call by the name (i.e. error).
Jira: ZEP-2105
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
If the IP address string is empty, then it is no use trying
to parse it. This was seen when handling DNS server strings when
user has made a mistake and defined the DNS server addresses
incorrectly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Updated debug pin mapping so that the outputs are on P3 pin
head on all nRF5x Development Kits.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixed the configuration of NRF_CCM for 2M PHY connections.
Now faster 2M data rate mode will be used when a connection
is in 2M PHY.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use correct NRF_AAR enable macro defines from Nordic MDK.
Old code funtionally worked fine even though not setting
the correct enable value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fixed a bug in the implementation of Connection Parameter
Request Procedure when initiated in master role caused the
connection to terminate with reason LL response timeout.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Based on work by Chunlin Han <chunlin.han@linaro.org>.
This defines the interfaces that architectures will need to implement in
order to support memory domains in either MMU or MPU hardware.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The status in the Command Complete event was uninitialized, leading to
incorrect contents of the event parsed by the Host. Correctly initialize
the status to success.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
RCC_HCLK_DIV1 translates to 0x0 while apb_psc uses the value defined
by CONFIG_CLOCK_STM32_APB1/2_PRESCALER (range from 1 to 16).
Manually check if the defined prescaler is 1 or not and use that to
calculate the correct timer clock.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>