@@ -67,6 +67,37 @@ typedef struct ws_cca_threshold_table {
6767 const int8_t *cca_threshold_table;
6868} ws_cca_threshold_table_t ;
6969
70+ typedef enum {
71+ WISUN_OTHER = 0 , /* *< temporary or soon to be removed neighbor*/
72+ WISUN_PRIMARY_PARENT, /* *< Primary parent used for upward packets and used from Border router downwards*/
73+ WISUN_SECONDARY_PARENT, /* *< Secondary parent reported to border router and might be used as alternate route*/
74+ WISUN_CANDIDATE_PARENT, /* *< Candidate neighbor that is considered as parent if there is problem with active parents*/
75+ WISUN_CHILD /* *< Child with registered address*/
76+ } ws_nbr_type_e;
77+
78+ /* *
79+ * \brief Struct ws_nbr_info_t Gives the neighbor information.
80+ */
81+ typedef struct ws_nbr_info {
82+ /* * Link local address*/
83+ uint8_t link_local_address[16 ];
84+ /* * Global address if it is known set to 0 if not available*/
85+ uint8_t global_address[16 ];
86+ /* * parent RSSI Out measured RSSI value calculated using EWMA specified by Wi-SUN from range of -174 (0) to +80 (254) dBm.*/
87+ uint8_t rsl_out;
88+ /* * parent RSSI in measured RSSI value calculated using EWMA specified by Wi-SUN from range of -174 (0) to +80 (254) dBm.*/
89+ uint8_t rsl_in;
90+ /* * RPL Rank value for parents 0xffff for neighbors RANK is unknown*/
91+ uint16_t rpl_rank;
92+ /* * Measured ETX value if known set to 0xFFFF if not known or Child*/
93+ uint16_t etx;
94+ /* * Remaining lifetime Link lifetime for parents and ARO lifetime for children*/
95+ uint32_t lifetime;
96+ /* * Neighbour type (Primary Parent, Secondary Parent, Candidate parent, child, other(Temporary neighbours))*/
97+ ws_nbr_type_e type;
98+ } ws_nbr_info_t ;
99+
100+
70101/* * Wi-SUN mesh network interface class
71102 *
72103 * Configure Nanostack to use Wi-SUN protocol.
@@ -578,6 +609,20 @@ class WisunInterface final : public MeshInterfaceNanostack {
578609 * */
579610 mesh_error_t cca_threshold_table_get (ws_cca_threshold_table_t *table);
580611
612+ /* *
613+ * \brief Get Wi-SUN Neighbor table information.
614+ *
615+ * To allocate correct amount of memory first use the API with nbr_ptr = NULL to get current amount
616+ * of neighbors in count pointer. Then Allocate the memory and call the function to fill the table.
617+ *
618+ * \param nbr_ptr Pointer to memory where Neighbor table entries can be written.
619+ * \param count amount of neighbor table entries allocated to memory.
620+ *
621+ * \return MESH_ERROR_NONE on success.
622+ * \return MESH_ERROR_UNKNOWN in case of failure.
623+ * */
624+ mesh_error_t nbr_info_get (ws_nbr_info_t *nbr_ptr, uint16_t *count);
625+
581626protected:
582627 Nanostack::WisunInterface *get_interface () const ;
583628 nsapi_error_t do_initialize () override ;
0 commit comments