8000 update IDF libs and includes · vansinba/arduino-esp32@3b874d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b874d5

Browse files
committed
update IDF libs and includes
1 parent 49a476c commit 3b874d5

File tree

127 files changed

+8995
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+8995
-330
lines changed

platform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ compiler.warning_flags.all=-Wall -Werror=all -Wextra
1313

1414
compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/
1515
compiler.sdk.path={runtime.platform.path}/tools/sdk
16-
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/lwip"
16+
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/lwip"
1717

1818
compiler.c.cmd=xtensa-esp32-elf-gcc
1919
compiler.c.flags=-std=gnu99 -Os -g3 -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c
@@ -26,7 +26,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
2626

2727
compiler.c.elf.cmd=xtensa-esp32-elf-gcc
2828
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority
29-
compiler.c.elf.libs=-lapp_update -lbootloader_support -lbt -lbtdm_app -lc -lc_nano -lcoexist -lcore -ldriver -lesp32 -lethernet -lexpat -lfreertos -lhal -ljson -llog -llwip -lm -lmbedtls -lmicro-ecc -lnet80211 -lnewlib -lnghttp -lnvs_flash -lopenssl -lphy -lpp -lrtc -lsmartconfig -lspi_flash -ltcpip_adapter -lulp -lvfs -lwpa -lwpa2 -lwpa_supplicant -lwps -lxtensa-debug-module -lgcc
29+
compiler.c.elf.libs=-lapp_update -lbootloader_support -lbt -lbtdm_app -lc -lc_nano -lcoap -lcoexist -lcore -lcxx -ldriver -lesp32 -lethernet -lexpat -lfatfs -lfreertos -lhal -ljson -llog -llwip -lm -lmbedtls -lmdns -lmicro-ecc -lnet80211 -lnewlib -lnghttp -lnvs_flash -lopenssl -lphy -lpp -lrtc -lsdmmc -lsmartconfig -lspi_flash -ltcpip_adapter -lulp -lvfs -lwpa -lwpa2 -lwpa_supplicant -lwps -lxtensa-debug-module -lgcc -lstdc++
3030

3131
compiler.as.cmd=xtensa-esp32-elf-as
3232

tools/sdk/bin/bootloader.bin

3.52 KB
Binary file not shown.

tools/sdk/include/bt/bt.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,35 @@ extern "C" {
2929
*
3030
* This function should be called only once, before any other BT functions are called.
3131
*/
32-
void bt_controller_init(void);
32+
void esp_bt_controller_init(void);
3333

34-
/** @brief vhci_host_callback
34+
/** @brief esp_vhci_host_callback
3535
* used for vhci call host function to notify what host need to do
3636
*/
37-
typedef struct vhci_host_callback {
37+
typedef struct esp_vhci_host_callback {
3838
void (*notify_host_send_available)(void); /*!< callback used to notify that the host can send packet to controller */
3939
int (*notify_host_recv)(uint8_t *data, uint16_t len); /*!< callback used to notify that the controller has a packet to send to the host*/
40-
} vhci_host_callback_t;
40+
} esp_vhci_host_callback_t;
4141

42-
/** @brief API_vhci_host_check_send_available
42+
/** @brief esp_vhci_host_check_send_available
4343
* used for check actively if the host can send packet to controller or not.
4444
* @return true for ready to send, false means cannot send packet
4545
*/
46-
bool API_vhci_host_check_send_available(void);
46+
bool esp_vhci_host_check_send_available(void);
4747

48-
/** @brief API_vhci_host_send_packet
48+
/** @brief esp_vhci_host_send_packet
4949
* host send packet to controller
5050
* @param data the packet point
5151
*,@param len the packet length
5252
*/
53-
void API_vhci_host_send_packet(uint8_t *data, uint16_t len);
53+
void esp_vhci_host_send_packet(uint8_t *data, uint16_t len);
5454

55-
/** @brief API_vhci_host_register_callback
55+
/** @brief esp_vhci_host_register_callback
5656
* register the vhci referece callback, the call back
5757
* struct defined by vhci_host_callback structure.
58-
* @param callback vhci_host_callback type variable
58+
* @param callback esp_vhci_host_callback type variable
5959
*/
60-
void API_vhci_host_register_callback(const vhci_host_callback_t *callback);
60+
void esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback);
6161

