Android-cuttlefish cvd tool
data_service.h
Go to the documentation of this file.
1//
2// Copyright (C) 2020 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#pragma once
17
19
20namespace cuttlefish {
21
23 public std::enable_shared_from_this<DataService> {
24 public:
25 DataService(int32_t service_id, ChannelMonitor* channel_monitor,
26 ThreadLooper* thread_looper);
27 ~DataService() = default;
28
29 DataService(const DataService&) = delete;
31
32 void HandleActivateDataCall(const Client& client, const std::string& command);
33 void HandleQueryDataCallList(const Client& client);
34 void HandlePDPContext(const Client& client, const std::string& command);
35 void HandleQueryPDPContextList(const Client& client);
36 void HandleEnterDataState(const Client& client, const std::string& command);
37 void HandleReadDynamicParam(const Client& client, const std::string& command);
38
39 void onUpdatePhysicalChannelconfigs(int modem_tech, int freq,
40 int cellBandwidthDownlink);
41
42 private:
43 std::vector<CommandHandler> InitializeCommandHandlers();
45 void sendOnePhysChanCfgUpdate(int status, int bandwidth, int rat, int freq,
46 int id);
47 void updatePhysicalChannelconfigs(int modem_tech, int freq,
48 int cellBandwidthDownlink, int count);
49
50 struct PDPContext {
52
53 int cid;
55 std::string conn_types;
56 std::string apn;
57 std::string addresses;
58 std::string dnses;
59 std::string gateways;
60 };
61 std::vector<PDPContext> pdp_context_;
62};
63
64} // namespace cuttlefish
Definition: channel_monitor.h:35
Definition: client.h:48
Definition: data_service.h:23
void HandleQueryDataCallList(const Client &client)
Definition: data_service.cpp:104
void updatePhysicalChannelconfigs(int modem_tech, int freq, int cellBandwidthDownlink, int count)
Definition: data_service.cpp:309
std::vector< CommandHandler > InitializeCommandHandlers()
Definition: data_service.cpp:29
void sendOnePhysChanCfgUpdate(int status, int bandwidth, int rat, int freq, int id)
Definition: data_service.cpp:296
DataService & operator=(const DataService &)=delete
void HandleReadDynamicParam(const Client &client, const std::string &command)
Definition: data_service.cpp:268
void onUpdatePhysicalChannelconfigs(int modem_tech, int freq, int cellBandwidthDownlink)
Definition: data_service.cpp:304
void InitializeServiceState()
Definition: data_service.cpp:75
std::vector< PDPContext > pdp_context_
Definition: data_service.h:61
void HandleActivateDataCall(const Client &client, const std::string &command)
Definition: data_service.cpp:96
DataService(int32_t service_id, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper)
Definition: data_service.cpp:22
void HandleQueryPDPContextList(const Client &client)
Definition: data_service.cpp:184
void HandlePDPContext(const Client &client, const std::string &command)
Definition: data_service.cpp:147
void HandleEnterDataState(const Client &client, const std::string &command)
Definition: data_service.cpp:216
DataService(const DataService &)=delete
Definition: modem_service.h:63
Definition: thread_looper.h:51
int status()
Definition: health.cpp:44
Definition: alloc_driver.h:20
Definition: data_service.h:50
int cid
Definition: data_service.h:53
std::string conn_types
Definition: data_service.h:55
std::string gateways
Definition: data_service.h:59
CidState state
Definition: data_service.h:54
std::string addresses
Definition: data_service.h:57
std::string apn
Definition: data_service.h:56
std::string dnses
Definition: data_service.h:58
CidState
Definition: data_service.h:51
@ NO_ACTIVE
Definition: data_service.h:51
@ ACTIVE
Definition: data_service.h:51