Skip to content

Commit bf8d821

Browse files
author
Seppo Takalo
committed
Update Nanostack binaries to 5.0.6
1 parent cbce88d commit bf8d821

File tree

96 files changed

+520
-186
lines changed

Some content is hidden

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

96 files changed

+520
-186
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/bin/bash
2+
3+
#
4+
# Export FEATURE_NANOSTACK libraries into mbed OS
5+
#
6+
# Usage:
7+
#
8+
# To remove all repositories call: ./clone_client.sh clean
9+
# To replace all with clone repositores: ./clone_client.sh clone
10+
# To export from cloned repositories: ./clone_client.sh export
11+
#
12+
# For developers:
13+
# Use "clone" functionality to get master repositories to work with.
14+
#
15+
# For maintainers: Creating a release
16+
# Use "clone" to get master repositories.
17+
# For every directory checkout the release branch.
18+
# Now use "export" function to flatten the git repositories into bare directories
19+
# Now you can "git add" each directory and do "git commit"
20+
#
21+
# Note "clone" does implicit "clean" so you lose all changes done into directories.
22+
23+
24+
# REPOSITORIES and DIRECTORIES are array of repositories where to clone
25+
# and directories where to clone
26+
# these arrays MUST be in sync
27+
# * Same number of elements
28+
# * Same order. Each line should have maching pair in same index at other array
29+
REPOSITORIES=(
30+
[email protected]:ARMmbed/sal-stack-nanostack.git
31+
[email protected]:ARMmbed/coap-service.git
32+
)
33+
34+
DIRECTORIES=(
35+
sal-stack-nanostack
36+
coap-service
37+
)
38+
39+
# Exit immediately on fail, thread unset variables as error
40+
set -eu
41+
42+
# Count number of repositories
43+
N=0
44+
for repo in ${REPOSITORIES[*]}; do
45+
let N=N+1
46+
done
47+
let N=N-1 # Substract one, because indexes start from 0
48+
49+
print_usage() {
50+
echo -e "Usage: $0 [clean | clone | export ]"
51+
echo -e "\tclean : Remove all repositories"
52+
echo -e "\tclone : Replace repositories with Git cone"
53+
echo -e "\texport : Export cloned Git repositories"
54+
}
55+
56+
clean() {
57+
for dir in ${DIRECTORIES[*]}; do
58+
rm -rf $dir
59+
done
60+
clean_nanostack_binaries
61+
}
62+
63+
clone() {
64+
for i in $(seq 0 $N); do
65+
git clone ${REPOSITORIES[$i]} ${DIRECTORIES[$i]}
66+
done
67+
}
68+
69+
export_repos() {
70+
for i in $(seq 0 $N); do
71+
echo "Exporting ${DIRECTORIES[$i]}"
72+
cd ${DIRECTORIES[$i]}
73+
git archive HEAD -o ../${DIRECTORIES[$i]}.tar.gz
74+
cd ..
75+
rm -rf ${DIRECTORIES[$i]}
76+
mkdir ${DIRECTORIES[$i]}
77+
tar xzf ${DIRECTORIES[$i]}.tar.gz -C ${DIRECTORIES[$i]}
78+
rm ${DIRECTORIES[$i]}.tar.gz
79+
done
80+
}
81+
82+
copy_nanostack_binaries() {
83+
mkdir -p ../nanostack-binaries
84+
mv sal-stack-nanostack/FEATURE_* ../nanostack-binaries/
85+
}
86+
87+
clean_nanostack_binaries() {
88+
rm -rf ../nanostack-binaries
89+
}
90+
91+
case "${1-}" in
92+
clean)
93+
clean
94+
;;
95+
clone)
96+
clean
97+
clone
98+
;;
99+
export)
100+
export_repos
101+
copy_nanostack_binaries
102+
;;
103+
*)
104+
print_usage
105+
exit 1
106+
;;
107+
esac

