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__
21 #define SA_CONFIG_VERSION "version"
22 #define SA_CONFIG_NETWORKDATA "networkData"
23 #define SA_CONFIG_SYSTEMDATA "systemData"
25 #define SA_CONFIG_NETWORKDATA_WIFI "wifi"
26 #define SA_CONFIG_NETWORKDATA_WIFI_SSID "ssid"
27 #define SA_CONFIG_NETWORKDATA_WIFI_PASSWORD "password"
29 #define SA_CONFIG_NETWORKDATA_ETHERNET "ethernet"
32 #define SA_CONFIG_NETWORKDATA_ENABLED "enabled"
33 #define SA_CONFIG_NETWORKDATA_DHCPENABLED "dhcpEnabled"
34 #define SA_CONFIG_NETWORKDATA_IPADDRESS "ipAddress"
35 #define SA_CONFIG_NETWORKDATA_NETMASK "netmask"
36 #define SA_CONFIG_NETWORKDATA_DEFAULTGATEWAY "defaultGateway"
37 #define SA_CONFIG_NETWORKDATA_PRIMARYDNSSERVER "primaryDnsServer"
38 #define SA_CONFIG_NETWORKDATA_SECONDARYDNSSERVER "SecondaryDnsServer"
40 #define SA_CONFIG_NETWORKDATA_HTTPPROXYHOST "httpProxyHost"
41 #define SA_CONFIG_NETWORKDATA_HTTPPROXYPORT "httpProxyPort"
46 * @brief This enum contains setup-adaptor error information
48 * The sa_error_e indicates what error is happened
52 SA_ERROR_NONE = 0, /**< Successful */
53 SA_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
54 SA_ERROR_INVALID_CONTENTS, /**< Invalid contents */
55 SA_ERROR_OUT_OF_MEMORY, /**< Out of memory */
56 SA_ERROR_PERMISSION_DENIED, /**< Permission denied */
57 SA_ERROR_NOT_SUPPORTED, /**< Not supported */
58 SA_ERROR_UNKNOWN, /**< UNKNOWN */
62 * @brief This enum contains setup-adaptor error information
64 * The sa_error_e indicates what error is happened
68 SA_NETWORK_TYPE_WIFI = 0, /**< wifi */
69 SA_NETWORK_TYPE_ETH, /**< eth */
70 SA_NETWORK_TYPE_UNKNOWN, /**< UNKNOWN */
75 * @brief This enum contains setup-adaptor error information
77 * The sa_network_state_e indicates connection info in the system
81 SA_NETWORK_STATE_DISCONNECTED = 0, /**< Successful */
82 SA_NETWORK_STATE_PROGRESSING, /**< Connecting/Association/Configuration */
83 SA_NETWORK_STATE_CONNECTED, /**< connected */
84 SA_NETWORK_STATE_UNKNOWN, /**< UNKNOWN */
88 * @struct sa_network_static_s
89 * @brief This struct contains network static information in the config
91 * The sa_network_static_s struct encapsulate ip, netmast, gateway and dns information in the one data
98 char *primaryDnsServer;
99 char *secondaryDnsServer;
100 } sa_network_static_s;
104 * @brief This struct contains wifi information in the config
106 * The sa_wifi_s struct encapsulate enabled, dhcpEnabled, ssid, password and static information in the one data
114 sa_network_static_s *staticInfo;
119 * @brief This struct contains ethernet information in the config
121 * The sa_eth_s struct encapsulate enabled, dhcpEnabled and static information in the one data
127 sa_network_static_s *staticInfo;
131 * @struct sa_network_s
132 * @brief This struct contains network information in the config
134 * The sa_network_s struct encapsulate wifi, ethernet and proxy information in the one data
146 * @struct sa_network_activate_pararms_s
147 * @brief This struct contains update params for activation of network
149 * The sa_network_activate_pararms_s struct encapsulate network type and network info to update in the one data
153 sa_network_type_e type;
154 sa_network_s *network;
155 } sa_network_activate_pararms_s;
158 * @struct sa_systemdata_s
159 * @brief This struct contains system data information in the config
161 * The sa_systemdata_s struct encapsulate device name information in the one data
169 * @struct sa_config_s
170 * @brief This struct contains config information
172 * The sa_config_s struct encapsulate version, network and system data information in the one data
177 sa_network_s *network;
178 sa_systemdata_s *systemData;
181 #endif /* __SA_TYPES_H__ */