Skip to content

Commit ffe48c9

Browse files
author
Jarkko Paso
authored
WS management: domain configuration functions implemented (ARMmbed#2567)
* WS management: domain configuration functions implemented * Renamed params to make Doxygen happy * Allow reading domain parameters separately
1 parent 5e9ac4e commit ffe48c9

File tree

4 files changed

+142
-217
lines changed

4 files changed

+142
-217
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
### Changes
1111
* Added throttling of number of simultaneous EAPOL authentications based on Border Router TX queue size
12-
* Get and validate API for PHY mode ID and Channel plan ID.
12+
* Domain configuration functions implemented. Replacing existing PHY mode ID and channel plan ID set functions.
1313

1414
### Bugfix
1515
* All MAC TX failure causes now trigger target change on supplicant EAPOL inititial-key sending

nanostack/ws_management_api.h

Lines changed: 93 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,30 @@ extern "C" {
9595
*/
9696
#define WS_MANAGEMENT_API_VER_2 /**< Management API version */
9797

98+
/**
99+
* Deprecated!
100+
* Configure PHY mode ID of Wi-SUN stack as defined by Wi-SUN FAN 1.1.
101+
*
102+
* \param interface_id Network interface ID.
103+
* \param phy_mode_id PHY mode ID. Default 255 (not used).
104+
*
105+
* \return 0, Init OK.
106+
* \return <0 Init fail.
107+
*/
108+
#define ws_management_phy_mode_id_set(interface_id, phy_mode_id) ws_management_domain_configuration_set(interface_id, 0, phy_mode_id, 0)
109+
110+
/**
111+
* Deprecated!
112+
* Configure Channel plan ID of Wi-SUN stack as defined by Wi-SUN FAN 1.1.
113+
*
114+
* \param interface_id Network interface ID.
115+
* \param channel_plan_id Channel plan ID. Default 255 (not used).
116+
*
117+
* \return 0, Init OK.
118+
* \return <0 Init fail.
119+
*/
120+
#define ws_management_channel_plan_id_set(interface_id, channel_plan_id) ws_management_domain_configuration_set(interface_id, 0, 0, channel_plan_id)
121+
98122
/**
99123
* \brief Struct ws_statistics defines the Wi-SUN statistics storage structure.
100124
*/
@@ -187,134 +211,107 @@ int ws_management_network_name_validate(
187211
char *network_name_ptr);
188212

189213
/**
190-
* Configure PHY mode ID of Wi-SUN stack as defined by Wi-SUN FAN 1.1.
214+
* Set domain configuration of Wi-SUN stack.
191215
*
192216
* Change the default configuration for Wi-SUN PHY operation.
193217
*
194218
* Supported values:
195-
* FSK without FEC:
196-
* PHY mode ID | Symbol Rate (kbps) | Modulation Index
197-
* 1 50 0.5
198-
* 2 50 1.0
199-
* 3 100 0.5
200-
* 4 100 1.0
201-
* 5 150 0.5
202-
* 6 200 0.5
203-
* 7 200 1.0
204-
* 8 300 0.5
205-
*
206-
* FSK with FEC:
207-
* PHY mode ID | Symbol Rate (kbps) | Modulation Index
208-
* 17 50 0.5
209-
* 18 50 1.0
210-
* 19 100 0.5
211-
* 20 100 1.0
212-
* 21 150 0.5
213-
* 22 200 0.5
214-
* 23 200 1.0
215-
* 24 300 0.5
216-
*
217-
* OFDM:
218-
* PHY mode ID | Option | MCS | Data rate (kbps)
219-
* 34 1 2 400
220-
* 35 1 3 800
221-
* 36 1 4 1200
222-
* 37 1 5 1600
223-
* 38 1 6 2400
224-
* 51 2 3 400
225-
* 52 2 4 600
226-
* 53 2 5 800
227-
* 54 2 6 1200
228-
* 68 3 4 300
229-
* 69 3 5 400
230-
* 70 3 6 600
231-
* 84 4 4 150
232-
* 85 4 5 200
233-
* 86 4 6 300
234-
*
235-
* if value of 255 is given then previous value is used.
236-
*
237-
* \param interface_id Network interface ID.
238-
* \param phy_mode_id PHY mode ID. Default 255 (not used).
239-
*
240-
* \return 0, Init OK.
241-
* \return <0 Init fail.
242-
*/
243-
int ws_management_phy_mode_id_set(
244-
int8_t interface_id,
245-
uint8_t phy_mode_id);
246-
247-
/**
248-
* Get PHY mode ID of Wi-SUN stack.
249-
*
250-
* \param interface_id Network interface ID.
251-
* \param phy_mode_id PHY mode ID.
252-
*
253-
* \return 0, OK.
254-
* \return <0 Fail.
255-
*/
256-
int ws_management_phy_mode_id_get(
257-
int8_t interface_id,
258-
uint8_t *phy_mode_id);
259-
260-
/**
261-
* Validate PHY mode ID of Wi-SUN stack.
262-
*
263-
* \param interface_id Network interface ID.
219+
* Regulatory domain: "NA"(0x01), "KR"(0x09), "EU"(0x03), "IN"(0x05), "BZ"(0x07), "JP"(0x09), "WW"(0x00)
220+
*
221+
* PHY mode ID:
222+
* FSK without FEC:
223+
* PHY mode ID | Symbol Rate (kbps) | Modulation Index
224+
* 1 50 0.5
225+
* 2 50 1.0
226+
* 3 100 0.5
227+
* 4 100 1.0
228+
* 5 150 0.5
229+
* 6 200 0.5
230+
* 7 200 1.0
231+
* 8 300 0.5
232+
*
233+
* FSK with FEC:
234+
* PHY mode ID | Symbol Rate (kbps) | Modulation Index
235+
* 17 50 0.5
236+
* 18 50 1.0
237+
* 19 100 0.5
238+
* 20 100 1.0
239+
* 21 150 0.5
240+
* 22 200 0.5
241+
* 23 200 1.0
242+
* 24 300 0.5
243+
*
244+
* OFDM:
245+
* PHY mode ID | Option | MCS | Data rate (kbps)
246+
* 34 1 2 400
247+
* 35 1 3 800
248+
* 36 1 4 1200
249+
* 37 1 5 1600
250+
* 38 1 6 2400
251+
* 51 2 3 400
252+
* 52 2 4 600
253+
* 53 2 5 800
254+
* 54 2 6 1200
255+
* 68 3 4 300
256+
* 69 3 5 400
257+
* 70 3 6 600
258+
* 84 4 4 150
259+
* 85 4 5 200
260+
* 86 4 6 300
261+
*
262+
* Channel plan ID:
263+
* North America (NA): (1), (2), (5)
264+
* Brazil (BZ): (1), (2), (5)
265+
*
266+
* If value of 0 is given then previous value is used.
267+
* If value of 255 is given then default value is used.
268+
*
269+
* \param interface_id Network interface ID.
270+
* \param regulatory_domain Regulatory domain.
264271
* \param phy_mode_id PHY mode ID.
272+
* \param channel_plan_id Channel plan ID.
265273
*
266274
* \return 0, OK.
267275
* \return <0 Fail.
268276
*/
269-
int ws_management_phy_mode_id_validate(
270-
int8_t interface_id,
271-
uint8_t phy_mode_id);
272-
273-
/**
274-
* Configure Channel plan ID of Wi-SUN stack as defined by Wi-SUN FAN 1.1.
275-
*
276-
* Change the default channel configuration for Wi-SUN.
277-
*
278-
* Supported values:
279-
* North America (NA): (1), (2), (5)
280-
* Brazil (BZ): (1), (2), (5)
281-
*
282-
* if value of 255 is given then previous value is used.
283-
*
284-
* \param interface_id Network interface ID.
285-
* \param channel_plan_id Channel plan ID. Default 255 (not used).
286-
*
287-
* \return 0, Init OK.
288-
* \return <0 Init fail.
289-
*/
290-
int ws_management_channel_plan_id_set(
277+
int ws_management_domain_configuration_set(
291278
int8_t interface_id,
279+
uint8_t regulatory_domain,
280+
uint8_t phy_mode_id,
292281
uint8_t channel_plan_id);
293282

294283
/**
295-
* Get Channel plan ID of Wi-SUN stack.
284+
* Get domain configuration of Wi-SUN stack.
296285
*
297286
* \param interface_id Network interface ID.
287+
* \param regulatory_domain Regulatory domain.
288+
* \param phy_mode_id PHY mode ID.
298289
* \param channel_plan_id Channel plan ID.
299290
*
300291
* \return 0, OK.
301292
* \return <0 Fail.
302293
*/
303-
int ws_management_channel_plan_id_get(
294+
int ws_management_domain_configuration_get(
304295
int8_t interface_id,
296+
uint8_t *regulatory_domain,
297+
uint8_t *phy_mode_id,
305298
uint8_t *channel_plan_id);
306299

307300
/**
308-
* Validate Channel plan ID of Wi-SUN stack.
301+
* Validate domain configuration of Wi-SUN stack.
309302
*
310303
* \param interface_id Network interface ID.
304+
* \param regulatory_domain Regulatory domain.
305+
* \param phy_mode_id PHY mode ID.
311306
* \param channel_plan_id Channel plan ID.
312307
*
313308
* \return 0, OK.
314309
* \return <0 Fail.
315310
*/
316-
int ws_management_channel_plan_id_validate(
311+
int ws_management_domain_configuration_validate(
317312
int8_t interface_id,
313+
uint8_t regulatory_domain,
314+
uint8_t phy_mode_id,
318315
uint8_t channel_plan_id);
319316

320317
/**

source/6LoWPAN/ws/ws_empty_functions.c

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -68,56 +68,41 @@ int ws_management_network_name_validate(
6868
return -1;
6969
}
7070

71-
int ws_management_phy_mode_id_set(
72-
int8_t interface_id,
73-
uint8_t phy_mode_id)
74-
{
75-
(void)interface_id;
76-
(void)phy_mode_id;
77-
return -1;
78-
}
79-
80-
int ws_management_phy_mode_id_get(
81-
int8_t interface_id,
82-
uint8_t *phy_mode_id)
83-
{
84-
(void)interface_id;
85-
(void)phy_mode_id;
86-
return -1;
87-
}
88-
89-
int ws_management_phy_mode_id_validate(
90-
int8_t interface_id,
91-
uint8_t phy_mode_id)
92-
{
93-
(void)interface_id;
94-
(void)phy_mode_id;
95-
return -1;
96-
}
97-
98-
int ws_management_channel_plan_id_set(
71+
int ws_management_domain_configuration_set(
9972
int8_t interface_id,
73+
uint8_t regulatory_domain,
74+
uint8_t phy_mode_id,
10075
uint8_t channel_plan_id)
10176
{
77+
(void)regulatory_domain;
10278
(void)interface_id;
79+
(void)phy_mode_id;
10380
(void)channel_plan_id;
10481
return -1;
10582
}
10683

107-
int ws_management_channel_plan_id_get(
84+
int ws_management_domain_configuration_get(
10885
int8_t interface_id,
86+
uint8_t *regulatory_domain,
87+
uint8_t *phy_mode_id,
10988
uint8_t *channel_plan_id)
11089
{
90+
(void)regulatory_domain;
11191
(void)interface_id;
92+
(void)phy_mode_id;
11293
(void)channel_plan_id;
11394
return -1;
11495
}
11596

116-
int ws_management_channel_plan_id_validate(
97+
int ws_management_domain_configuration_validate(
11798
int8_t interface_id,
99+
uint8_t regulatory_domain,
100+
uint8_t phy_mode_id,
118101
uint8_t channel_plan_id)
119102
{
103+
(void)regulatory_domain;
120104
(void)interface_id;
105+
(void)phy_mode_id;
121106
(void)channel_plan_id;
122107
return -1;
123108
}

0 commit comments

Comments
 (0)