Skip to content

Commit 35145a3

Browse files
author
Jarkko Paso
committed
MAC: RF configuration delivery implemented
1 parent d6b2bbc commit 35145a3

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

nanostack/mlme.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ typedef enum {
264264
macAutoRequestKeyIndex = 0x7b, /*<The index of the key used for automatic data*/
265265
macDefaultKeySource = 0x7c, /*<Default key source*/
266266
//NON standard extension
267+
macRfConfiguration = 0xfb, /*<RF channel configuration parameters*/
267268
macAcceptByPassUnknowDevice = 0xfc, /*< Accept data trough MAC if packet is data can be authenticated by group key nad MIC. Security enforsment point must be handled carefully these packets */
268269
macLoadBalancingBeaconTx = 0xfd, /*< Trig Beacon from load balance module periodic */
269270
macLoadBalancingAcceptAnyBeacon = 0xfe, /*<Beacon accept state control from other network. Value size bool, data true=Enable, false=disable .*/

nanostack/platform/arm_hal_phy.h

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ typedef enum {
6464
PHY_EXTENSION_GET_TIMESTAMP, /**< Read 32-bit constant monotonic time stamp in us */
6565
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*/
6666
PHY_EXTENSION_GET_SYMBOLS_PER_SECOND, /**< Read Symbols per seconds which will help to convert symbol time to real time */
67+
PHY_EXTENSION_SET_RF_CONFIGURATION /**< Set RF configuration using phy_rf_channel_parameters_s structure */
6768
} phy_extension_type_e;
6869

6970
/** Address types */
@@ -146,13 +147,21 @@ typedef enum {
146147
CHANNEL_PAGE_10 = 10 ///< Page 10
147148
} channel_page_e;
148149

150+
/** Modulation index */
151+
typedef enum {
152+
MODULATION_INDEX_0_5 = 0, ///< Modulation index 0.5
153+
MODULATION_INDEX_1_0 = 1, ///< Modulation index 1.0
154+
MODULATION_INDEX_UNDEFINED ///< Modulation index undefined
155+
} phy_modulation_index_e;
156+
149157
/** Channel configuration */
150158
typedef struct phy_rf_channel_configuration_s {
151-
uint32_t channel_0_center_frequency; ///< Center frequency
152-
uint32_t channel_spacing; ///< Channel spacing
153-
uint32_t datarate; ///< Data rate
154-
uint16_t number_of_channels; ///< Number of channels
155-
phy_modulation_e modulation; ///< Modulation scheme
159+
uint32_t channel_0_center_frequency; ///< Center frequency
160+
uint32_t channel_spacing; ///< Channel spacing
161+
uint32_t datarate; ///< Data rate
162+
uint16_t number_of_channels; ///< Number of channels
163+
phy_modulation_e modulation; ///< Modulation scheme
164+
phy_modulation_index_e modulation_index; ///< Modulation index
156165
} phy_rf_channel_configuration_s;
157166

158167
/** Channel page configuration */

source/6LoWPAN/ws/ws_common.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,15 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur)
132132
// Note: doesn't work for Brazil region
133133
ws_generate_channel_list(cur->ws_info->hopping_schdule.channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain);
134134

135-
uint16_t ack_wait_symbols = WS_ACK_WAIT_SYMBOLS;
136135
mlme_set_t set_request;
136+
// Set RF configuration
137+
phy_rf_channel_configuration_s rf_configs;
138+
set_request.attr = macRfConfiguration;
139+
set_request.value_pointer = &rf_configs;
140+
set_request.value_size = sizeof(phy_rf_channel_configuration_s);
141+
cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_request);
142+
// Set Ack wait duration
143+
uint16_t ack_wait_symbols = WS_ACK_WAIT_SYMBOLS;
137144
set_request.attr = macAckWaitDuration;
138145
set_request.value_pointer = &ack_wait_symbols;
139146
set_request.value_size = sizeof(ack_wait_symbols);

source/MAC/IEEE802_15_4/mac_mlme.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,9 @@ int8_t mac_mlme_set_req(protocol_interface_rf_mac_setup_s *rf_mac_setup, const m
748748
memcpy(rf_mac_setup->coord_long_address, set_req->value_pointer, 8);
749749
}
750750
return 0;
751+
case macRfConfiguration:
752+
rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_SET_RF_CONFIGURATION, (uint8_t *) set_req->value_pointer);
753+
return 0;
751754
default:
752755
return mac_mlme_handle_set_values(rf_mac_setup, set_req);
753756
}

0 commit comments

Comments
 (0)