Update IDF to 3.2-3276a13 and esptool.py to 2.5.0 (#1878)

* TX Flow Control and Code cleanup

* Use semaphore instead of delay

TX functionality is done.

* Use single buffer and empty queue on exit

* Fix compile issues because of LwIP code relocation

* Add temporary header to fix Azure not compiling

* Fix AsyncUDP early init

* AsyncUDP Multicast fixes

* Add source mac address and rework multicast

* Allow redefinition of default pins for Serials 1 and 2

* Update IDF to 3276a13

* Update esptool.py to 2.5.0

* Fix sketches

* Fix log level in BluetoothSetial
This commit is contained in:
Me No Dev
2018-09-21 08:39:36 +02:00
committed by GitHub
parent 4e96bffe0e
commit 96822d783f
447 changed files with 37993 additions and 10849 deletions

View File

@ -1,95 +0,0 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// 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.
#ifndef __DHCPS_H__
#define __DHCPS_H__
#include "sdkconfig.h"
#include "lwip/ip_addr.h"
typedef struct dhcps_state{
s16_t state;
} dhcps_state;
typedef struct dhcps_msg {
u8_t op, htype, hlen, hops;
u8_t xid[4];
u16_t secs, flags;
u8_t ciaddr[4];
u8_t yiaddr[4];
u8_t siaddr[4];
u8_t giaddr[4];
u8_t chaddr[16];
u8_t sname[64];
u8_t file[128];
u8_t options[312];
}dhcps_msg;
/* Defined in esp_misc.h */
typedef struct {
bool enable;
ip4_addr_t start_ip;
ip4_addr_t end_ip;
} dhcps_lease_t;
enum dhcps_offer_option{
OFFER_START = 0x00,
OFFER_ROUTER = 0x01,
OFFER_DNS = 0x02,
OFFER_END
};
#define DHCPS_COARSE_TIMER_SECS 1
#define DHCPS_MAX_LEASE 0x64
#define DHCPS_LEASE_TIME_DEF (120)
#define DHCPS_LEASE_UNIT CONFIG_LWIP_DHCPS_LEASE_UNIT
struct dhcps_pool{
ip4_addr_t ip;
u8_t mac[6];
u32_t lease_timer;
};
typedef u32_t dhcps_time_t;
typedef u8_t dhcps_offer_t;
typedef struct {
dhcps_offer_t dhcps_offer;
dhcps_offer_t dhcps_dns;
dhcps_time_t dhcps_time;
dhcps_lease_t dhcps_poll;
} dhcps_options_t;
typedef void (*dhcps_cb_t)(u8_t client_ip[4]);
static inline bool dhcps_router_enabled (dhcps_offer_t offer)
{
return (offer & OFFER_ROUTER) != 0;
}
static inline bool dhcps_dns_enabled (dhcps_offer_t offer)
{
return (offer & OFFER_DNS) != 0;
}
void dhcps_start(struct netif *netif, ip4_addr_t ip);
void dhcps_stop(struct netif *netif);
void *dhcps_option_info(u8_t op_id, u32_t opt_len);
void dhcps_set_option_info(u8_t op_id, void *opt_info, u32_t opt_len);
bool dhcp_search_ip_on_mac(u8_t *mac, ip4_addr_t *ip);
void dhcps_dns_setserver(const ip_addr_t *dnsserver);
ip4_addr_t dhcps_dns_getserver();
void dhcps_set_new_lease_cb(dhcps_cb_t cb);
#endif

View File

@ -1,134 +0,0 @@
// Copyright 2017 Espressif Systems (Shanghai) PTE LTD
//
// 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.
#pragma once
/** DHCP Options
This macros are not part of the public dhcpserver.h interface.
**/
typedef enum
{
/* RFC 1497 Vendor Extensions */
PAD = 0,
END = 255,
SUBNET_MASK = 1,
TIME_OFFSET = 2,
ROUTER = 3,
TIME_SERVER = 4,
NAME_SERVER = 5,
DOMAIN_NAME_SERVER = 6,
LOG_SERVER = 7,
COOKIE_SERVER = 8,
LPR_SERVER = 9,
IMPRESS_SERVER = 10,
RESOURCE_LOCATION_SERVER = 11,
HOST_NAME = 12,
BOOT_FILE_SIZE = 13,
MERIT_DUMP_FILE = 14,
DOMAIN_NAME = 15,
SWAP_SERVER = 16,
ROOT_PATH = 17,
EXTENSIONS_PATH = 18,
/* IP Layer Parameters per Host */
IP_FORWARDING = 19,
NON_LOCAL_SOURCE_ROUTING = 20,
POLICY_FILTER = 21,
MAXIMUM_DATAGRAM_REASSEMBLY_SIZE = 22,
DEFAULT_IP_TIME_TO_LIVE = 23,
PATH_MTU_AGING_TIMEOUT = 24,
PATH_MTU_PLATEAU_TABLE = 25,
/* IP Layer Parameters per Interface */
INTERFACE_MTU = 26,
ALL_SUBNETS_ARE_LOCAL = 27,
BROADCAST_ADDRESS = 28,
PERFORM_MASK_DISCOVERY = 29,
MASK_SUPPLIER = 30,
PERFORM_ROUTER_DISCOVERY = 31,
ROUTER_SOLICITATION_ADDRESS = 32,
STATIC_ROUTE = 33,
/* Link Layer Parameters per Interface */
TRAILER_ENCAPSULATION = 34,
ARP_CACHE_TIMEOUT = 35,
ETHERNET_ENCAPSULATION = 36,
/* TCP Parameters */
TCP_DEFAULT_TTL = 37,
TCP_KEEPALIVE_INTERVAL = 38,
TCP_KEEPALIVE_GARBAGE = 39,
/* Application and Service Parameters */
NETWORK_INFORMATION_SERVICE_DOMAIN = 40,
NETWORK_INFORMATION_SERVERS = 41,
NETWORK_TIME_PROTOCOL_SERVERS = 42,
VENDOR_SPECIFIC_INFORMATION = 43,
NETBIOS_OVER_TCP_IP_NAME_SERVER = 44,
NETBIOS_OVER_TCP_IP_DATAGRAM_DISTRIBUTION_SERVER = 45,
NETBIOS_OVER_TCP_IP_NODE_TYPE = 46,
NETBIOS_OVER_TCP_IP_SCOPE = 47,
X_WINDOW_SYSTEM_FONT_SERVER = 48,
X_WINDOW_SYSTEM_DISPLAY_MANAGER = 49,
NETWORK_INFORMATION_SERVICE_PLUS_DOMAIN = 64,
NETWORK_INFORMATION_SERVICE_PLUS_SERVERS = 65,
MOBILE_IP_HOME_AGENT = 68,
SMTP_SERVER = 69,
POP3_SERVER = 70,
NNTP_SERVER = 71,
DEFAULT_WWW_SERVER = 72,
DEFAULT_FINGER_SERVER = 73,
DEFAULT_IRC_SERVER = 74,
STREETTALK_SERVER = 75,
STREETTALK_DIRECTORY_ASSISTANCE_SERVER = 76,
/* DHCP Extensions */
REQUESTED_IP_ADDRESS = 50,
IP_ADDRESS_LEASE_TIME = 51,
OPTION_OVERLOAD = 52,
TFTP_SERVER_NAME = 66,
BOOTFILE_NAME = 67,
DHCP_MESSAGE_TYPE = 53,
SERVER_IDENTIFIER = 54,
PARAMETER_REQUEST_LIST = 55,
MESSAGE = 56,
MAXIMUM_DHCP_MESSAGE_SIZE = 57,
RENEWAL_T1_TIME_VALUE = 58,
REBINDING_T2_TIME_VALUE = 59,
VENDOR_CLASS_IDENTIFIER = 60,
CLIENT_IDENTIFIER = 61,
USER_CLASS = 77,
FQDN = 81,
DHCP_AGENT_OPTIONS = 82,
NDS_SERVERS = 85,
NDS_TREE_NAME = 86,
NDS_CONTEXT = 87,
CLIENT_LAST_TRANSACTION_TIME = 91,
ASSOCIATED_IP = 92,
USER_AUTHENTICATION_PROTOCOL = 98,
AUTO_CONFIGURE = 116,
NAME_SERVICE_SEARCH = 117,
SUBNET_SELECTION = 118,
DOMAIN_SEARCH = 119,
CLASSLESS_ROUTE = 121,
} dhcp_msg_option;

View File

@ -1,71 +0,0 @@
/*
* Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Frédéric Bernon, Simon Goldschmidt
*
*/
#ifndef LWIP_HDR_APPS_SNTP_H
#define LWIP_HDR_APPS_SNTP_H
#include "apps/sntp/sntp_opts.h"
#include "lwip/ip_addr.h"
#ifdef __cplusplus
extern "C" {
#endif
/* SNTP operating modes: default is to poll using unicast.
The mode has to be set before calling sntp_init(). */
#define SNTP_OPMODE_POLL 0
#define SNTP_OPMODE_LISTENONLY 1
void sntp_setoperatingmode(u8_t operating_mode);
u8_t sntp_getoperatingmode(void);
void sntp_init(void);
void sntp_stop(void);
u8_t sntp_enabled(void);
void sntp_setserver(u8_t idx, const ip_addr_t *addr);
ip_addr_t sntp_getserver(u8_t idx);
#if SNTP_SERVER_DNS
void sntp_setservername(u8_t idx, char *server);
char *sntp_getservername(u8_t idx);
#endif /* SNTP_SERVER_DNS */
#if SNTP_GET_SERVERS_FROM_DHCP
void sntp_servermode_dhcp(int set_servers_from_dhcp);
#else /* SNTP_GET_SERVERS_FROM_DHCP */
#define sntp_servermode_dhcp(x)
#endif /* SNTP_GET_SERVERS_FROM_DHCP */
#ifdef __cplusplus
}
#endif
#endif /* LWIP_HDR_APPS_SNTP_H */

View File

@ -1,159 +0,0 @@
/*
* Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Frédéric Bernon, Simon Goldschmidt
*
*/
#ifndef LWIP_HDR_APPS_SNTP_OPTS_H
#define LWIP_HDR_APPS_SNTP_OPTS_H
#include "lwip/opt.h"
/** SNTP macro to change system time in seconds
* Define SNTP_SET_SYSTEM_TIME_US(sec, us) to set the time in microseconds instead of this one
* if you need the additional precision.
*/
#ifndef SNTP_SET_SYSTEM_TIME
#define SNTP_SET_SYSTEM_TIME(sec) LWIP_UNUSED_ARG(sec)
#endif
/** The maximum number of SNTP servers that can be set */
#ifndef SNTP_MAX_SERVERS
#define SNTP_MAX_SERVERS LWIP_DHCP_MAX_NTP_SERVERS
#endif
/** Set this to 1 to implement the callback function called by dhcp when
* NTP servers are received. */
#ifndef SNTP_GET_SERVERS_FROM_DHCP
#define SNTP_GET_SERVERS_FROM_DHCP LWIP_DHCP_GET_NTP_SRV
#endif
/* Set this to 1 to support DNS names (or IP address strings) to set sntp servers */
#ifndef SNTP_SERVER_DNS
#define SNTP_SERVER_DNS 1
#endif
/** One server address/name can be defined as default if SNTP_SERVER_DNS == 1:
* #define SNTP_SERVER_ADDRESS "pool.ntp.org"
*/
/**
* SNTP_DEBUG: Enable debugging for SNTP.
*/
#ifndef SNTP_DEBUG
#define SNTP_DEBUG LWIP_DBG_OFF
#endif
/** SNTP server port */
#ifndef SNTP_PORT
#define SNTP_PORT 123
#endif
/** Set this to 1 to allow config of SNTP server(s) by DNS name */
#ifndef SNTP_SERVER_DNS
#define SNTP_SERVER_DNS 0
#endif
/** Sanity check:
* Define this to
* - 0 to turn off sanity checks (default; smaller code)
* - >= 1 to check address and port of the response packet to ensure the
* response comes from the server we sent the request to.
* - >= 2 to check returned Originate Timestamp against Transmit Timestamp
* sent to the server (to ensure response to older request).
* - >= 3 @todo: discard reply if any of the LI, Stratum, or Transmit Timestamp
* fields is 0 or the Mode field is not 4 (unicast) or 5 (broadcast).
* - >= 4 @todo: to check that the Root Delay and Root Dispersion fields are each
* greater than or equal to 0 and less than infinity, where infinity is
* currently a cozy number like one second. This check avoids using a
* server whose synchronization source has expired for a very long time.
*/
#ifndef SNTP_CHECK_RESPONSE
#define SNTP_CHECK_RESPONSE 0
#endif
/** According to the RFC, this shall be a random delay
* between 1 and 5 minutes (in milliseconds) to prevent load peaks.
* This can be defined to a random generation function,
* which must return the delay in milliseconds as u32_t.
* Turned off by default.
*/
#ifndef SNTP_STARTUP_DELAY
#define SNTP_STARTUP_DELAY 0
#endif
/** If you want the startup delay to be a function, define this
* to a function (including the brackets) and define SNTP_STARTUP_DELAY to 1.
*/
#ifndef SNTP_STARTUP_DELAY_FUNC
#define SNTP_STARTUP_DELAY_FUNC SNTP_STARTUP_DELAY
#endif
/** SNTP receive timeout - in milliseconds
* Also used as retry timeout - this shouldn't be too low.
* Default is 3 seconds.
*/
#ifndef SNTP_RECV_TIMEOUT
#define SNTP_RECV_TIMEOUT 3000
#endif
/** SNTP update delay - in milliseconds
* Default is 1 hour. Must not be beolw 15 seconds by specification (i.e. 15000)
*/
#ifndef SNTP_UPDATE_DELAY
#define SNTP_UPDATE_DELAY 3600000
#endif
/** SNTP macro to get system time, used with SNTP_CHECK_RESPONSE >= 2
* to send in request and compare in response.
*/
#ifndef SNTP_GET_SYSTEM_TIME
#define SNTP_GET_SYSTEM_TIME(sec, us) do { (sec) = 0; (us) = 0; } while(0)
#endif
/** Default retry timeout (in milliseconds) if the response
* received is invalid.
* This is doubled with each retry until SNTP_RETRY_TIMEOUT_MAX is reached.
*/
#ifndef SNTP_RETRY_TIMEOUT
#define SNTP_RETRY_TIMEOUT SNTP_RECV_TIMEOUT
#endif
/** Maximum retry timeout (in milliseconds). */
#ifndef SNTP_RETRY_TIMEOUT_MAX
#define SNTP_RETRY_TIMEOUT_MAX (SNTP_RETRY_TIMEOUT * 10)
#endif
/** Increase retry timeout with every retry sent
* Default is on to conform to RFC.
*/
#ifndef SNTP_RETRY_TIMEOUT_EXP
#define SNTP_RETRY_TIMEOUT_EXP 1
#endif
#endif /* LWIP_HDR_APPS_SNTP_OPTS_H */