File tree Expand file tree Collapse file tree 2 files changed +21
-13
lines changed
connectivity/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 @@ -538,10 +538,12 @@ class WisunInterface final : public MeshInterfaceNanostack {
538
538
*
539
539
* Function reads CCA threshold table from nanostack.
540
540
*
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.
543
545
* */
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 );
545
547
546
548
protected:
547
549
Nanostack::WisunInterface *get_interface () const ;
Original file line number Diff line number Diff line change @@ -488,13 +488,8 @@ mesh_error_t WisunInterface::get_device_min_sens(uint8_t *device_min_sens)
488
488
return MESH_ERROR_PARAM;
489
489
}
490
490
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 ;
498
493
499
494
return MESH_ERROR_NONE;
500
495
}
@@ -673,11 +668,22 @@ mesh_error_t WisunInterface::stack_info_get(ws_stack_state_t *stack_info_ptr)
673
668
return MESH_ERROR_NONE;
674
669
}
675
670
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 )
677
672
{
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 ());
679
678
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;
681
687
}
682
688
683
689
#define WISUN 0x2345
You can’t perform that action at this time.
0 commit comments