Newer
Older
/**
* @author ETSI / TTF T012
* @version $URL$
* $ID:$
* @desc This module provides the custom templates for ITS HTTP based protocols.
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* All rights reserved.
*/
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// JSON
import from JSON all;
// LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_Time all;
import from LibCommon_VerdictControl all;
import from LibCommon_Sync all;
// LibHttp
import from LibItsHttp_TypesAndValues all;
import from LibItsHttp_Functions all;
import from LibItsHttp_Templates all;
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec/WlanInformationAPI
import from WlanInformationAPI_TypesAndValues all;
import from WlanInformationAPI_Templates all;
import from WlanInformationAPI_Pixits all;
// LibMec
import from LibMec_Templates all;
import from LibMec_Functions all;
import from LibMec_Pics all;
import from LibMec_Pixits all;
function f_create_assoc_sta_subscription(
out AssocStaSubscription p_assoc_sta_subscription
) runs on HttpComponent {
var Headers v_headers;
var HttpMessage v_response;
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions",
v_headers,
m_http_message_body_json(
m_body_json_assoc_sta_subscription(
m_assoc_sta_subscription(
PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
m_ap_identity(
PX_MAC_ID
)))))));
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_assoc_sta_subscription(
mw_assoc_sta_subscription(
PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
-,
?
)))))) -> value v_response {
tc_ac.stop;
p_assoc_sta_subscription := v_response.response.body.json_body.assocStaSubscription;
log("f_create_assoc_sta_subscription: INFO: IUT successfully responds to the subscription: ", p_assoc_sta_subscription);
}
[] tc_ac.timeout {
log("f_create_assoc_sta_subscription: INCONC: Expected message not received");
}
} // End of 'alt' statement
} // End of function "f_create_assoc_sta_subscription
function f_delete_assoc_sta_subscription(
in AssocStaSubscription p_assoc_sta_subscription
) runs on HttpComponent {
var Headers v_headers;
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
PICS_ROOT_API & p_assoc_sta_subscription.links.self_.href,
v_headers
)));
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_204_no_content
)) {
tc_ac.stop;
}
[] tc_ac.timeout {
log("f_delete_assoc_sta_subscription: Expected message not received");
}
} // End of 'alt' statement
} // End of function f_delete_assoc_sta_subscription
} // End of module WlanInformationAPI_Functions