File tree Expand file tree Collapse file tree 2 files changed +21
-13
lines changed
features/nanostack/mbed-mesh-api Expand file tree Collapse file tree 2 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -547,10 +547,12 @@ class WisunInterface : public MeshInterfaceNanostack {
547
547
*
548
548
* Function reads CCA threshold table from nanostack.
549
549
*
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.
552
554
* */
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 );
554
556
555
557
protected:
556
558
Nanostack::WisunInterface *get_interface () const ;
Original file line number Diff line number Diff line change @@ -486,13 +486,8 @@ mesh_error_t WisunInterface::get_device_min_sens(uint8_t *device_min_sens)
486
486
return MESH_ERROR_PARAM;
487
487
}
488
488
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 ;
496
491
497
492
return MESH_ERROR_NONE;
498
493
}
@@ -671,11 +666,22 @@ mesh_error_t WisunInterface::stack_info_get(ws_stack_state_t *stack_info_ptr)
671
666
return MESH_ERROR_NONE;
672
667
}
673
668
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 )
675
670
{
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 ());
677
676
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;
679
685
}
680
686
681
687
#define WISUN 0x2345
You can’t perform that action at this time.
0 commit comments