Added check for valid interface ID to network scan timer start so that it
is not triggered after disconnect. Added variable for mac api so that it
is not tried to set again after re-connecting.
Removed main tasklet ID and used instead tasklet id. Added check
for valid interface ID to network scan timer start so that it
is not triggered after disconnect. Added small delay to re-connect
so that stack has time to send its status events to application
after disconnect.
When application requests link check request with add_link_check_request()
it was added to MAC command buffer. Again when actual TX was started,
stack cherry-picked the request into MAC buffer again resulting in a duplicate
entry in the buffer.
Functionality is changed now so that add_link_check_request() does not add
the request into MAC command buffer but it is cherry-picked into the buffer when
TX is issued.
set_next_channel() is the base function provided by LoRaPHY class and should be overridden
by the PHYs who behave differently as compared to EU868 like PHY layers.
CN470 PHY had been missing such an override.
In addition to that we have provided a parameter "fsb-mask-china" that can be used to
enforce a custom frequency sub-band of operation as most of the base stations in the market
may not support all 96 channels. Such a strategy will help in rapid network acquisition.
Users often use "show declaration" (or similar) in their IDE to see descriptions of callback
methods so the function descriptions should be placed close to function declaration itself.
This phy implementation was just to support a single sub-band in US region.
As we have decided to make FSBs configurable, we do not need this class anymore.
Just like US915 PHY, user can define a custom FSB mask for AU915 PHY.
This helps deployments where base stations do not portray full feature
channel sets and choose to stick with sub-bands.
[Warning] InternetSocket.h@237,10: 'InternetSocket::_factory_allocated' will be initialized after [-Wreorder]
[Warning] InternetSocket.h@236,23: 'volatile unsigned int InternetSocket::_pending' [-Wreorder]
[Warning] InternetSocket.cpp@22,1: when initialized here [-Wreorder]
As a part of the v1.6 update, littlefs added proper handling for
cleaning up memory in the case of an error during mount. This took care
of a memory leak users were seeing. Ironically, it turns out the implementation
and user patterns in mbed-os was _relying_ on this memory leak to avoid a
double free in the same case of an error during mount.
The issue was that a failed mount would leave the LittleFileSystem class in a
state where it thought it was mounted, and later it would attempt to
unmount the filesystem. With the previous memory leak this would be
"ok", and the leaked memory would be freed. But with the fix in v1.6,
no memory is leaked, and the incorrect free triggers a hard fault.
Fixed to clean up state properly on failed mounts.
Some LoRaMac methods were defined as public even though there were used only
internally.
Also removed definition of some methods which were not even implemented nor used.
- Duty cycle can be now only disabled with duty-cycle-on flag if region supports duty-cycle.
If region does not support duty-cycle, this flag has no effect and duty cycle is always
disabled.
- Also introduced a new flag (duty-cycle-on-join) to disable duty cycle for JOIN requests.
This flag can be used for testing only and is used to speed up JOIN request testing as
backoff times for JOIN request are really long (easily several minutes per attempt).
This flag works in conjunction with main duty cycle setting. Disabling duty-cycle-on-join
works only if duty-cycle-on is disabled (or region settings have duty cycle disabled).
In #b0b0261 we changed the RX2 data rate to start from the highest data rate
available for the PHY rather than standard defined DR.
This introduced a regression, i.e., even when somebody changed the default RX2 data
rate to something usable for their environment, it didn't take any effect. As in
reset_mac_params() we override the data rate with max value possible for that PHY.
This commit restores the original behaviour and we always use standard defined
values.
Typo in the config file made the LwIP stack way too small on EFM32GG11 STK3701 target. Additionally, the EMAC thread stack was slightly too small when debug printing is on.
In release builds where MBED_ASSERT macro is syphoned off, we were hitting
an unused variable warning. To mitigate that we could direct the variable
used in MBED_ASSERT to void.
Fixes error: IOTCLT-2900 - Blockwise handling leaking memory in some error cases
* Fix memory leak when clearing blockwise payload list
* Token was not freed from the list when closing down the library
Fix unused parameter - warning when blockwise is not used
In order have a consistent return value for all methods in case of system is uninitialized
now also send and receive methods can return LORAWAN_STATUS_NOT_INITIALIZED.
Thix commit fixes a bug where stack was resending join-accept already
after RX1 if received join-response was invalid.
Stack should wait for RX2 before resending the join-accept.
LoRaMAC was not initialized properly if application called
connect(const lorawan_connect_t &connect);
This causes problems for example in case where application
first disconnects and then reconnects as counter values are not
initialized.
When node sends a CONFIRMED message and gateway sends ACK in RX1 window but the
message gets corrupted during the transmission (e.g. MIC fails), currently
our stack already checks for retransmission after RX1 and if retries attemps are
exhausted, TX_ERROR event is sent to application. This is wrong as MAC layer
will still attempt reception in RX2 window.
This commit fixes the behaviour so that TX_ERROR is not sent until RX2 window
has been closed.
By default, all mbed-os software is under Apache 2.0 license. This is
the license followed by the littlefs C++ wrapper. Note this is not true
for the C implementation.
For speeding up of LWIP in RZ/A1, I added four new config processes in mbed_lib.json and lwipopts.h, overriden those values.
Since RZ/A1 incorporates a large memory, can actualize speeding up by running with the override value.
Also those new config processes will be helpful for more customize.
It is quite possible that the user request for scheduling an uplink is deferred because of backoff or if it was a CONFIRMED message, a retry may take place on a different datarate and different channel.
We didn't have a hook for such deferred scheduling, telling the user whether the async rescheduling worked or not. This commit adds that capability and now we can tell the application if a scheduling failure took place after the original schedule request was accepted.
failed of its own accord) would prevent futher connect()'s due to the
CONN_IN_PROGRESS_FLAG remaining set. This change clears that flag in
the two cases described.
Ignore TEST_GROUP by AStyle. As this uses macro, is not visible to formatter.
By default, it assumes it is a function and treats methods as blocks inside a
function (inlined {}). We ignore it.
We might just not format UNITTESTS in the future if we face similar issues
in the future.
We had a bug especially in the reception path. Our recv window opening
delays were being calculated on the premise that the radio has to capture
5 preamble symbols out of 8 transmitted by the base station. However, in PHY
layer while setting radio rc settings, we were setting preamble length to be 8.
Preamble length register needs to be configured differently for Uplink and Downlink.
For uplink, we wish to transmit 8 preamble symbols whereas in the reception path we need
to receive 5 preamble symbols at least out of 8.
Alongwith that the maximum range of timing error may vary from platform to platform as it
is based upon the crystal in the chip. We have now made these parameters configurable and
have loaded them with the most optimal defaults.
The issue rose up when using ARMC6. A test case didn't initialize NetID
parameter for ABP while using connect(params) API. NetID is the first 7 bits
of the Device Address. It makes sense to actually remove the net-id parameter
from ABP settings as the stack can deduce it from device address. However, the ABP
structure is exposed in public APIs, so we can't really do that at the moment.
Simpler fix is to move the mask that helps us to extract first 7 bits of the device address
is exposed in lorawan_types.h and the user can use it to deduce correct net-id.
DR7 is used for FSK in AS932 region. As a default max DR, we should use a LoRa modulation
compatible data rate. Ofcourse if a device wishes to use FSK, it can set DR7 using set_data_rate() API
and turning off ADR, or an NS can configure a new channel for the device utilizing DR7.
The stack was trying to connect with default data rates which happened to be
the lowest data rates in a specific region. In the beginning device and NS do
not have agreed upon tx rx parameters and there can be synchronization issues.
When we use lower datarates, we may end up having a minute and a half long
transmissions that hnot only blocks the channel for a long time but also reduce
the chance of proper synch between device and NS. That's why we have decided to
begin with higher data rates and gradually decrease datarate if we do not hear
from the network server.
In the case when an automatic uplink was queued and the user do have something send,
we should give priority to user data instead od automatic uplink message.
This commit fixes some bugs from cancel_sending() method:
- System crashed if method was called before initialization.
Now LORAWAN_STATUS_NOT_INITIALIZED will be returned.
- Method returned LORAWAN_STATUS_BUSY error when no send request was pending.
LORAWAN_STATUS_OK should be returned in this case.
- LORAWAN_STATUS_BUSY is now returned if backoff timer is just about to be
dispatched (time_left returns 0).
I changed stack size because the deafult stack size may not be enough for
Ethernet of GR-PEACH(Cortex-A).
- Stack size is default size + 128 byte
In order to maximize the performance of Ethernet, I changed heap size to
below.
- Heap size is default size * 32 byte(send descriptor num is 16 and recv
descriptoer num is 16).
The integration is simply to define the macro MBEDTLS_HAVE_TIME_DATE
in the features/mbedtls/platform/inc/platform_mbed.h. The default
implementation of the mbedtls_time() function provided by mbed TLS is
sufficient to work with mbed OS because both use POSIX functions.
51f92b0efd introduced
handling for connection attempts while a connection was already underway or have been
completed. Unfortunately a similar check slipped through and the stack was not able to continue
sending join requests if an error happened.
It was pointed out in #7432 and #7232 that the stack was comparing frame payload size
with the allowed payload size in a wrong manner in shcedule_tx().
We must strip the overhead from the frame before comparison.
We did have a similar check in prepare_ongoing_tx() API which would correctly analyse
the situation but a check was needed in schedule_tx() as well. The reason is that the
schedule_tx() API can be called automatically by the stack if the user intiated requested
was not promptly entertained because of duty cycle restriction. Now, the datarate can change
here (for CONFIRMED messages if the ack was not received after retries max out). That's why
a test for validity was needed.
We now perform a comparison using _ongoing_tx_message structure which contains the actual
FRMPayload size.
For proprietary type of messages only MHDR and Port field is used so we shouldn't add MAC commands
and other overhead into them.
In order to have consistent frame overhead, we have opted to always include Port field in the
frame.
The TEST_SKIP and TEST_SKIP_UNLESS macros (w/ and w/o messages) allow the test
to skip the test case execution from the point the macro was called (without
failing the test).
For ABP: First call to connect() or connect(params) will return LORAWAN_STATUS_OK
and a CONNECTED event will be sent. Any subsequent call will return
LORAWAN_STATUS_ALREADY_CONNECTED (posix EISCONN) and no event is generated.
FOR OTAA: First call to connect() or connect(params) will return LORAWAN_STATUS_CONNECT_IN_PROGRESS
and a CONNECTED event will be sent whenever the JoinAccept is received. If the application
calls connect again before receiving the CONNECTED event, LORAWAN_STATUS_BUSY will be returned.
After the CONNECTED event is dispatched, any subsequent call to connect() or connect(params) API
will be returned with LORWAN_STATUS_ALREADY_CONNECTED.
No new parameters are accepted after the first call. The application must disconnect before making
a connect() call with new parameters.
This is a remedy for the issue #7230.
While the device is joining, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned.
However, if the device is already joined, we will return LORAWAN_STATUS_ALREADY_CONNECTED.
Instead of giving LoRaWANTimeHandler object as parameter for constructor,
object is now given via own initialize() method.
This change is needed for future refactoring where application can give own
PHY object for LoRa stack.
In rx_config(params) API we shouldn't check for radio state as radio may never get
idle for a class C device. That check made sense only for class A. As the PHY layer
have no conecpt of receive windows which is a MAC layer construct, we should remove the
state check.
The API will be changed later to void rx_config(params).
In addition to that another bug is fixed in the open_rx2_windows() API. We should set the rx slot
first before instantiating a test based on its value.
Setting ""nsapi.dns-cache-size": 0" still left some of the DNS
caching code in. Add crude #if to remove all of it.
This allows one to save 429 bytes of flash and 48 bytes of RAM on
ARMC5 builds.