Skip to content

Commit

Permalink
Squashed 'features/nanostack/sal-stack-nanostack/' changes from 2535a6c
Browse files Browse the repository at this point in the history
…..ccd30a3

ccd30a3 Merge branch 'release_internal' into release_external
a9d7c1b Use BSD3 license for Thread files (ARMmbed#1898)
2b1d298 Link request retransmission delay changed (ARMmbed#1895)
06bd60a Remove ws resources from Nanostack
ad8577d Remove new test files
4453f82 Merge branch 'release_internal' into release_external
acbf1ac Add missing function macros (ARMmbed#1897)
dae82f6 implemented wisun routing cost calculation
f919fd1 Fix warning found by PVS-studio (ARMmbed#1891)
399f02f Additional time for distribution of dataset added (ARMmbed#1892)
dde9e61 Reverted commit ARMmbed#1888 and fixed thread_bbr_dua_entry_find (ARMmbed#1893)
628fa27 Merge pull request ARMmbed#1885 from ARMmbed/IOTTHD-2752
cfea7b2 BBR route for added with preference. Route info updated. (ARMmbed#1888)
dc404c4 Fix issues found by coverity (ARMmbed#1889)
c81e59c Fixes for Wi-SUN bbr behaviour
c941fe6 Adjust COAP callback return values (ARMmbed#1886)
7ef4775 Fix for multicast ping forwarding before adding MPL header(ARMmbed#1883)
766e305 FHSS: fixed missing us convert
ef38363 FHSS: Traces in set parent
296e455 FHSS: Time unit defines added
724696c FHSS: changed traces to use timestamp from MAC
3deb08c FHSS: use divider function in ufsi calculation
74c7f37 FHSS: function to check if remaining slots is negative
654dd44 Merge pull request ARMmbed#1879 from ARMmbed/IOTTHD-2752
1ef5062 Address registration fix (ARMmbed#1882)
4c74f96 FHSS unit tests: Fixed tr51 tests
4cf7fdf FHSS: fixed tr51 channel table size
a1d8b3d FHSS unit tests: Fixed tr51 tests
7e622b3 FHSS: Allocate TR51 channel tables when FHSS enabled
e7a8d45 link-local multicast group registration (ARMmbed#1880)
d4c95f2 Clear COAP retransmissions in partition change (ARMmbed#1872)
bf36b91 Added generation of mac address if not set
990f4f1 Merge pull request ARMmbed#1877 from ARMmbed/dhcpv6_server_fix
6cbe7c5 Fix wrong link type to correct one DHCPV6_DUID_HARDWARE_EUI64_TYPE ->  DHCPV6_DUID_HARDWARE_EUI48_TYPE
fd6c1c8 Merge pull request ARMmbed#1876 from ARMmbed/thread_dhcpv6_server_trace_fix
3f83bd1 Added trace about prefered timeout for fix CI test
4331ea1 added support for multicast forwarding
7327652 bbr start called after seq number updated. (ARMmbed#1875)
98be8b2 Merge pull request ARMmbed#1868 from ARMmbed/IOTTHD-2863
23296c1 Merge pull request ARMmbed#1871 from ARMmbed/ws_config_handler
2188fd2 FHSS: Fixed negative remaining time in ufsi calculation
5b70440 announce reattach fix (ARMmbed#1873)
fc11a7a Merge pull request ARMmbed#1869 from ARMmbed/dhcpv6_server_update
a156355 WS PAN config message handler update
5e45c40 Thread dhcpv6 server update
fe9ba3b Wi-sun border router enable global prefix with DHCP address allocation.
6d2af0b Dhcpv6 server update
ab1260a added possibility to set next sequence number on PBBR. (ARMmbed#1867)
6679db4 WS bootstrap: traces to hop calculation
1cc4aff Merge pull request ARMmbed#1865 from ARMmbed/dhcpv6_client_ws_integration
c2d0e14 Enable wi-sun dhcp relay service.
70e56b1 Wi-sun DHCP client support and RPL prefix learn Callback
3389b46 Merge pull request ARMmbed#1866 from ARMmbed/dhcp_relay_fix
9aa6a95 Address registration changes for MED and SED (ARMmbed#1863)
16359eb Fix compile problem
1472b02 Removed duplcate line.
67ea075 Wi-SUN node init API change
b906861 Fixed DHCP relay bugs
bcffa5f FHSS: Fixed setting parent synch
e0276f6 FHSS: Configure in critical state
d74d5ff Merge pull request ARMmbed#1862 from ARMmbed/dhcp_client_generic_update
999bbc3 Copied memory fix from PR ARMmbed#1858
6500fcf DHCPv6 client Generic API for all stacks.
2ec9b6e Fix memory leak if dhcp renew send fails (ARMmbed#1858)
cbf99e7 Merge pull request ARMmbed#1861 from ARMmbed/ws_dhcp_support
08155b1 DHCPv6 service relay support
62812ab Libdhcpv6 Relay support
0eea30d delay Join_ent.ntf sending by 50 ms (ARMmbed#1860)
dac1d99 Merge pull request ARMmbed#1857 from ARMmbed/mac_enhanced_ack
b819fa8 Fix bbr start
514bb58 Merge pull request ARMmbed#1836 from ARMmbed/IOTTHD-2828
b074d0e Merge pull request ARMmbed#1845 from ARMmbed/IOTTHD-2839
20b5e57 Enhanced ACK tx fix
caf53d1 Merge pull request ARMmbed#1846 from ARMmbed/IOTTHD-2824
9b5e1c9 added payload length for Max child timeout tlv (ARMmbed#1856)
3c1864b address registration tlv check only for MTDs (ARMmbed#1855)
942d8e7 Diagnostic TLV added (ARMmbed#1854)
f2b38cf Check for mandatory Address registration tlv (ARMmbed#1853)
ce8d5b7 Valdations for Child update response added: (ARMmbed#1852)
e373545 Added Wi-SUN border router implementation
1f7c040 Merge pull request ARMmbed#1849 from ARMmbed/mac_asynch_fix
33afc9c FHSS: Added force synch boolean in parent set
5ddf5fa FHSS: prevent unicast on broadcast channel in tx handle
f17e6cd FHSS: Check TX/RX slot in tx handle
3082407 FHSS: implemented divide function
cebdaf4 Update stoip6 prototype to tests (ARMmbed#1851)
279c708 Trig a new back off period for pending TX if ACK tx is active
f1e7f06 Fix broken unit test.
1d8e3d7 MAC Asynch Data request update
cca9879 Merge pull request ARMmbed#1848 from ARMmbed/iotthd-2788
fe84585 Merge pull request ARMmbed#1847 from ARMmbed/eAck_mac_timer_fix
c1c5926 Dynamic parent selection delay based on trickle i_min.
68bad00 MAC: Stop active MAC timer before sending enhanced Ack
4a204bd MAC: set new MAC channel only if RF returns success
9d79ca9 FHSS: Added minimum synch interval
a35b702 FHSS: Increased min random of tx poll
db6dc6b MAC: Fixed enhanced ack TX time
5836b50 Merge pull request ARMmbed#1844 from ARMmbed/fix_ack_tx_fail_handling
d9e2ea6 MAC: Fixed handling of the failed Ack transmission
f43e285 Merge pull request ARMmbed#1843 from ARMmbed/address_reg_fix
0b4aa78 Parent Broadcast synch fix and TR51CF slot define fix
d6b4111 fix for valgrind reported error. (ARMmbed#1842)
8160d86 Added support for wisun multicast
1f4625e Call ws_secondary_parent_update inside primary set for reduce code size.
35b39f4 Merge pull request ARMmbed#1840 from ARMmbed/address_register
cfb2426 bbr memory leak during keep alive fixed. (ARMmbed#1839)
a8aafe4 Stub update
c244ad8 Enable 6-bit path control for give better compare between parent's.
eac63d2 FHSS and address registration update
c14343a valgrind and coverity reported errors fixed. (ARMmbed#1838)
9b14b83 additional thread prefixes in network data (ARMmbed#1833)
fb07086 Merge pull request ARMmbed#1837 from ARMmbed/llc_parent_synch
bf55180 Fixed failing unit test.
5e7a493 Update brodcast synch when here data from primary parent.
9e22831 Merge pull request ARMmbed#1834 from ARMmbed/enable_bt_ie_ulad
02af1a8 Thread extension commission updates (ARMmbed#1835)
dd082a0 Fix ws_llc_data_send unit test validation with new bt-ie lement length.
ae6554d Revert "Disable wi-sun features temporary".
927c329 Thread extension commissioning updates (ARMmbed#1828)
160ef0a Merge pull request ARMmbed#1829 from ARMmbed/IOTTHD-2821
576f2bf FHSS unit tests: Fixed channel function variable name
f33d163 WS: Removed backward compatibility defines
9c88a7f WS: fixed overwriting fixed channel with random
efd77f1 Clean thread_routing test stub (ARMmbed#1832)
2b8a011 Remove recursion from MAC layer #2 (ARMmbed#1830)
2f5a2ce Remove recursion from MAC layer (ARMmbed#1826)
06e3243 propagation of reserved bit in network data implemented. (ARMmbed#1827)
e7fa605 Merge pull request ARMmbed#1823 from ARMmbed/IOTTHD-2782
89001d1 Merge pull request ARMmbed#1825 from ARMmbed/IOTTHD-2816
9c78a95 MAC: Static CSMA period when using FHSS
3d1c8a0 FHSS: Stop unicast schedule when fixed channel or no dwell interval
d6086d0 Merge pull request ARMmbed#1818 from ARMmbed/nud_statemachine
a2b8491 Wi-sun Border router and NUD process updates
60e1545 Disable wi-sun features temporary
7e3c16c Wi-sun LLC Data request IE update
a27076f Fixed Pan informatio IE read bug
bb1aeac Fixed Fragmentation init failure problem.
02fce65 Parent select and pan config handler update
a2ef56a wi-sun update:
ca9fd4f Disabled Wi-sun border router version number update.
231daf7 Wi-sun NUD State Machine update
e7d551c Commissioner fixes (ARMmbed#1824)
62ffba3 keepalive for on mesh commissioner sent to leader aloc. (ARMmbed#1821)
f846823 Coverity reported error fixes: (ARMmbed#1822)
708e8d3 Merge pull request ARMmbed#1820 from ARMmbed/IOTTHD-2735
b2e7efc FHSS WS: Get MAC channel from FHSS when starting RF interface
fe2b448 Merge pull request ARMmbed#1819 from ARMmbed/fixed_bad_channel
7c13c3c commissioner updates. (ARMmbed#1812)
4c7d4f2 FHSS: Fixed bad channel check with fixed channel configuration
40b2eec Set global address flag to follow address state
b46eacc updated channel plan settings
4a1d595 Merge pull request ARMmbed#1815 from ARMmbed/iotthd-2745
5a37354 Primary Parent Update Hook to Wi-sun for synch broadcast schedule.
98b0e23 Fix memory leak when advertising route (ARMmbed#1814)
b5d276d refactored trickkle running checks
61ff793 Merge pull request ARMmbed#1807 from ARMmbed/rpl_parent_candidate
a7a1ab3 Updated to NUD probability from 10% to 1%.
89b8eeb Merge pull request ARMmbed#1810 from ARMmbed/IOTTHD-2734
b99d497 Modify NUD operation propability.
4bb8b54 Wi-sun Probe update
2183869 FHSS Ack tx done fix
fb4309d Mac Asynch and Ack validation update
2695601 FHSS parent synch fix.
b50abb0 RPL, FHSS and Wisun Update
a40e012 Check MAC status when purging indirect queue (ARMmbed#1811)
b68f394 WS bootstrap: Updated channel function set apis
42b2e7c Unit tests: channel function tests updated
b6236f9 WS bootstrap: Separated unicast and broadcast channel functions
6fe5ea5 Fix Thread DHCPv6-client memory leak (ARMmbed#1808)
bbc0d77 WS bootstrap: renamed channel_function to uc_channel_function
7dbad5e Parent sends full network data in response to data request (ARMmbed#1806)
cbe45b4 Merge pull request ARMmbed#1805 from ARMmbed/IOTTHD-2733
8956418 FHSS unit tests: Fixed broadcast handler tests
e7aa893 FHSS: Define to make outdated application work
9fd804b FHSS: Separated broadcast schedule channel function
327c310 Merge pull request ARMmbed#1804 from ARMmbed/fhss_ws_cs
e7ae8ce FHSS unit tests: Fixed missing platform stub
9cbd2b7 FHSS: added critical states
51f8328 Merge pull request ARMmbed#1803 from ARMmbed/IOTTHD-2736
537b60d FHSS unit tests: Fixed missing stub
43bc93d FHSS: Poll TX queue on every TX slot
c6e2457 Merge pull request ARMmbed#1802 from ARMmbed/asynch_channel_plan_filter
c851b07 Wi-sun bootstrap verify channel plan component against own configured ones.
1bdc4e6 Merge pull request ARMmbed#1800 from ARMmbed/IOTTHD-2504
6ed53e6 FHSS unit tests: Fixed timestamp stub return value
f43b3af FHSS unit tests: Fixed missing timestamp read function
f27a29c Merge pull request ARMmbed#1801 from ARMmbed/rf_driver_start_fix
c2bc561 Add MAC TX active FLAG to active before write function return value.
08d3e12 Merge pull request ARMmbed#1799 from ARMmbed/several_bug_fixs
65d96c4 FHSS: Fixed calculating UFSI
eedd746 FHSS: Compensate delay from platform driver when starting timeout
7d537ea FHSS: Read timestamp from MAC/PHY instead of using FHSS own timestamp
0206fc8 FHSS: Added callbacks for debugging purposes
63d8a41 Added Packet rebuild for extented driver after Driver Busy error.
607da3e Bug fixes:
f39312b REED and FED links removed (ARMmbed#1796)
b162d7b added support for modifying fhss configuration after initial startup
88e239d Merge pull request ARMmbed#1798 from ARMmbed/enhanced_ack_send
11fb5fa MAC Enhanced ACK TX fix:
08d5584 Merge pull request ARMmbed#1794 from ARMmbed/rpl_address_learn
5bbc86f fed advertisement fix (ARMmbed#1795)
a48254c Wi-sun Address registration update:
5db8037 RPL Local Repair, SLAAC prefix update and Dodag Prefix proces update:
b3139c8 Adjust Thread BBR neighbor/destination cache size (ARMmbed#1793)
21deb75 Registered neighbour cache entries are not reregistered. (ARMmbed#1792)
d93b9e4 Added empty function for ws public api
1a09af7 Updated management api
f52289f Merge pull request ARMmbed#1790 from ARMmbed/ws_llc_neigh_update_fix
b954e56 WS neighbor refresh update
0b2736f Thread address registration improvements (ARMmbed#1779)
931a17d Merge pull request ARMmbed#1789 from ARMmbed/iotthd-2693
90c6a8a Removed unnecessary Decrypt Fail debug trace.
b425f4b Adapatation neighbor validation update:
06255ee Merge pull request ARMmbed#1787 from ARMmbed/iottthd-2692
e98c182 MAC report unknow neighbour COMM status at Packet TX process not detetct destination.
be0aa9c Merge pull request ARMmbed#1786 from ARMmbed/iotthd-2695
42122b7 Added support to report Driver if FHSS return unknow neighbor error.
eb5ba30 Fixed Driver Tx done callback missing error return values.
1a9acbd Wi-SUN fhss refactor
0ca78d6 Merge pull request ARMmbed#1784 from ARMmbed/iotthd-2533
9b37c24 Fixed Unicast and Broadcast MAC packet request types.
0ddff57 Fix PAN-id read bug when received 2015 frame version's.

git-subtree-dir: features/nanostack/sal-stack-nanostack
git-subtree-split: ccd30a3
  • Loading branch information
Arto Kinnunen committed Nov 5, 2018
1 parent 94f8210 commit 6dd01c6
Show file tree
Hide file tree
Showing 101 changed files with 2,460 additions and 944 deletions.
13 changes: 12 additions & 1 deletion nanostack/dhcp_service_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
typedef enum dhcp_instance_type
{
DHCP_INSTANCE_CLIENT,
DHCP_INSTANCE_SERVER
DHCP_INSTANCE_SERVER,
DHCP_INTANCE_RELAY_AGENT
} dhcp_instance_type_e;

/**
Expand Down Expand Up @@ -124,6 +125,16 @@ typedef int (dhcp_service_receive_resp_cb)(uint16_t instance_id, void *ptr, uint

uint16_t dhcp_service_init(int8_t interface_id, dhcp_instance_type_e instance_type, dhcp_service_receive_req_cb *receive_req_cb);

/**
* \brief Enable DHCPv6 Relay Agent to server.
*
*
* \param instance The instance ID of the registered server.
* \param server_address global server IPv6 address
*/
void dhcp_service_relay_instance_enable(uint16_t instance, uint8_t *server_address);


/**
* \brief Deletes a server instance.
*
Expand Down
11 changes: 10 additions & 1 deletion nanostack/fhss_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ typedef bool fhss_data_tx_fail(const fhss_api_t *api, uint8_t handle, int frame_
* @param api FHSS instance.
* @param fhss_state FHSS state (FHSS states are defined by FHSS api).
* @param pan_id PAN id of the network FHSS synchronizes with.
* @return -1 when failed, otherwise current MAC channel.
*/
typedef void fhss_synch_state_set(const fhss_api_t *api, fhss_states fhss_state, uint16_t pan_id);
typedef int16_t fhss_synch_state_set(const fhss_api_t *api, fhss_states fhss_state, uint16_t pan_id);

/**
* @brief Read timestamp.
Expand Down Expand Up @@ -215,6 +216,13 @@ typedef int mac_read_mac_address(const fhss_api_t *fhss_api, uint8_t *mac_addres
*/
typedef uint32_t mac_read_datarate(const fhss_api_t *fhss_api);

/**
* @brief Read 32-bit timestamp.
* @param fhss_api FHSS instance.
* @return Timestamp.
*/
typedef uint32_t mac_read_timestamp(const fhss_api_t *fhss_api);

/**
* @brief Change channel.
* @param fhss_api FHSS instance.
Expand Down Expand Up @@ -287,6 +295,7 @@ struct fhss_callback {
mac_read_tx_queue_size *read_tx_queue_size; /**< Read MAC TX queue size. */
mac_read_mac_address *read_mac_address; /**< Read MAC address. */
mac_read_datarate *read_datarate; /**< Read PHY datarate. */
mac_read_timestamp *read_timestamp; /**< Read timestamp. */
mac_change_channel *change_channel; /**< Change channel. */
mac_send_fhss_frame *send_fhss_frame; /**< Send FHSS frame. */
mac_synch_lost_notification *synch_lost_notification; /**< Send notification when FHSS synchronization is lost. */
Expand Down
13 changes: 11 additions & 2 deletions nanostack/fhss_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ typedef int32_t fhss_vendor_defined_cf(const fhss_api_t *api, uint16_t slot, uin
*/
typedef struct fhss_ws_configuration
{
/** WS channel function. */
fhss_ws_channel_functions ws_channel_function;
/** WS unicast channel function. */
fhss_ws_channel_functions ws_uc_channel_function;

/** WS broadcast channel function. */
fhss_ws_channel_functions ws_bc_channel_function;

/** Broadcast schedule identifier. */
uint16_t bsi;
Expand All @@ -111,6 +114,12 @@ typedef struct fhss_ws_configuration
/** Broadcast dwell interval. Range: 15-250 milliseconds. */
uint8_t fhss_bc_dwell_interval;

/** Unicast fixed channel */
uint8_t unicast_fixed_channel;

/** Broadcast fixed channel */
uint8_t broadcast_fixed_channel;

/** Channel mask. */
uint32_t channel_mask[8];

Expand Down
5 changes: 4 additions & 1 deletion nanostack/fhss_ws_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ typedef struct unicast_timing_info {
unsigned unicast_channel_function:3; /**< Unicast schedule channel function */
uint8_t unicast_dwell_interval; /**< Unicast dwell interval */
uint16_t unicast_number_of_channels; /**< Unicast number of channels */
uint16_t fixed_channel; /**< Unicast fixed channel*/
uint_fast24_t ufsi; /**< Unicast fractional sequence interval */
uint32_t utt_rx_timestamp; /**< UTT-IE reception timestamp */
} unicast_timing_info_t;
Expand All @@ -47,6 +48,7 @@ typedef struct unicast_timing_info {
typedef struct broadcast_timing_info {
unsigned broadcast_channel_function:3; /**< Broadcast schedule channel function */
uint8_t broadcast_dwell_interval; /**< Broadcast dwell interval */
uint16_t fixed_channel; /**< Broadcast fixed channel*/
uint16_t broadcast_slot; /**< Broadcast slot number */
uint16_t broadcast_schedule_id; /**< Broadcast schedule identifier */
uint_fast24_t broadcast_interval_offset; /**< Broadcast interval offset */
Expand Down Expand Up @@ -78,9 +80,10 @@ typedef fhss_ws_neighbor_timing_info_t *fhss_get_neighbor_info(const fhss_api_t
* @param fhss_api FHSS instance.
* @param eui64 EUI-64 address of parent.
* @param bc_timing_info Pointer to parent broadcast timing/hopping schedule info.
* @param force_synch If false, synchronization is done only if minimum (internal) synchronization interval is exceed.
* @return 0 on success, -1 on fail.
*/
extern int ns_fhss_ws_set_parent(const fhss_api_t *fhss_api, const uint8_t eui64[8], const broadcast_timing_info_t *bc_timing_info);
extern int ns_fhss_ws_set_parent(const fhss_api_t *fhss_api, const uint8_t eui64[8], const broadcast_timing_info_t *bc_timing_info, const bool force_synch);

/**
* @brief Remove parent which was set by ns_fhss_ws_set_parent function.
Expand Down
3 changes: 2 additions & 1 deletion nanostack/mac_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ typedef void mcps_data_request_ext(const mac_api_t* api, const mcps_data_req_t *
* @brief mcps_purge_request MCPS_PURGE request call
* @param api API to handle the request
* @param data MCPS-PURGE.request specific values
* @return 0 in case of success, non-zero otherwise
*/
typedef void mcps_purge_request(const mac_api_t* api, const mcps_purge_t *data);
typedef uint8_t mcps_purge_request(const mac_api_t* api, const mcps_purge_t *data);

//Upper layer specific callback functions (will also be set by Upper layer after mac_api_t has been created and given to it)

Expand Down
3 changes: 1 addition & 2 deletions nanostack/net_fhss.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ extern "C" {
extern fhss_api_t *ns_fhss_create(const fhss_configuration_t *fhss_configuration, const fhss_timer_t *fhss_timer, fhss_statistics_t *fhss_statistics);

/**
* @brief TODO: description.
* @brief Creates FHSS WS API instance which will be registered to software MAC.
* @param fhss_configuration Basic FHSS configuration.
* @param fhss_timer FHSS platform timer interface and configuration.
* @param fhss_statistics FHSS statistics storage.
* @return New FHSS instance if successful, NULL otherwise.
*/
extern fhss_api_t *ns_fhss_ws_create(const fhss_ws_configuration_t *fhss_configuration, const fhss_timer_t *fhss_timer);
Expand Down
15 changes: 15 additions & 0 deletions nanostack/thread_bbr_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ int thread_bbr_start(int8_t interface_id, int8_t backbone_interface_id);
*
*/
int thread_bbr_timeout_set(int8_t interface_id, uint32_t timeout_a, uint32_t timeout_b, uint32_t delay);

/**
* Set prefix to be used as combining multiple thread networks on backbone.
*
Expand All @@ -89,6 +90,20 @@ int thread_bbr_timeout_set(int8_t interface_id, uint32_t timeout_a, uint32_t tim
*/
int thread_bbr_prefix_set(int8_t interface_id, uint8_t *prefix);

/**
* Set sequence number to be used by bbr
*
* update sequence number value
*
* \param interface_id interface ID of the Thread network.
* \param sequence_number value that needs to be set on bbr
*
* \return 0 on success
* \return <0 in case of errors
*
*/
int thread_bbr_sequence_number_set(int8_t interface_id, uint8_t sequence_number);

/**
* Set the Thread validation interface destination address.
*
Expand Down
14 changes: 14 additions & 0 deletions nanostack/thread_commissioning_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ void *thread_commission_device_get_next(void *ptr, int8_t interface_id, bool *sh

typedef struct thread_commissioning_link_configuration {
uint8_t name[16]; /**< Name of the Thread network. utf8 string nul terminated if shorter than 16. */
uint8_t destination_address[16]; /**<Border router destination address*/
uint8_t extented_pan_id[8]; /**< Extended PAN ID. */
uint16_t panId; /**< Network ID. */
uint16_t destination_port; /**<destination port for commissioning*/
uint8_t Protocol_id; /**< Current protocol ID. */
uint8_t version; /**< Current protocol version. */
uint8_t rfChannel; /**< Current RF channel. */
Expand Down Expand Up @@ -271,6 +273,18 @@ int thread_commissioning_native_commissioner_get_connection_info(int8_t interfac
*/
int8_t thread_commissioning_get_management_id(int8_t interface_id);

/**
* \brief Attach native commissioner to destination address and port.
*
* \param interface_id Network interface ID.
* \param destination_address Destination address pointer.
* \param destination_port Commissioning port.
*
* \return 0 attach OK.
* \return < 0 fail.
*/
int thread_commissioning_attach(int8_t interface_id, uint8_t *destination_address, uint16_t destination_port);

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion nanostack/thread_diagcop_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
#define DIAGCOP_TLV_SUPPLY_VOLTAGE 15 /**< Can not reset*/
#define DIAGCOP_TLV_CHILD_TABLE 16 /**< Can not reset*/
#define DIAGCOP_TLV_CHANNEL_PAGES 17 /**< Can not reset*/
#define DIAGCOP_TLV_TYPE_LIST 18 /**< List type*/
#define DIAGCOP_TLV_TYPE_LIST 18 /**< Cannot reset*/
#define DIAGCOP_TLV_MAX_CHILD_TIMEOUT 19 /**< Cannot reset*/

/**
* \brief Write array TLV.
Expand Down
15 changes: 13 additions & 2 deletions source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include "6LoWPAN/Fragmentation/cipv6_fragmenter.h"
#include "Service_Libs/etx/etx.h"
#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h"
#include "6LoWPAN/ws/ws_bootstrap.h"


#define TRACE_GROUP_LOWPAN "6lo"
Expand Down Expand Up @@ -473,7 +474,6 @@ void protocol_6lowpan_neighbor_priority_update(protocol_interface_info_entry_t *
}

#ifdef HAVE_RPL
#ifndef NO_MLE

uint16_t protocol_6lowpan_neighbor_priority_set(int8_t interface_id, addrtype_t addr_type, const uint8_t *addr_ptr)
{
Expand All @@ -486,9 +486,12 @@ uint16_t protocol_6lowpan_neighbor_priority_set(int8_t interface_id, addrtype_t
mac_neighbor_table_entry_t * entry = mac_neighbor_table_address_discover(mac_neighbor_info(cur), addr_ptr + PAN_ID_LEN, addr_type);

if (entry) {

bool new_primary = false;
etx_storage_t *etx_entry = etx_storage_entry_get(interface_id, entry->index);
// If primary parent has changed clears priority from previous parent
if (entry->link_role != PRIORITY_PARENT_NEIGHBOUR) {
new_primary = true;
protocol_6lowpan_neighbor_priority_clear_all(interface_id, PRIORITY_1ST);
}
entry->link_role = PRIORITY_PARENT_NEIGHBOUR;
Expand All @@ -501,6 +504,10 @@ uint16_t protocol_6lowpan_neighbor_priority_set(int8_t interface_id, addrtype_t
if (etx_entry) {
protocol_stats_update(STATS_ETX_1ST_PARENT, etx_entry->etx >> 4);
}

if (new_primary) {
ws_primary_parent_update(cur, entry);
}
return 1;
} else {
return 0;
Expand All @@ -519,16 +526,21 @@ uint16_t protocol_6lowpan_neighbor_second_priority_set(int8_t interface_id, addr
mac_neighbor_table_entry_t * entry = mac_neighbor_table_address_discover(mac_neighbor_info(cur), addr_ptr + PAN_ID_LEN, addr_type);

if (entry) {
bool new_secondary = false;
etx_storage_t *etx_entry = etx_storage_entry_get(interface_id, entry->index);
// If secondary parent has changed clears priority from previous parent
if (entry->link_role != SECONDARY_PARENT_NEIGHBOUR) {
new_secondary = true;
protocol_6lowpan_neighbor_priority_clear_all(interface_id, PRIORITY_2ND);
}
entry->link_role = SECONDARY_PARENT_NEIGHBOUR;

if (etx_entry) {
protocol_stats_update(STATS_ETX_2ND_PARENT, etx_entry->etx >> 4);
}
if (new_secondary) {
ws_secondary_parent_update(cur);
}
return 1;
} else {
return 0;
Expand Down Expand Up @@ -557,7 +569,6 @@ void protocol_6lowpan_neighbor_priority_clear_all(int8_t interface_id, neighbor_
}
}

#endif
#endif

#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ int8_t arm_6lowpan_bootstarp_bootstrap_set(int8_t interface_id, net_6lowpan_mode
*/
if (cur->lowpan_info & INTERFACE_NWK_ROUTER_DEVICE) {
//rpl_control_set_domain_on_interface(cur, protocol_6lowpan_rpl_domain, true);
//rpl_control_set_callback(protocol_6lowpan_rpl_domain, protocol_6lowpan_bootstrap_rpl_callback, cur);
//rpl_control_set_callback(protocol_6lowpan_rpl_domain, protocol_6lowpan_bootstrap_rpl_callback, NULL, cur);
}
#endif
cur->configure_flags |= INTERFACE_BOOTSTRAP_DEFINED;
Expand Down Expand Up @@ -2073,6 +2073,8 @@ static void protocol_6lowpan_bootstrap_rpl_callback(rpl_event_t event, void *han
tr_error("RPL Local repair fail-->interface to idle");
nwk_bootsrap_state_update(ARM_NWK_NWK_CONNECTION_DOWN, cur);
break;
default:
break;
}
}

Expand Down Expand Up @@ -2179,7 +2181,7 @@ void nwk_6lowpan_nd_address_registartion_ready(protocol_interface_info_entry_t *
// arm_nwk_6lowpan_rpl_dodag_poison from a previous connection may have left force_leaf set
rpl_control_force_leaf(protocol_6lowpan_rpl_domain, false);
rpl_control_set_domain_on_interface(cur, protocol_6lowpan_rpl_domain, true);
rpl_control_set_callback(protocol_6lowpan_rpl_domain, protocol_6lowpan_bootstrap_rpl_callback, cur);
rpl_control_set_callback(protocol_6lowpan_rpl_domain, protocol_6lowpan_bootstrap_rpl_callback, NULL, cur);
}
// Send unicast DIS to coordinator
nwk_bootstrap_icmp_rpl_dis_coord_msg_tx(cur);
Expand Down
3 changes: 2 additions & 1 deletion source/6LoWPAN/MAC/mpx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ typedef void mpx_data_request(const mpx_api_t *api, const struct mcps_data_req_s
* @param api API to handle the request
* @param purge MCPS-purge request
* @param user_id MPX user ID
* @return 0 if purge requst was OK, non-zero otherwise
*
*/
typedef void mpx_data_purge_request(const mpx_api_t *api, struct mcps_purge_s *purge, uint16_t user_id);
typedef uint8_t mpx_data_purge_request(const mpx_api_t *api, struct mcps_purge_s *purge, uint16_t user_id);

/**
* @brief mpx_data_confirm MPX-DATA confirm is called as a response to MPX-DATA request
Expand Down
Loading

0 comments on commit 6dd01c6

Please sign in to comment.