Skip to content

Commit

Permalink
Merge pull request #6697 from ARMmbed/release-candidate
Browse files Browse the repository at this point in the history
Release candidate for mbed-os-5.8.3
  • Loading branch information
0xc0170 committed Apr 24, 2018
2 parents f9ee4e8 + ed4df0b commit c05d72c
Show file tree
Hide file tree
Showing 278 changed files with 43,770 additions and 5,539 deletions.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

<!--
Required
Please tick only one of the following types. Do not tick more or change the layout.
Please add only one X to one of the following types. Do not fill multiple types (split the pull request otherwise) or
change the layout.
[X] Fix
[ ] Refactor
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ matrix:
# update status if we succeeded, compare with master if possible
- |
CURR=$(grep -o '[0-9]\+ cycles' prof | awk '{sum += $1} END {print sum}')
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
| capture(\"runtime is (?<runtime>[0-9]+)\").runtime" \
Expand Down Expand Up @@ -193,7 +193,7 @@ matrix:
# update status if we succeeded, compare with master if possible
- |
CURR=$(tail -n1 sizes | awk '{print $1}')
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
| capture(\"code size is (?<size>[0-9]+)\").size" \
Expand Down
6 changes: 6 additions & 0 deletions features/FEATURE_COMMON_PAL/mbed-coap/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [v4.4.2](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.4.2)
**Closed issues:**
- IOTCLT-2469 CoAP UDP retransmission does not work for blocks after first one for requests (Eg. registration POST)

-[Full Changelog](https://github.com/ARMmbed/mbed-coap/compare/v4.4.1...v4.4.2)

## [v4.4.1](https://github.com/ARMmbed/mbed-coap/releases/tag/v4.4.1)
**Closed issues:**
- IOTCLT-2539 Block wise messaging call-backs not working logically
Expand Down
2 changes: 1 addition & 1 deletion features/FEATURE_COMMON_PAL/mbed-coap/module.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mbed-coap",
"version": "4.4.1",
"version": "4.4.2",
"description": "COAP library",
"keywords": [
"coap",
Expand Down
13 changes: 11 additions & 2 deletions features/FEATURE_COMMON_PAL/mbed-coap/source/sn_coap_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1732,8 +1732,17 @@ static sn_coap_hdr_s *sn_coap_handle_blockwise_message(struct coap_s *handle, sn
}

sn_coap_builder_2(dst_ack_packet_data_ptr, src_coap_blockwise_ack_msg_ptr, handle->sn_coap_block_data_size);

handle->sn_coap_tx_callback(dst_ack_packet_data_ptr, dst_packed_data_needed_mem, src_addr_ptr, param);

#if ENABLE_RESENDINGS
uint32_t resend_time = sn_coap_calculate_new_resend_time(handle->system_time, handle->sn_coap_resending_intervall, 0);
sn_coap_protocol_linked_list_send_msg_store(handle, src_addr_ptr,
dst_packed_data_needed_mem,
dst_ack_packet_data_ptr,
resend_time, param);
#endif

handle->sn_coap_protocol_free(dst_ack_packet_data_ptr);
dst_ack_packet_data_ptr = 0;

Expand Down Expand Up @@ -2053,13 +2062,13 @@ static sn_coap_hdr_s *sn_coap_handle_blockwise_message(struct coap_s *handle, sn
handle->sn_coap_tx_callback(dst_ack_packet_data_ptr,
dst_packed_data_needed_mem, src_addr_ptr, param);

#if ENABLE_RESENDINGS
#if ENABLE_RESENDINGS
uint32_t resend_time = sn_coap_calculate_new_resend_time(handle->system_time, handle->sn_coap_resending_intervall, 0);
sn_coap_protocol_linked_list_send_msg_store(handle, src_addr_ptr,
dst_packed_data_needed_mem,
dst_ack_packet_data_ptr,
resend_time, param);
#endif
#endif
handle->sn_coap_protocol_free(dst_ack_packet_data_ptr);
dst_ack_packet_data_ptr = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
/* Disable the Ethernet global Interrupt */
NVIC_DisableIRQ(ETH_IRQn);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
/* Disable the Ethernet global Interrupt */
NVIC_DisableIRQ(ETH_IRQn);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ uint8_t mbed_otp_mac_address(char *mac)
memcpy(mac, _macAddr, 6);

return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
/* Disable the Ethernet global Interrupt */
NVIC_DisableIRQ(ETH_IRQn);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
/* Disable the Ethernet global Interrupt */
NVIC_DisableIRQ(ETH_IRQn);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
/* Disable the Ethernet global Interrupt */
NVIC_DisableIRQ(ETH_IRQn);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
/* Disable the Ethernet global Interrupt */
NVIC_DisableIRQ(ETH_IRQn);
}
}
}
6 changes: 3 additions & 3 deletions features/FEATURE_LWIP/lwip-interface/lwip_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ nsapi_error_t mbed_lwip_bringup_2(bool dhcp, bool ppp, const char *ip, const cha
if (lwip_blocking) {
if (sys_arch_sem_wait(&lwip_netif_linked, 15000) == SYS_ARCH_TIMEOUT) {
if (ppp) {
ppp_lwip_disconnect();
(void)ppp_lwip_disconnect();
}
return NSAPI_ERROR_NO_CONNECTION;
}
Expand All @@ -872,7 +872,7 @@ nsapi_error_t mbed_lwip_bringup_2(bool dhcp, bool ppp, const char *ip, const cha
if (!mbed_lwip_get_ip_addr(true, &lwip_netif)) {
if (sys_arch_sem_wait(&lwip_netif_has_any_addr, DHCP_TIMEOUT * 1000) == SYS_ARCH_TIMEOUT) {
if (ppp) {
ppp_lwip_disconnect();
(void)ppp_lwip_disconnect();
}
return NSAPI_ERROR_DHCP_FAILURE;
}
Expand Down Expand Up @@ -1135,7 +1135,7 @@ static nsapi_error_t mbed_lwip_socket_bind(nsapi_stack_t *stack, nsapi_socket_t
return NSAPI_ERROR_PARAMETER;
}

if (!ip_addr_isany(&ip_addr) && !mbed_lwip_is_local_addr(&ip_addr)) {
if (!ip_addr_isany_val(ip_addr) && !mbed_lwip_is_local_addr(&ip_addr)) {
return NSAPI_ERROR_PARAMETER;
}

Expand Down
1 change: 1 addition & 0 deletions features/cellular/UNITTESTS/at/athandler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TEST_SRC_FILES = \
../../stubs/mbed_poll_stub.cpp \
../../stubs/Timer_stub.cpp \
../../stubs/equeue_stub.cpp \
../../stubs/Kernel.cpp \

include ../../MakefileWorker.mk

Expand Down
2 changes: 1 addition & 1 deletion features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ device_err_t ATHandler_stub::device_err_value;
Callback<void()> ATHandler_stub::callback = NULL;
uint8_t ATHandler_stub::resp_info_true_counter = false;

ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char *output_delimiter) :
ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char *output_delimiter, uint16_t send_delay) :
_nextATHandler(0),
_fileHandle(fh),
_queue(queue)
Expand Down
25 changes: 25 additions & 0 deletions features/cellular/UNITTESTS/stubs/Kernel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) , Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Kernel.h"

namespace rtos {

uint64_t Kernel::get_ms_count()
{
return 20;
}
}
20 changes: 19 additions & 1 deletion features/cellular/framework/AT/ATHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#ifdef MBED_CONF_RTOS_PRESENT
#include "rtos/Thread.h"
#endif
#include "Kernel.h"

using namespace mbed;
using namespace events;
Expand Down Expand Up @@ -58,7 +59,7 @@ static const uint8_t map_3gpp_errors[][2] = {
{ 146, 46 }, { 178, 65 }, { 179, 66 }, { 180, 48 }, { 181, 83 }, { 171, 49 },
};

ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char *output_delimiter) :
ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char *output_delimiter, uint16_t send_delay) :
_nextATHandler(0),
_fileHandle(fh),
_queue(queue),
Expand All @@ -68,6 +69,8 @@ ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char
_oobs(NULL),
_at_timeout(timeout),
_previous_at_timeout(timeout),
_at_send_delay(send_delay),
_last_response_stop(0),
_fh_sigio_set(false),
_processing(false),
_ref_count(1),
Expand Down Expand Up @@ -893,6 +896,8 @@ void ATHandler::resp_stop()
set_tag(&_resp_stop, OK);
// Reset info resp prefix
memset(_info_resp_prefix, 0, sizeof(_info_resp_prefix));

_last_response_stop = rtos::Kernel::get_ms_count();
}

void ATHandler::information_response_stop()
Expand Down Expand Up @@ -936,8 +941,21 @@ const char* ATHandler::mem_str(const char* dest, size_t dest_len, const char* sr

void ATHandler::cmd_start(const char* cmd)
{

if (_at_send_delay) {
uint64_t current_time = rtos::Kernel::get_ms_count();
uint64_t time_difference = current_time - _last_response_stop;

if (time_difference < (uint64_t)_at_send_delay) {
wait_ms((uint64_t)_at_send_delay - time_difference);
tr_debug("AT wait %llu %llu", current_time, _last_response_stop);
}
}

tr_debug("AT> %s", cmd);



if (_last_err != NSAPI_ERROR_OK) {
return;
}
Expand Down
6 changes: 5 additions & 1 deletion features/cellular/framework/AT/ATHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ class ATHandler
* @param queue Event queue used to transfer sigio events to this thread
* @param timeout Timeout when reading for AT response
* @param output_delimiter delimiter used when parsing at responses, "\r" should be used as output_delimiter
* @param send_delay the minimum delay in ms between the end of last response and the beginning of a new command
*/
ATHandler(FileHandle *fh, events::EventQueue &queue, int timeout, const char *output_delimiter);
ATHandler(FileHandle *fh, events::EventQueue &queue, int timeout, const char *output_delimiter, uint16_t send_delay = 0);
~ATHandler();

/** Return used file handle.
Expand Down Expand Up @@ -196,6 +197,9 @@ class ATHandler
uint32_t _at_timeout;
uint32_t _previous_at_timeout;

uint16_t _at_send_delay;
uint64_t _last_response_stop;

bool _fh_sigio_set;

bool _processing;
Expand Down
7 changes: 6 additions & 1 deletion features/cellular/framework/AT/AT_CellularDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ATHandler* AT_CellularDevice::get_at_handler(FileHandle *fileHandle)
atHandler = atHandler->_nextATHandler;
}

atHandler = new ATHandler(fileHandle, _queue, _default_timeout, "\r");
atHandler = new ATHandler(fileHandle, _queue, _default_timeout, "\r", get_send_delay());
if (atHandler) {
if (_modem_debug_on) {
atHandler->enable_debug(_modem_debug_on);
Expand Down Expand Up @@ -225,6 +225,11 @@ void AT_CellularDevice::set_timeout(int timeout)
}
}

uint16_t AT_CellularDevice::get_send_delay()
{
return 0;
}

void AT_CellularDevice::modem_debug_on(bool on)
{
_modem_debug_on = on;
Expand Down
2 changes: 2 additions & 0 deletions features/cellular/framework/AT/AT_CellularDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class AT_CellularDevice : public CellularDevice

virtual void set_timeout(int timeout);

virtual uint16_t get_send_delay();

virtual void modem_debug_on(bool on);

virtual NetworkStack *get_stack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ CellularNetwork *TELIT_HE910::open_network(FileHandle *fh)
}
return _network;
}

uint16_t TELIT_HE910::get_send_delay()
{
return DEFAULT_DELAY_BETWEEN_AT_COMMANDS;
}

4 changes: 4 additions & 0 deletions features/cellular/framework/targets/TELIT/HE910/TELIT_HE910.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

#include "AT_CellularDevice.h"

//the delay between sending AT commands
#define DEFAULT_DELAY_BETWEEN_AT_COMMANDS 20

namespace mbed {

class TELIT_HE910 : public AT_CellularDevice
Expand All @@ -32,6 +35,7 @@ class TELIT_HE910 : public AT_CellularDevice
public: // from CellularDevice
virtual CellularPower *open_power(FileHandle *fh);
virtual CellularNetwork *open_network(FileHandle *fh);
virtual uint16_t get_send_delay();
};
} // namespace mbed
#endif /* CELLULAR_TARGETS_TELIT_HE910_TELIT_HE910_H_ */
Loading

0 comments on commit c05d72c

Please sign in to comment.