features/net/FEATURE_NANOSTACK/coap-service/CHANGELOG.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

features/net/FEATURE_NANOSTACK/coap-service/source/coap_security_handler.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,11 @@ int coap_security_handler_connect(coap_security_t *sec, bool is_server, SecureSo
321321
return -1;
322322
}
323323

324-
//TODO: Only needed for server type?
324+
#ifdef MBEDTLS_SSL_SRV_C
325325
mbedtls_ssl_conf_dtls_cookies(&sec->_conf, simple_cookie_write,
326326
simple_cookie_check,
327327
&sec->_cookie);
328+
#endif
328329

329330
sec->_is_started = true;
330331

@@ -416,10 +417,11 @@ int coap_security_handler_connect_non_blocking(coap_security_t *sec, bool is_ser
416417
return -1;
417418
}
418419

419-
//Only needed for server type?
420+
#ifdef MBEDTLS_SSL_SRV_C
420421
mbedtls_ssl_conf_dtls_cookies(&sec->_conf, simple_cookie_write,
421422
simple_cookie_check,
422423
&sec->_cookie);
424+
#endif
423425

424426
mbedtls_ssl_conf_min_version(&sec->_conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MAJOR_VERSION_3);
425427
mbedtls_ssl_conf_max_version(&sec->_conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MAJOR_VERSION_3);

features/net/FEATURE_NANOSTACK/coap-service/test/coap-service/unittest/run_tests

100644100755
File mode changed.

features/net/FEATURE_NANOSTACK/coap-service/xsl_script.sh

100644100755
File mode changed.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/DEPENDENCIES

Lines changed: 0 additions & 6 deletions
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_ARM/TARGET_CORTEX_A/TARGET_A9/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_ARM/TARGET_CORTEX_M/TARGET_M0/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_ARM/TARGET_CORTEX_M/TARGET_M0P/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_GCC/TARGET_CORTEX_A/TARGET_A9/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_GCC/TARGET_CORTEX_M/TARGET_M0/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_GCC/TARGET_CORTEX_M/TARGET_M0P/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_IAR/TARGET_CORTEX_A/TARGET_A9/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_IAR/TARGET_CORTEX_M/TARGET_M0/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/TOOLCHAIN_IAR/TARGET_CORTEX_M/TARGET_M0P/error_nanostack.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/nanostack/dhcp_service_api.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
#define TX_OPT_MULTICAST_HOP_LIMIT_64 0x02 /**< Use multicast hop limit of 64. */
6060
///@}
6161

62+
typedef enum dhcp_instance_type
63+
{
64+
DHCP_INSTANCE_CLIENT,
65+
DHCP_INSTANCE_SERVER
66+
} dhcp_instance_type_e;
67+
6268
/**
6369
* \brief DHCP Service receive callback.
6470
*
@@ -96,14 +102,18 @@ typedef int (dhcp_service_receive_resp_cb)(uint16_t instance_id, void *ptr, uint
96102

97103

98104
/**
99-
* \brief Initialize the server instance.
105+
* \brief Initialize a new DHCP service instance.
100106
*
101107
* Creates and shares the socket for other DHCP services.
102108
*
109+
* \param interface_id Interface for the new DHCP instance.
110+
* \param instance_type The type of the new DHCP instance.
111+
* \param A callback function to receive DHCP messages.
112+
*
103113
* \return Instance ID that is used to identify the service.
104114
*/
105115

106-
uint16_t dhcp_service_init(int8_t interface_id, dhcp_service_receive_req_cb *receive_req_cb);
116+
uint16_t dhcp_service_init(int8_t interface_id, dhcp_instance_type_e instance_type, dhcp_service_receive_req_cb *receive_req_cb);
107117