6262
#ifdef __cplusplus
6363
}

tools/sdk/include/coap/coap/address.h

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/*
2+
* address.h -- representation of network addresses
3+
*
4+
* Copyright (C) 2010-2011,2015-2016 Olaf Bergmann <bergmann@tzi.org>
5+
*
6+
* This file is part of the CoAP library libcoap. Please see README for terms
7+
* of use.
8+
*/
9+
10+
/**
11+
* @file address.h
12+
* @brief Representation of network addresses
13+
*/
14+
15+
#ifndef _COAP_ADDRESS_H_
16+
#define _COAP_ADDRESS_H_
17+
18+
#include <assert.h>
19+
#include <stdint.h>
20+
#include <string.h>
21+
#include <sys/types.h>
22+
#include "libcoap.h"
23+
24+
#ifdef WITH_LWIP
25+
#include <lwip/ip_addr.h>
26+
27+
typedef struct coap_address_t {
28+
uint16_t port;
29+
ip_addr_t addr;
30+
} coap_address_t;
31+
32+
#define _coap_address_equals_impl(A, B) (!!ip_addr_cmp(&(A)->addr,&(B)->addr))
33+
34+
#define _coap_address_isany_impl(A) ip_addr_isany(&(A)->addr)
35+
36+
#define _coap_is_mcast_impl(Address) ip_addr_ismulticast(&(Address)->addr)
37+
#endif /* WITH_LWIP */
38+
39+
#ifdef WITH_CONTIKI
40+
#include "uip.h"
41+
42+
typedef struct coap_address_t {
43+
uip_ipaddr_t addr;
44+
unsigned short port;
45+
} coap_address_t;
46+
47+
#define _coap_address_equals_impl(A,B) \
48+
((A)->port == (B)->port \
49+
&& uip_ipaddr_cmp(&((A)->addr),&((B)->addr)))
50+
51+
/** @todo implementation of _coap_address_isany_impl() for Contiki */
52+
#define _coap_address_isany_impl(A) 0
53+
54+
#define _coap_is_mcast_impl(Address) uip_is_addr_mcast(&((Address)->addr))
55+
#endif /* WITH_CONTIKI */
56+
57+
#ifdef WITH_POSIX
58+
/** multi-purpose address abstraction */
59+
typedef struct coap_address_t {
60+
socklen_t size; /**< size of addr */
61+
union {
62+
struct sockaddr sa;
63+
struct sockaddr_storage st;
64+
struct sockaddr_in sin;
65+
struct sockaddr_in6 sin6;
66+
} addr;
67+
} coap_address_t;
68+
69+
/**
70+
* Compares given address objects @p a and @p b. This function returns @c 1 if
71+
* addresses are equal, @c 0 otherwise. The parameters @p a and @p b must not be
72+
* @c NULL;
73+
*/
74+
int coap_address_equals(const coap_address_t *a, const coap_address_t *b);
75+
76+
static inline int
77+
_coap_address_isany_impl(const coap_address_t *a) {
78+
/* need to compare only relevant parts of sockaddr_in6 */
79+
switch (a->addr.sa.sa_family) {
80+
case AF_INET:
81+
return a->addr.sin.sin_addr.s_addr == INADDR_ANY;
82+
case AF_INET6:
83+
return memcmp(&in6addr_any,
84+
&a->addr.sin6.sin6_addr,
85+
sizeof(in6addr_any)) == 0;
86+
default:
87+
;
88+
}
89+
90+
return 0;
91+
}
92+
#endif /* WITH_POSIX */
93+
94+
/**
95+
* Resets the given coap_address_t object @p addr to its default values. In
96+
* particular, the member size must be initialized to the available size for
97+
* storing addresses.
98+
*
99+
* @param addr The coap_address_t object to initialize.
100+
*/
101+
static inline void
102+
coap_address_init(coap_address_t *addr) {
103+
assert(addr);
104+
memset(addr, 0, sizeof(coap_address_t));
105+
#ifdef WITH_POSIX
106+
/* lwip and Contiki have constant address sizes and doesn't need the .size part */
107+
addr->size = sizeof(addr->addr);
108+
#endif
109+
}
110+
111+
#ifndef WITH_POSIX
112+
/**
113+
* Compares given address objects @p a and @p b. This function returns @c 1 if
114+
* addresses are equal, @c 0 otherwise. The parameters @p a and @p b must not be
115+
* @c NULL;
116+
*/
117+
static inline int
118+
coap_address_equals(const coap_address_t *a, const coap_address_t *b) {
119+
assert(a); assert(b);
120+
return _coap_address_equals_impl(a, b);
121+
}
122+
#endif
123+
124+
/**
125+
* Checks if given address object @p a denotes the wildcard address. This
126+
* function returns @c 1 if this is the case, @c 0 otherwise. The parameters @p
127+
* a must not be @c NULL;
128+
*/
129+
static inline int
130+
coap_address_isany(const coap_address_t *a) {
131+
assert(a);
132+
return _coap_address_isany_impl(a);
133+
}
134+
135+
#ifdef WITH_POSIX
136+
/**
137+
* Checks if given address @p a denotes a multicast address. This function
138+
* returns @c 1 if @p a is multicast, @c 0 otherwise.
139+
*/
140+
int coap_is_mcast(const coap_address_t *a);
141+
#else /* WITH_POSIX */
142+
/**
143+
* Checks if given address @p a denotes a multicast address. This function
144+
* returns @c 1 if @p a is multicast, @c 0 otherwise.
145+
*/
146+
static inline int
147+
coap_is_mcast(const coap_address_t *a) {
148+
return a && _coap_is_mcast_impl(a);
149+
}
150+
#endif /* WITH_POSIX */
151+
152+
#endif /* _COAP_ADDRESS_H_ */

