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
22class DataService : public ModemService, public std::enable_shared_from_this<DataService> {
23 public:
24 DataService(int32_t service_id, ChannelMonitor* channel_monitor,
25 ThreadLooper* thread_looper);
26 ~DataService() = default;
27
28 DataService(const DataService &) = delete;
29 DataService &operator=(const DataService &) = delete;
30
31 void HandleActivateDataCall(const Client& client, const std::string& command);
32 void HandleQueryDataCallList(const Client& client);
33 void HandlePDPContext(const Client& client, const std::string& command);
34 void HandleQueryPDPContextList(const Client& client);
35 void HandleEnterDataState(const Client& client, const std::string& command);
36 void HandleReadDynamicParam(const Client& client, const std::string& command);
37
38 void onUpdatePhysicalChannelconfigs(int modem_tech, int freq,
39 int cellBandwidthDownlink);
40
41 private:
42 std::vector<CommandHandler> InitializeCommandHandlers();
44 void sendOnePhysChanCfgUpdate(int status, int bandwidth, int rat, int freq,
45 int id);
46 void updatePhysicalChannelconfigs(int modem_tech, int freq,
47 int cellBandwidthDownlink, int count);
48
49 struct PDPContext {
51
52 int cid;
54 std::string conn_types;
55 std::string apn;
56 std::string addresses;
57 std::string dnses;
58 std::string gateways;
59 };
60 std::vector<PDPContext> pdp_context_;
61};
62
63} // namespace cuttlefish
Definition: channel_monitor.h:35
Definition: client.h:47
Definition: data_service.h:22
void HandleQueryDataCallList(const Client &client)
Definition: data_service.cpp:106
void updatePhysicalChannelconfigs(int modem_tech, int freq, int cellBandwidthDownlink, int count)
Definition: data_service.cpp:317
std::vector< CommandHandler > InitializeCommandHandlers()
Definition: data_service.cpp:31
void sendOnePhysChanCfgUpdate(int status, int bandwidth, int rat, int freq, int id)
Definition: data_service.cpp:304
DataService & operator=(const DataService &)=delete
void HandleReadDynamicParam(const Client &client, const std::string &command)
Definition: data_service.cpp:272
void onUpdatePhysicalChannelconfigs(int modem_tech, int freq, int cellBandwidthDownlink)
Definition: data_service.cpp:312
void InitializeServiceState()
Definition: data_service.cpp:77
std::vector< PDPContext > pdp_context_
Definition: data_service.h:60
void HandleActivateDataCall(const Client &client, const std::string &command)
Definition: data_service.cpp:98
DataService(int32_t service_id, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper)
Definition: data_service.cpp:24
void HandleQueryPDPContextList(const Client &client)
Definition: data_service.cpp:189
void HandlePDPContext(const Client &client, const std::string &command)
Definition: data_service.cpp:149
void HandleEnterDataState(const Client &client, const std::string &command)
Definition: data_service.cpp:221
DataService(const DataService &)=delete
Definition: modem_service.h:63
Definition: thread_looper.h:51
int status()
Definition: health.cpp:42
Definition: alloc_utils.cpp:23
Definition: data_service.h:49
int cid
Definition: data_service.h:52
std::string conn_types
Definition: data_service.h:54
std::string gateways
Definition: data_service.h:58
CidState state
Definition: data_service.h:53
std::string addresses
Definition: data_service.h:56
std::string apn
Definition: data_service.h:55
std::string dnses
Definition: data_service.h:57
CidState
Definition: data_service.h:50
@ NO_ACTIVE
Definition: data_service.h:50
@ ACTIVE
Definition: data_service.h:50