Skip to content

Commit 81f7511

Browse files
author
Jarkko Paso
committed
MAC: print RF configs
1 parent 397240a commit 81f7511

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

nanostack/platform/arm_hal_phy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ typedef enum {
7676
PHY_EXTENSION_GET_TIMESTAMP, /**< Read 32-bit constant monotonic time stamp in us */
7777
PHY_EXTENSION_SET_CSMA_PARAMETERS, /**< CSMA parameter's are given by phy_csma_params_t structure remember type cast uint8_t pointer to structure type*/
7878
PHY_EXTENSION_GET_SYMBOLS_PER_SECOND, /**< Read Symbols per seconds which will help to convert symbol time to real time */
79-
PHY_EXTENSION_SET_RF_CONFIGURATION, /**< Set RF configuration using phy_rf_channel_parameters_s structure */
79+
PHY_EXTENSION_SET_RF_CONFIGURATION, /**< Set RF configuration using phy_rf_channel_configuration_s structure */
8080
PHY_EXTENSION_FILTERING_SUPPORT, /**< Return filtering modes that can be supported by the PHY driver. See phy_link_filters_e */
8181
PHY_EXTENSION_SET_TX_POWER, /**< Set TX output power which is given as percentage of maximum. 0 is the lowest possible TX power and 100 is the highest possible TX power */
8282
PHY_EXTENSION_SET_CCA_THRESHOLD /**< Set CCA threshold which is given as percentage of maximum threshold. 0 is the lowest(strictest) possible threshold and 100 is the highest possible threshold */

source/MAC/IEEE802_15_4/mac_mlme.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,14 @@ int8_t mac_mlme_set_req(protocol_interface_rf_mac_setup_s *rf_mac_setup, const m
773773
case macRfConfiguration:
774774
rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_RF_CONFIGURATION, (uint8_t *) set_req->value_pointer);
775775
mac_mlme_set_symbol_rate(rf_mac_setup);
776+
phy_rf_channel_configuration_s *config_params = (phy_rf_channel_configuration_s *)set_req->value_pointer;
777+
tr_info("RF config update:");
778+
tr_info("Frequency(ch0): %"PRIu32"Hz", config_params->channel_0_center_frequency);
779+
tr_info("Channel spacing: %"PRIu32"Hz", config_params->channel_spacing);
780+
tr_info("Datarate: %"PRIu32"bps", config_params->datarate);
781+
tr_info("Number of channels: %u", config_params->number_of_channels);
782+
tr_info("Modulation: %u", config_params->modulation);
783+
tr_info("Modulation index: %u", config_params->modulation_index);
776784
return 0;
777785
default:
778786
return mac_mlme_handle_set_values(rf_mac_setup, set_req);

0 commit comments

Comments
 (0)