Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 3598f4a

Browse files
author
Tero Heinonen
authored
Thread code cleanup (ARMmbed#1475)
Code and defines moved to commercial code.
1 parent 79cebb8 commit 3598f4a

11 files changed

+197
-209
lines changed

nanostack/net_thread_test.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,15 +483,15 @@ int thread_test_mle_message_send(int8_t interface_id, uint8_t *dst_address, uint
483483

484484

485485
/**
486-
* \brief Set thread domain name.
486+
* \brief Set extension name.
487487
*
488488
* \param interface_id Network Interface
489-
* \param domain_name Thread domain name string
489+
* \param extension_name Extension name string
490490
*
491491
* \return 0 OK
492492
* \return <0 Failure
493493
*/
494-
int thread_test_domain_name_set(int8_t interface_id, char domain_name[16]);
494+
int thread_test_extension_name_set(int8_t interface_id, char extension_name[16]);
495495
#ifdef __cplusplus
496496
}
497497
#endif

nanostack/thread_management_if.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ typedef struct link_configuration {
7575
#define SECURITY_POLICY_ALL_ROUTERS_JOIN_ALLOWED 0x20 /**< Thread 1.x Routers are enabled when this is set. */
7676
#define SECURITY_POLICY_EXTERNAL_COMMISSIONER_ALLOWED 0x10 /**< This indicates that external Commissioner authentication is allowed using PSKc. */
7777
#define SECURITY_POLICY_BEACON_PAYLOAD_ENABLED 0x08 /**< Thread 1.x Beacons are enabled when this is set. */
78-
#define SECURITY_POLICY_CCM_ENABLED 0x04 /**< Thread Commercial Commissioning Mode is enabled when this bit is set. This is Thread 1.2 feature. */
7978

8079
/*
8180
* Mandatory device information
@@ -346,7 +345,7 @@ int thread_management_get_commissioner_address(int8_t interface_id, uint8_t *add
346345
/**
347346
* Set device certificate.
348347
*
349-
* This function sets device certificates to be used with Thread CCM Autonomous Enrollment
348+
* This function sets device certificate
350349
*
351350
* \param interface_id Network interface ID.
352351
* \param device_certificate_ptr A pointer to the device certificate.
@@ -360,20 +359,20 @@ int thread_management_get_commissioner_address(int8_t interface_id, uint8_t *add
360359
int thread_management_device_certificate_set(int8_t interface_id, const unsigned char *device_certificate_ptr, uint16_t device_certificate_len, const unsigned char *priv_key_ptr, uint16_t priv_key_len);
361360

362361
/**
363-
* Set domain certificate.
362+
* Set network certificate.
364363
*
365-
* This function sets domain certificates to be used with Thread CCM Network Master Key (NMK) Provisioning
364+
* This function sets network certificate
366365
*
367366
* \param interface_id Network interface ID.
368-
* \param domain_certificate_ptr A pointer array to the domain certificate chain.
369-
* \param domain_certificate_len An array of lengths of domain certificates in chain.
367+
* \param network_certificate_ptr A pointer array to the network certificate chain.
368+
* \param network_certificate_len An array of lengths of network certificates in chain.
370369
* \param priv_key_ptr A private key
371370
* \param priv_key_len Length of a private key
372371
*
373372
* \return 0, OK.
374373
* \return <0 fail.
375374
*/
376-
int thread_management_domain_certificate_set(int8_t interface_id, const unsigned char *domain_certificate_ptr, uint16_t domain_certificate_len, const unsigned char *priv_key_ptr, uint16_t priv_key_len);
375+
int thread_management_network_certificate_set(int8_t interface_id, const unsigned char *network_certificate_ptr, uint16_t network_certificate_len, const unsigned char *priv_key_ptr, uint16_t priv_key_len);
377376

378377
#ifdef __cplusplus
379378
}

nanostack/thread_meshcop_lib.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -128,36 +128,6 @@
128128
/** Discovery response TLV. */
129129
#define MESHCOP_TLV_DISCOVERY_RESPONSE 129
130130

131-
/** @defgroup Thread 1.2 experimental */
132-
133-
/** Timeout TLV. */
134-
#define MESHCOP_TLV_TIMEOUT 58
135-
136-
/** Thread domain name TLV. */
137-
#define MESHCOP_TLV_DOMAIN_NAME 59
138-
139-
/** Domain prefix TLV TLV.*/
140-
#define MESHCOP_TLV_DOMAIN_PREFIX 60
141-
142-
/** AE Steering Data TLV. */
143-
#define MESHCOP_TLV_AE_STEERING_DATA 61
144-
145-
/** NMKP Steering Data TLV. */
146-
#define MESHCOP_TLV_NMKP_STEERING_DATA 62
147-
148-
/** Commissioner Token TLV. */
149-
#define MESHCOP_TLV_COMM_TOKEN 63
150-
151-
/** Commissioner Signature TLV. */
152-
#define MESHCOP_TLV_COMM_SIGNATURE 64
153-
154-
/** NMKP Steering Data TLV. */
155-
#define MESHCOP_TLV_AE_PORT 65
156-
157-
/** NMKP Steering Data TLV. */
158-
#define MESHCOP_TLV_NMKP_PORT 66
159-
160-
161131
/**
162132
* Write array TLV.
163133
*

source/6LoWPAN/Thread/thread_common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ typedef struct thread_router_select {
222222
timeout_t *reedAdvertisementTimeout;
223223
} thread_router_select_t;
224224

225-
struct thread_commercial_info;
226-
struct thread_ccm_credentials;
225+
struct thread_extension_info;
226+
struct thread_extension_credentials;
227227

228228
typedef struct thread_previous_partition_info_s {
229229
uint32_t partitionId; //partition ID of the previous partition
@@ -249,8 +249,8 @@ typedef struct thread_info_s {
249249
thread_commissioning_native_select_cb *native_commissioner_cb;
250250
thread_network_data_tlv_cb *network_data_tlv_cb;
251251
thread_announcement_t *announcement_info;
252-
struct thread_commercial_info *commercial_info;
253-
struct thread_ccm_credentials *ccm_ptr;
252+
struct thread_extension_info *extension_info;
253+
struct thread_extension_credentials *extension_credentials_ptr;
254254
thread_attach_device_mode_e thread_device_mode;
255255
thread_attach_state_e thread_attached_state; //Indicate Thread stack state
256256
thread_registered_mcast_addr_list_t child_mcast_list;

source/6LoWPAN/Thread/thread_discovery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ static void thread_discovery_response_msg_handler(thread_discovery_class_t * dis
952952

953953
if (discovery_class->discovery_request->joiner_flag && (!joiner_port_valid || steerin_data_length == 0)) {
954954
if (thread_extension_version_check(discovery_class->interface->thread_info->version)) {
955-
if (!discovery_class->interface->thread_info->ccm_ptr) {
955+
if (!discovery_class->interface->thread_info->extension_credentials_ptr) {
956956
tr_debug("Dropped, no joiner info");
957957
}
958958
} else {

0 commit comments

Comments
 (0)