diff --git a/features/nanostack/mbed-mesh-api/mbed-mesh-api/WisunBorderRouter.h b/features/nanostack/mbed-mesh-api/mbed-mesh-api/WisunBorderRouter.h index 8280167ad7..0473f56e50 100644 --- a/features/nanostack/mbed-mesh-api/mbed-mesh-api/WisunBorderRouter.h +++ b/features/nanostack/mbed-mesh-api/mbed-mesh-api/WisunBorderRouter.h @@ -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; diff --git a/features/nanostack/mbed-mesh-api/source/WisunBorderRouter.cpp b/features/nanostack/mbed-mesh-api/source/WisunBorderRouter.cpp index 4d05308763..482036a7f5 100644 --- a/features/nanostack/mbed-mesh-api/source/WisunBorderRouter.cpp +++ b/features/nanostack/mbed-mesh-api/source/WisunBorderRouter.cpp @@ -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); }