108118
/**
109119
* \brief Deletes a server instance.

features/net/FEATURE_NANOSTACK/sal-stack-nanostack/nanostack/net_thread_test.h

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C" {
3030

3131
#include "ns_types.h"
3232

33-
33+
#define thread_test_router_upgrade(iface) thread_test_router_id_request_send(iface, 2) // THREAD_COAP_STATUS_TLV_TOO_FEW_ROUTERS
3434
/**
3535
* \brief Add a static neighbour
3636
*
@@ -174,15 +174,7 @@ int thread_test_set_context_id_reuse_timeout(
174174
* \return <0 Remove fail
175175
*/
176176
int thread_test_remove_router_by_id(int8_t interface_id, uint8_t routerId);
177-
/**
178-
* \brief Start router upgrade process.
179-
*
180-
* \param interface_id Network Interface
181-
*
182-
* \return 0, upgrade started
183-
* \return <0 fail
184-
*/
185-
int thread_test_router_upgrade(int8_t interface_id);
177+
186178
/**
187179
* \brief Start router downgrade process.
188180
*
@@ -367,7 +359,7 @@ int8_t thread_test_neighbour_info_get(int8_t interface_id, uint8_t index, uint16
367359
typedef int (response_cb)(int8_t interface_id, uint8_t *response_ptr, uint16_t response_len);
368360

369361
/**
370-
* \brief Send diagnostic command
362+
* \brief Send diagnostic command DEPRECATED
371363
*
372364
* \param interface_id Network Interface
373365
* \param address_ptr Address to which the command is sent
@@ -380,6 +372,24 @@ typedef int (response_cb)(int8_t interface_id, uint8_t *response_ptr, uint16_t r
380372
*/
381373
int thread_test_diagnostic_command_send(int8_t interface_id, uint8_t *address_ptr,const char *uri_ptr, uint8_t request_length, uint8_t *request_ptr, response_cb *resp_cb);
382374

375+
typedef int (coap_response_cb)(int8_t interface_id, uint8_t message_code, uint8_t message_type, uint8_t *response_ptr, uint16_t response_len);
376+
377+
/**
378+
* \brief Send diagnostic request
379+
*
380+
* \param interface_id Network Interface
381+
* \param address_ptr Address to which the command is sent
382+
* \param msg_type Uri for the command
383+
* \param msg_code Uri for the command
384+
* \param uri_ptr Uri for the command
385+
* \param request_length The length of the request
386+
* \param request_ptr Pointer to the beginning of the request contents
387+
* \param resp_cb Pointer to callback function that is called after the reply for the command is obtained
388+
*
389+
* \return 0, Command send OK
390+
* \return <0 Command send Fail
391+
*/
392+
int thread_test_coap_request_send(int8_t interface_id, uint8_t *address_ptr, uint16_t port, uint8_t msg_type, uint8_t msg_code, uint16_t content_format, const char *uri_ptr, uint8_t *request_ptr, uint8_t request_length, coap_response_cb *resp_cb);
383393

384394
/**
385395
* \brief Set initial SLAAC iid.
@@ -391,6 +401,26 @@ int thread_test_diagnostic_command_send(int8_t interface_id, uint8_t *address_pt
391401
*/
392402
int8_t thread_test_initial_slaac_iid_set(int8_t interface_id, uint8_t *iid);
393403

404+
/**
405+
* \brief Send router ID request.
406+
*
407+
* \param interface_id Network Interface
408+
* \param status Value of router ID request status TLV
409+
* \return 0, Command OK
410+
* \return <0 Command Fail
411+
*/
412+
int8_t thread_test_router_id_request_send(int8_t interface_id, uint8_t status);
413+
414+
/**
415+
* \brief Set joiner port to joiner router device.
416+
* If port == 0, then default port is used.
417+
*
418+
* \param iid Joiner port.
419+
* \return 0, Command OK
420+
* \return <0 Command Fail
421+
*/
422+
int8_t thread_test_joiner_router_joiner_port_set(uint16_t port);
423+
394424
#ifdef __cplusplus
395425
}
396426
#endif

0 commit comments

Comments
 (0)