summaryrefslogtreecommitdiff
path: root/test-rpc-proxy/proxy_rpc_data_types.h
blob: f01e1ff8e32661d54a3511658c58d1a2a385a875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#ifndef PROXY_RPC_DATA_TYPES_H
#define PROXY_RPC_DATA_TYPES_H

#include <stdio.h>
#include <stdlib.h>
#include <sysexits.h>

#include <string>

#include "proxy_rpc_security_types.h"

// TODO: Only creating the datatypes. Need to figure out how to handle it.
class ProxyRpcDataType {
 public:
   ProxyRpcDataType() {}
};

// Describes parameters used in WiFi connection attempts."""
class AssociationParameters : public xmlrpc_types.XmlRpcStruct {
 public:
  const int kDefaultDiscoveryTimeout = 15;
  const int kDefaultAssociationTimeout = 15;
  const int kDefaultConfigurationTimeout = 15;
  const char kStationTypeManaged[] = "managed";
  const char kStationTypeIbss[] = "ibss";

 protected:
  std::string ssid_;
  SecurityConfig security_config_;
  int discovery_timeout_;
  int association_timeout_;
  int configuration_timeout_;
  bool is_hidden_;
  bool save_credentials_;
  std::string station_type_;
  bool expect_failure_;
  std::string service_guid_;
  bool expect_failure_;
  bool auto_connect_;
  BgscanConfiguration bgscan_config_;
};

// Describes the result of an association attempt.
class AssociationResult : public ProxyRpcDataType {
 public:

 protected:
  bool success_;
  int discovery_time_;
  int association_timeout_;
  int configuration_timeout_;
  int failure_reason_;
};

// Describes how to configure wpa_supplicant on a DUT.
class BgscanConfiguration : public ProxyRpcDataType {
 public:
  const int kDefaultShortIntervalSeconds = 30;
  const int kDefaultLongIntervalSeconds = 180;
  const int kDefaultignalThreshold = -50;
  const char kScanMethodDefault[] = "default";
  const char kScanMethodNone[] = "none";
  const char kScanMethodSimple[] = "simple";

 protected:
  std::string interface_;
  int signal_;
  int short_interval_;
  int long_interval_;
  std::string scan_method_;
};

// Describes a group of optional settings for use with ConfigureService.
// The Manager in shill has a method ConfigureService which takes a dictionary
// of parameters, and uses some of them to look up a service, and sets the
// remainder of the properties on the service.  This struct represents
// some of the optional parameters that can be set in this way.  Current
// consumers of this interface look up the service by GUID.
class ConfigureServiceParameters : public ProxyRpcDataType {
 public:

 protected:
  std::string service_guid_;
  std::string passphrase_;
  bool auto_connect_;
};

#endif // PROXY_RPC_DATA_TYPES_H