• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CHPP_FAKE_LINK_CLIENTS_H_
18 #define CHPP_FAKE_LINK_CLIENTS_H_
19 
20 #include <stdbool.h>
21 #include <stddef.h>
22 
23 #include "chpp/app.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 // The timeout at which the test client will trigger a timeout during init.
30 #define CHPP_TEST_CLIENT_TIMEOUT_MS 500
31 
32 /************************************************
33  *  Public functions
34  ***********************************************/
35 
36 /**
37  * Registers vendor specific services with the CHPP app layer.
38  * These services are enabled by CHPP_CLIENT_ENABLED_VENDOR definition.
39  * This function is automatically called by chppAppInit().
40  *
41  * @param context State of the app layer.
42  */
43 void chppRegisterTestClient(struct ChppAppState *context);
44 
45 /**
46  * Deregisters vendor specific clients with the CHPP app layer.
47  * These services are enabled by CHPP_CLIENT_ENABLED_VENDOR definition.
48  * This function is automatically called by chppAppDeinit().
49  *
50  * @param context State of the app layer.
51  */
52 void chppDeregisterTestClient(struct ChppAppState *context);
53 
54 /**
55  * Waits for a timeout timer to trigger.
56  *
57  * @param timeoutMs The timeout to wait for the trigger, in milliseconds.
58  * @return true if the timeout timer triggered, false otherwise.
59  */
60 bool chppTestClientWaitForTimeout(uint64_t timeoutMs);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif  // CHPP_FAKE_LINK_CLIENTS_H_
67