Skip to content

Commit 986f9dd

Browse files
debdeep-armArto Kinnunen
authored andcommitted
Resolved comments.
1 parent 6c84032 commit 986f9dd

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

connectivity/nanostack/mbed-mesh-api/mbed-mesh-api/WisunInterface.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,12 @@ class WisunInterface final : public MeshInterfaceNanostack {
538538
*
539539
* Function reads CCA threshold table from nanostack.
540540
*
541-
* \return pointer to ws_cca_threshold_table_t structure on success.
542-
* \return NULL in case of failure.
541+
** \param ws_cca_threshold_table_t Structure given to stack where information will be stored
542+
**
543+
* \return MESH_ERROR_NONE on success.
544+
* \return MESH_ERROR_UNKNOWN in case of failure.
543545
* */
544-
const ws_cca_threshold_table_t *cca_threshold_table_get(void);
546+
mesh_error_t cca_threshold_table_get(ws_cca_threshold_table_t *table);
545547

546548
protected:
547549
Nanostack::WisunInterface *get_interface() const;

connectivity/nanostack/mbed-mesh-api/source/WisunInterface.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,8 @@ mesh_error_t WisunInterface::get_device_min_sens(uint8_t *device_min_sens)
488488
return MESH_ERROR_PARAM;
489489
}
490490

491-
ws_stack_info_t stack_info = {0};
492-
493-
if (ws_stack_info_get(get_interface_id(), &stack_info)) {
494-
return MESH_ERROR_UNKNOWN;
495-
}
496-
497-
*device_min_sens = stack_info.device_min_sens;
491+
/* To-Do :: Update this when device_min_sense get API is available */
492+
*device_min_sens = 0;
498493

499494
return MESH_ERROR_NONE;
500495
}
@@ -673,11 +668,22 @@ mesh_error_t WisunInterface::stack_info_get(ws_stack_state_t *stack_info_ptr)
673668
return MESH_ERROR_NONE;
674669
}
675670

676-
const ws_cca_threshold_table_t *WisunInterface::cca_threshold_table_get(void)
671+
mesh_error_t WisunInterface::cca_threshold_table_get(ws_cca_threshold_table_t *table)
677672
{
678-
const cca_threshold_table_s *cca_threshold_table = arm_nwk_get_cca_threshold_table(get_interface_id());
673+
if (table == NULL) {
674+
return MESH_ERROR_PARAM;
675+
}
676+
677+
const cca_threshold_table_s *cca_table = arm_nwk_get_cca_threshold_table(get_interface_id());
679678

680-
return (const ws_cca_threshold_table_t *)cca_threshold_table;
679+
if (cca_table != NULL) {
680+
table->number_of_channels = cca_table->number_of_channels;
681+
table->cca_threshold_table = cca_table->cca_threshold_table;
682+
} else {
683+
return MESH_ERROR_UNKNOWN;
684+
}
685+
686+
return MESH_ERROR_NONE;
681687
}
682688

683689
#define WISUN 0x2345

0 commit comments

Comments
 (0)