tools/sdk/include/coap/coap/async.h

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
/*
2+
* async.h -- state management for asynchronous messages
3+
*
4+
* Copyright (C) 2010-2011 Olaf Bergmann <bergmann@tzi.org>
5+
*
6+
* This file is part of the CoAP library libcoap. Please see README for terms
7+
* of use.
8+
*/
9+
10+
/**
11+
* @file async.h
12+
* @brief State management for asynchronous messages
13+
*/
14+
15+
#ifndef _COAP_ASYNC_H_
16+
#define _COAP_ASYNC_H_
17+
18+
#include "net.h"
19+
20+
#ifndef WITHOUT_ASYNC
21+
22+
/**
23+
* @defgroup coap_async Asynchronous Messaging
24+
* @{
25+
* Structure for managing asynchronous state of CoAP resources. A
26+
* coap_resource_t object holds a list of coap_async_state_t objects that can be
27+
* used to generate a separate response in case a result of an operation cannot
28+
* be delivered in time, or the resource has been explicitly subscribed to with
29+
* the option @c observe.
30+
*/
31+
typedef struct coap_async_state_t {
32+
unsigned char flags; /**< holds the flags to control behaviour */
33+
34+
/**
35+
* Holds the internal time when the object was registered with a
36+
* resource. This field will be updated whenever
37+
* coap_register_async() is called for a specific resource.
38+
*/
39+
coap_tick_t created;
40+
41+
/**
42+
* This field can be used to register opaque application data with the
43+
* asynchronous state object.
44+
*/
45+
void *appdata;
46+
unsigned short message_id; /**< id of last message seen */
47+
coap_tid_t id; /**< transaction id */
48+
struct coap_async_state_t *next; /**< internally used for linking */
49+
coap_address_t peer; /**< the peer to notify */
50+
size_t tokenlen; /**< length of the token */
51+
unsigned char token[]; /**< the token to use in a response */
52+
} coap_async_state_t;
53+
54+
/* Definitions for Async Status Flags These flags can be used to control the
55+
* behaviour of asynchronous response generation.
56+
*/
57+
#define COAP_ASYNC_CONFIRM 0x01 /**< send confirmable response */
58+
#define COAP_ASYNC_SEPARATE 0x02 /**< send separate response */
59+
#define COAP_ASYNC_OBSERVED 0x04 /**< the resource is being observed */
60+
61+
/** release application data on destruction */
62+
#define COAP_ASYNC_RELEASE_DATA 0x08
63+
64+
/**
65+
* Allocates a new coap_async_state_t object and fills its fields according to
66+
* the given @p request. The @p flags are used to control generation of empty
67+
* ACK responses to stop retransmissions and to release registered @p data when
68+
* the resource is deleted by coap_free_async(). This function returns a pointer
69+
* to the registered coap_async_t object or @c NULL on error. Note that this
70+
* function will return @c NULL in case that an object with the same identifier
71+
* is already registered.
72+
*
73+
* @param context The context to use.
74+
* @param peer The remote peer that is to be asynchronously notified.
75+
* @param request The request that is handled asynchronously.
76+
* @param flags Flags to control state management.
77+
* @param data Opaque application data to register. Note that the
78+
* storage occupied by @p data is released on destruction
79+
* only if flag COAP_ASYNC_RELEASE_DATA is set.
80+
*
81+
* @return A pointer to the registered coap_async_state_t object or @c
82+
* NULL in case of an error.
83+
*/
84+
coap_async_state_t *
85+
coap_register_async(coap_context_t *context,
86+
coap_address_t *peer,
87+
coap_pdu_t *request,
88+
unsigned char flags,
89+
void *data);
90+
91+
/**
92+
* Removes the state object identified by @p id from @p context. The removed
93+
* object is returned in @p s, if found. Otherwise, @p s is undefined. This
94+
* function returns @c 1 if the object was removed, @c 0 otherwise. Note that
95+
* the storage allocated for the stored object is not released by this
96+
* functions. You will have to call coap_free_async() to do so.
97+
*
98+
* @param context The context where the async object is registered.
99+
* @param id The identifier of the asynchronous transaction.
100+
* @param s Will be set to the object identified by @p id after removal.
101+
*
102+
* @return @c 1 if object was removed and @p s updated, or @c 0 if no
103+
* object was found with the given id. @p s is valid only if the
104+
* return value is @c 1.
105+
*/
106+
int coap_remove_async(coap_context_t *context,
107+
coap_tid_t id,
108+
coap_async_state_t **s);
109+
110+
/**
111+
* Releases the memory that was allocated by coap_async_state_init() for the
112+
* object @p s. The registered application data will be released automatically
113+
* if COAP_ASYNC_RELEASE_DATA is set.
114+
*
115+
* @param state The object to delete.
116+
*/
117+
void
118+
coap_free_async(coap_async_state_t *state);
119+
120+
/**
121+
* Retrieves the object identified by @p id from the list of asynchronous
122+
* transactions that are registered with @p context. This function returns a
123+
* pointer to that object or @c NULL if not found.
124+
*
125+
* @param context The context where the asynchronous objects are registered
126+
* with.
127+
* @param id The id of the object to retrieve.
128+
*
129+
* @return A pointer to the object identified by @p id or @c NULL if
130+
* not found.
131+
*/
132+
coap_async_state_t *coap_find_async(coap_context_t *context, coap_tid_t id);
133+
134+
/**
135+
* Updates the time stamp of @p s.
136+
*
137+
* @param s The state object to update.
138+
*/
139+
static inline void
140+
coap_touch_async(coap_async_state_t *s) { coap_ticks(&s->created); }
141+
142+
/** @} */
143+
144+
#endif /* WITHOUT_ASYNC */
145+
146+
#endif /* _COAP_ASYNC_H_ */

0 commit comments

Comments
 (0)
0