/** * @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. */ module WlanInformationAPI_Functions { // 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