Code was written using MBED_CONF_DEFAULT_* but the mbed_lib.json file
that created these values is prefixed with "nsapi" and therefore
final macros are MBED_CONF_NSAPI_DEFAULT_*
The first test focuse on the transport by testing that the reset sequence is
correctly sent to the controller and properly received.
The second test validates that the reset sequence fullfill the right state
of the stack and ensure that bluetooth initialization succeed.
If the automatic uplink is sent directly the call-stack becomes larger than 1K
which may cause serious problems in debug builds. Just to have a respite between
RX and TX we queue an event for the automatic uplink rather than directly undergoing
an automatic uplink.
A peer device that sends a connection parameter update may get block if it doesn't receive a response.
This patch accept the peer request unconditionnally. At some point this event will be managed by the application.
Depending on the role and the current state of the local device; pairing cancelation should be made with a call to a specific function. Normally the Nordic stack would reject invalid calls if the device is not in the correct state; therefore it was assumed that it was possible to detect the state from sd errors. Unfortunatelly this is not true with the latest softdevices as some calls succeed even if the device is not in the right state.
To solve that issue cancelation looks at the current state of the device first to select the right function that will trigger the pairing cancellation.
Note: the call to sd_ble_gap_authenticate was missing in the previous algorithm
LWIP stack is configured to be 1200 as default. Without debug enabled,
maximum stack size used for asynchronous DNS operations is 880 bytes. With
debug enabled maximum used stack size is 1248. Added configuration
to LWIP to increase stack size by 25 percent when debug is enabled on build.
Currently, if all TX descriptors are in use and IP stack calls K64F/K66F
ethernet driver link out, link out drops the packet. Added 10ms delay
to link out to wait for a descriptor to become available before dropping
the packet.
Changed K64F/K66F power up to return without waiting for link up i.e. for
the ethernet cable to be connected. This is needed for non-blocking use
of driver e.g. for using the driver from event queue.
RX1 and 2 delays needed to be more precise and aggregate tx time was
drifiting because of timing difference between actual tx interrupt and
our processing of that interrupt ever so slightly.
We now take a timestamp of the tx interrupt and take a time diff while
instantiating delay timers. The timestamp is then used to update the aggregate
tx time.
Two new methods are introduced in the LoRaMac class which provide current
timing and current receive slot. These functions are used by LoRaWANStack
for its processing.
Set correct SYSMPU register for proper USB operation. This bug was
introduced when the SYSMPU register names and defines were updated
in the commit:
"K64F: Updated the SYSMPU SDK driver"
93f8cfed05
Nanostack object constructor didn't actually initialise Nanostack.
Nanostack initialisation was deferred until an interface was actually
attached to the stack, which generally happened at first interface
connect.
Not normally a problem, unless you're trying to make direct Nanostack
setup calls prior to connect - some applications do this, and were
relying on ThreadInterface::initialise to do Nanostack
initialisation.
Unfortunately in 5.9 ThreadInterface::initialise no longer does
initialise Nanostack immediately, because the mesh interfaces were
aligned and integrated with the Ethernet interfaces, which did
initialisation on connect().
Make the Nanostack object constructor initialise Nanostack (as the LWIP
constructor does for lwIP), so calling Nanostack::get_instance() is the
5.9 API for Nanostack initialisation.
For future work, APIs like ns_file_system_set_root_path should be
exposed as methods of Nanostack, so everything happens with a single
Nanostack::get_instance().file_system_set_root_path().
- set ppp_active false if close fails in ppp disconnect.
- unset sigio in ppp disconnect
- take ownership of filehandle in CellularNetwork::disconnect even in case of failure
A friend class living in the namespace ble::vendor::cordio and named CordioHCITransportDriver can be added in applications requiring access to internal data of the HCI driver and HCI transport driver.
This is meant to be internal and not easily exploitable by application code.
Two cascading copy-paste errors stopped this working:
* PPPCellularInterface::get_gateway() called
nsapi_ppp_get_ip_address();
* nsapi_ppp_get_gateway() called the interface's get_netmask().
First bug has always been there - second one was introduced in 5.9.
AT_CellularNetwork currently lacks calls to get both netmask and gateway
- this patch would be needed for that when added.
Previously get_mac_address on a ThreadInterface returned the EUI-64
reported by the radio driver. This was required for commissioning, but
was inconsistent with other interfaces, and the API concept.
5.9.0 inadvertently changed this so that get_mac_address returned the
actual MAC address used by the radio, which is a hash result of the
EUI-64 for Thread.
The original "return the EUI-64" form was somewhat faulty, as
get_mac_address would not return the EUI-64 set by set_device_eui64() or
another mechanism before connect() was called.
Rather than revert to old behaviour, add a new API to get the device
EUI-64 to ThreadInterface, alongside the existing set API.
When all TX descriptors were reserved in a row so that TX buffer
reclaim interrupt did not happen during reservation sequence, after
the interrupt occurred, TX buffer reclaim did no longer free buffers.
This happened because when all descriptors were in use, last free
index pointed to consumed index.
TX pointer array was using RX ring length in its declaration.
Wasted memory if RX ring > TX ring, as is the default, but would
be broken if RX ring < TX ring.
16 RX buffers and 8 TX buffers is probably excessive. Nanostack
version of driver successfully used 4+4, and data pump should be
broadly equivalent.
This means that switching K64F devices from Nanostack to EMAC increases
base heap usage by 18K - observed in Nanostack border router builds.
Add a config option to make it possible to lower the number of buffers.
Defer consideration of lowering the default to later.
DNS resolver now counts how many sendto operations are successful
during one DNS server attempt cycle (attempting to contact DNS
servers from 0 to last index, including stack specific ones). If all
socket sendto operations fail, DNS resolution is aborted.
If one or more are successful, DNS resolution is continued until
total network attempts count is reached or all sendto operations
fails during a cycle.
If the value is an integer, the 4th bit is used for sign, so you can store
values upto 7 only whereas the datarate values could go upto 15. That's why
we need to turn this to an unsigned integer so that the last bit can also be used.
Travis astyle check pointed out some of the style mismatches in the code.
Not all of them are worth changing as they make the code unreadable and
some of them are semantically wrong.
So in this commit, we have attempted to pick the most important style
mismatches and rectify.
* CENTRAL_LINK_COUNT
* PERIPHERAL_LINK_COUNT
* gatts_enable_params.attr_tab_size
* gatts_enable_params.service_changed
* common_enable_params.vs_uuid_count
These settings control the range of functionality enabled in the softdevice as well as ram consumption.
In particular reducing these values is critical to enable usage of 16K nrf51 devices.
EMAC changes broke PPP glue - fix it up. In particular, PPP steals
the netif->state pointer, so we can't use it as a back pointer to
our LWIP::Interface.