2 * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __SA_TYPES_H__
17 #define __SA_TYPES_H__
19 #define SA_CONFIG_VERSION "version"
20 #define SA_CONFIG_NETWORKDATA "networkData"
21 #define SA_CONFIG_SYSTEMDATA "systemData"
23 #define SA_CONFIG_NETWORKDATA_WIFI "wifi"
24 #define SA_CONFIG_NETWORKDATA_WIFI_SSID "ssid"
25 #define SA_CONFIG_NETWORKDATA_WIFI_PASSWORD "password"
27 #define SA_CONFIG_NETWORKDATA_ETHERNET "ethernet"
29 #define SA_CONFIG_NETWORKDATA_ENABLED "enabled"
30 #define SA_CONFIG_NETWORKDATA_DHCPENABLED "dhcpEnabled"
31 #define SA_CONFIG_NETWORKDATA_IPADDRESS "ipAddress"
32 #define SA_CONFIG_NETWORKDATA_NETMASK "netmask"
33 #define SA_CONFIG_NETWORKDATA_DEFAULTGATEWAY "defaultGateway"
34 #define SA_CONFIG_NETWORKDATA_PRIMARYDNSSERVER "primaryDnsServer"
35 #define SA_CONFIG_NETWORKDATA_SECONDARYDNSSERVER "SecondaryDnsServer"
37 #define SA_CONFIG_NETWORKDATA_HTTPPROXYHOST "httpProxyHost"
38 #define SA_CONFIG_NETWORKDATA_HTTPPROXYPORT "httpProxyPort"
41 * @brief This enum contains setup-adaptor error information
43 * The sa_error_e indicates what error is happened
47 SA_ERROR_NONE = 0, /**< Successful */
48 SA_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
49 SA_ERROR_INVALID_CONTENTS, /**< Invalid contents */
50 SA_ERROR_OUT_OF_MEMORY, /**< Out of memory */
51 SA_ERROR_PERMISSION_DENIED, /**< Permission denied */
52 SA_ERROR_NOT_SUPPORTED, /**< Not supported */
53 SA_ERROR_UNKNOWN, /**< UNKNOWN */
57 * @brief This enum contains setup-adaptor error information
59 * The sa_error_e indicates what error is happened
63 SA_NETWORK_TYPE_WIFI = 0, /**< wifi */
64 SA_NETWORK_TYPE_ETH, /**< eth */
65 SA_NETWORK_TYPE_UNKNOWN, /**< UNKNOWN */
69 * @brief This enum contains setup-adaptor error information
71 * The sa_network_state_e indicates connection info in the system
75 SA_NETWORK_STATE_DISCONNECTED = 0, /**< Successful */
76 SA_NETWORK_STATE_PROGRESSING, /**< Connecting/Association/Configuration */
77 SA_NETWORK_STATE_CONNECTED, /**< connected */
78 SA_NETWORK_STATE_UNKNOWN, /**< UNKNOWN */
82 * @struct sa_network_static_s
83 * @brief This struct contains network static information in the config
85 * The sa_network_static_s struct encapsulate ip, netmast, gateway and dns information in the one data
92 char *primaryDnsServer;
93 char *secondaryDnsServer;
94 } sa_network_static_s;
98 * @brief This struct contains wifi information in the config
100 * The sa_wifi_s struct encapsulate enabled, dhcpEnabled, ssid, password and static information in the one data
108 sa_network_static_s *staticInfo;
113 * @brief This struct contains ethernet information in the config
115 * The sa_eth_s struct encapsulate enabled, dhcpEnabled and static information in the one data
121 sa_network_static_s *staticInfo;
125 * @struct sa_network_s
126 * @brief This struct contains network information in the config
128 * The sa_network_s struct encapsulate wifi, ethernet and proxy information in the one data
139 * @struct sa_network_activate_pararms_s
140 * @brief This struct contains update params for activation of network
142 * The sa_network_activate_pararms_s struct encapsulate network type and network info to update in the one data
146 sa_network_type_e type;
147 sa_network_s *network;
148 } sa_network_activate_pararms_s;
151 * @struct sa_systemdata_s
152 * @brief This struct contains system data information in the config
154 * The sa_systemdata_s struct encapsulate device name information in the one data
162 * @struct sa_config_s
163 * @brief This struct contains config information
165 * The sa_config_s struct encapsulate version, network and system data information in the one data
170 sa_network_s *network;
171 sa_systemdata_s *systemData;
174 #endif /* __SA_TYPES_H__ */