@@ -67,6 +67,36 @@ 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+
70100/* * Wi-SUN mesh network interface class
71101 *
72102 * Configure Nanostack to use Wi-SUN protocol.
@@ -586,6 +616,20 @@ class WisunInterface : public MeshInterfaceNanostack {
586616 * */
587617 mesh_error_t cca_threshold_table_get (ws_cca_threshold_table_t *table);
588618
619+ /* *
620+ * \brief Get Wi-SUN Neighbor table information.
621+ *
622+ * To allocate correct amount of memory first use the API with nbr_ptr = NULL to get current amount
623+ * of neighbors in count pointer. Then Allocate the memory and call the function to fill the table.
624+ *
625+ * \param nbr_ptr Pointer to memory where Neighbor table entries can be written.
626+ * \param count amount of neighbor table entries allocated to memory.
627+ *
628+ * \return MESH_ERROR_NONE on success.
629+ * \return MESH_ERROR_UNKNOWN in case of failure.
630+ * */
631+ mesh_error_t nbr_info_get (ws_nbr_info_t *nbr_ptr, uint16_t *count);
632+
589633protected:
590634 Nanostack::WisunInterface *get_interface () const ;
591635 virtual nsapi_error_t do_initialize ();
0 commit comments