xref: /aosp_15_r20/external/wpa_supplicant_8/wpa_supplicant/aidl/mainline/utils.h (revision 03f9172ca588f91df233974f4258bab95191f931)
1 /*
2  * WPA Supplicant - Utilities for the mainline supplicant
3  * Copyright (c) 2024, Google Inc. All rights reserved.
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef MAINLINE_SUPPLICANT_UTILS_H
10 #define MAINLINE_SUPPLICANT_UTILS_H
11 
12 #include <aidl/android/system/wifi/mainline_supplicant/SupplicantStatusCode.h>
13 
createStatus(SupplicantStatusCode statusCode)14 inline ndk::ScopedAStatus createStatus(SupplicantStatusCode statusCode) {
15 	return ndk::ScopedAStatus::fromServiceSpecificError(
16 		static_cast<int32_t>(statusCode));
17 }
18 
createStatusWithMsg(SupplicantStatusCode statusCode,std::string msg)19 inline ndk::ScopedAStatus createStatusWithMsg(
20 	    SupplicantStatusCode statusCode, std::string msg) {
21 	return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(
22 		static_cast<int32_t>(statusCode), msg.c_str());
23 }
24 
25 #endif // MAINLINE_SUPPLICANT_UTILS_H
26