1 /*
2  * Copyright 2023 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 #pragma once
18 #include <memory>
19 #include <string>
20 
21 #include "netsim/model.pb.h"
22 #include "rust/cxx.h"
23 
24 /** Manages the WiFi chip emulation provided by the WiFi service library.
25  *
26  * Owns the WiFi service, setup, and manages the packet flow into and out of
27  * WiFi service.
28  */
29 
30 namespace netsim::wifi::facade {
31 
32 void Reset(uint32_t);
33 void Remove(uint32_t);
34 void Patch(uint32_t, const model::Chip::Radio &);
35 model::Chip::Radio Get(uint32_t);
36 void Add(uint32_t chip_id);
37 
38 void Start(const rust::Slice<::std::uint8_t const> proto_bytes);
39 void Stop();
40 
41 // Cxx functions for rust ffi.
42 void PatchCxx(uint32_t, const rust::Slice<::std::uint8_t const> _proto_bytes);
43 rust::Vec<uint8_t> GetCxx(uint32_t);
44 
45 }  // namespace netsim::wifi::facade
46