Skip to content

Commit

Permalink
MAC: print RF configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Aug 21, 2019
1 parent 397240a commit 81f7511
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nanostack/platform/arm_hal_phy.h
Expand Up @@ -76,7 +76,7 @@ typedef enum {
PHY_EXTENSION_GET_TIMESTAMP, /**< Read 32-bit constant monotonic time stamp in us */
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*/
PHY_EXTENSION_GET_SYMBOLS_PER_SECOND, /**< Read Symbols per seconds which will help to convert symbol time to real time */
PHY_EXTENSION_SET_RF_CONFIGURATION, /**< Set RF configuration using phy_rf_channel_parameters_s structure */
PHY_EXTENSION_SET_RF_CONFIGURATION, /**< Set RF configuration using phy_rf_channel_configuration_s structure */
PHY_EXTENSION_FILTERING_SUPPORT, /**< Return filtering modes that can be supported by the PHY driver. See phy_link_filters_e */
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 */
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 */
Expand Down
8 changes: 8 additions & 0 deletions source/MAC/IEEE802_15_4/mac_mlme.c
Expand Up @@ -773,6 +773,14 @@ int8_t mac_mlme_set_req(protocol_interface_rf_mac_setup_s *rf_mac_setup, const m
case macRfConfiguration:
rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_RF_CONFIGURATION, (uint8_t *) set_req->value_pointer);
mac_mlme_set_symbol_rate(rf_mac_setup);
phy_rf_channel_configuration_s *config_params = (phy_rf_channel_configuration_s *)set_req->value_pointer;
tr_info("RF config update:");
tr_info("Frequency(ch0): %"PRIu32"Hz", config_params->channel_0_center_frequency);
tr_info("Channel spacing: %"PRIu32"Hz", config_params->channel_spacing);
tr_info("Datarate: %"PRIu32"bps", config_params->datarate);
tr_info("Number of channels: %u", config_params->number_of_channels);
tr_info("Modulation: %u", config_params->modulation);
tr_info("Modulation index: %u", config_params->modulation_index);
return 0;
default:
return mac_mlme_handle_set_values(rf_mac_setup, set_req);
Expand Down

0 comments on commit 81f7511

Please sign in to comment.