Skip to content

Commit 46b141e

Browse files
debdeep-armArto Kinnunen
authored andcommitted
Resolved comments.
1 parent c0eb6df commit 46b141e

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,12 @@ class WisunInterface : public MeshInterfaceNanostack {
547547
*
548548
* Function reads CCA threshold table from nanostack.
549549
*
550-
* \return pointer to ws_cca_threshold_table_t structure on success.
551-
* \return NULL in case of failure.
550+
** \param ws_cca_threshold_table_t Structure given to stack where information will be stored
551+
**
552+
* \return MESH_ERROR_NONE on success.
553+
* \return MESH_ERROR_UNKNOWN in case of failure.
552554
* */
553-
const ws_cca_threshold_table_t *cca_threshold_table_get(void);
555+
mesh_error_t cca_threshold_table_get(ws_cca_threshold_table_t *table);
554556

555557
protected:
556558
Nanostack::WisunInterface *get_interface() const;

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

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

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

497492
return MESH_ERROR_NONE;
498493
}
@@ -671,11 +666,22 @@ mesh_error_t WisunInterface::stack_info_get(ws_stack_state_t *stack_info_ptr)
671666
return MESH_ERROR_NONE;
672667
}
673668

674-
const ws_cca_threshold_table_t *WisunInterface::cca_threshold_table_get(void)
669+
mesh_error_t WisunInterface::cca_threshold_table_get(ws_cca_threshold_table_t *table)
675670
{
676-
const cca_threshold_table_s *cca_threshold_table = arm_nwk_get_cca_threshold_table(get_interface_id());
671+
if (table == NULL) {
672+
return MESH_ERROR_PARAM;
673+
}
674+
675+
const cca_threshold_table_s *cca_table = arm_nwk_get_cca_threshold_table(get_interface_id());
677676

678-
return (const ws_cca_threshold_table_t *)cca_threshold_table;
677+
if (cca_table != NULL) {
678+
table->number_of_channels = cca_table->number_of_channels;
679+
table->cca_threshold_table = cca_table->cca_threshold_table;
680+
} else {
681+
return MESH_ERROR_UNKNOWN;
682+
}
683+
684+
return MESH_ERROR_NONE;
679685
}
680686

681687
#define WISUN 0x2345

0 commit comments

Comments
 (0)