[feature-wisun] Fix routing_table_get API

-Return value is modified.
pull/13132/head
Debdeep Saha 2020-06-17 13:33:44 +05:30
parent cc8bb4596f
commit 7b1ff34b50
2 changed files with 6 additions and 11 deletions

View File

@ -202,10 +202,10 @@ public:
* \param table_ptr Application allocated memory block where routing table is written.
* \param table_len Length of the table allocated by application given as amount of entries.
*
* \return MESH_ERROR_NONE on success.
* \return MESH_ERROR_UNKNOWN in case of failure.
* \returns 0 - x on success indicates number of entries written to the table_ptr.
* \return <0 in case of errors.
* */
mesh_error_t routing_table_get(ws_br_route_info_t *table_ptr, uint16_t table_len);
int routing_table_get(ws_br_route_info_t *table_ptr, uint16_t table_len);
private:
int8_t _mesh_if_id = -1;

View File

@ -178,16 +178,11 @@ mesh_error_t WisunBorderRouter::info_get(ws_br_info_t *info_ptr)
return MESH_ERROR_NONE;
}
mesh_error_t WisunBorderRouter::routing_table_get(ws_br_route_info_t *table_ptr, uint16_t table_len)
int WisunBorderRouter::routing_table_get(ws_br_route_info_t *table_ptr, uint16_t table_len)
{
if (table_ptr == NULL) {
return MESH_ERROR_PARAM;
return -1;
}
int status = ws_bbr_routing_table_get(_mesh_if_id, (bbr_route_info_t *)table_ptr, table_len);
if (status != 0) {
return MESH_ERROR_UNKNOWN;
}
return MESH_ERROR_NONE;
return ws_bbr_routing_table_get(_mesh_if_id, (bbr_route_info_t *)table_ptr, table_len);
}