}
static int
+_on_cmd_network_get_frequency(char *cmd, char *args)
+{
+ char *path;
+ unsigned short frequency;
+ E_Connman_Element *e;
+
+ if (!args)
+ {
+ fputs("ERROR: missing the network path\n", stderr);
+ return 1;
+ }
+ _tok(args);
+ path = args;
+
+ e = e_connman_network_get(path);
+ if (e_connman_network_frequency_get(e, &frequency))
+ printf(":::Network %s Frequency = %#04hx (%d)\n", path, frequency, frequency);
+ else
+ fputs("ERROR: can't get network frequency\n", stderr);
+ return 1;
+}
+
+static int
_on_cmd_network_get_device(char *cmd, char *args)
{
E_Connman_Element *e, *device;
return 1;
}
+static int
+_on_cmd_network_get_wifi_channel(char *cmd, char *args)
+{
+ char *path;
+ E_Connman_Element *e;
+ unsigned short wifi_channel;
+
+ if (!args)
+ {
+ fputs("ERROR: missing the network path\n", stderr);
+ return 1;
+ }
+ _tok(args);
+ path = args;
+
+ e = e_connman_network_get(path);
+ if (e_connman_network_wifi_channel_get(e, &wifi_channel))
+ printf(":::Network %s Wifi Channel = %#02hx (%d)\n", path, wifi_channel, wifi_channel);
+ else
+ fputs("ERROR: can't get network wifi channel\n", stderr);
+ return 1;
+}
+
+static int
+_on_cmd_network_get_wifi_eap(char *cmd, char *args)
+{
+ const char *wifi_eap, *path;
+ E_Connman_Element *e;
+
+ if (!args)
+ {
+ fputs("ERROR: missing the network path\n", stderr);
+ return 1;
+ }
+ _tok(args);
+ path = args;
+
+ e = e_connman_network_get(path);
+ if (e_connman_network_wifi_eap_get(e, &wifi_eap))
+ printf(":::Network %s Wifi EAP = \"%s\"\n", path, wifi_eap);
+ else
+ fputs("ERROR: can't get network wifi eap\n", stderr);
+ return 1;
+}
+
/* Services Commands */
static int
_on_cmd_service_connect(char *cmd, char *args)
{"network_get_name", _on_cmd_network_get_name},
{"network_get_connected", _on_cmd_network_get_connected},
{"network_get_strength", _on_cmd_network_get_strength},
+ {"network_get_frequency", _on_cmd_network_get_frequency},
{"network_get_device", _on_cmd_network_get_device},
{"network_get_wifi_ssid", _on_cmd_network_get_wifi_ssid},
{"network_get_wifi_mode", _on_cmd_network_get_wifi_mode},
{"network_get_wifi_security", _on_cmd_network_get_wifi_security},
{"network_get_wifi_passphrase", _on_cmd_network_get_wifi_passphrase},
+ {"network_get_wifi_channel", _on_cmd_network_get_wifi_channel},
+ {"network_get_wifi_eap", _on_cmd_network_get_wifi_eap},
{"service_connect", _on_cmd_service_connect},
{"service_disconnect", _on_cmd_service_disconnect},
{"service_remove", _on_cmd_service_remove},
TEST_DESC_STRING_GET(e_connman_network_name_get, 0),
TEST_DESC_BOOL_GET(e_connman_network_connected_get, 0),
TEST_DESC_UCHAR_GET(e_connman_network_strength_get, 1),
+ TEST_DESC_USHORT_GET(e_connman_network_frequency_get, 1),
TEST_DESC_ELEMENT_GET(e_connman_network_device_get, 0),
TEST_DESC_UCHAR_ARRAY_GET(e_connman_network_wifi_ssid_get, 1),
TEST_DESC_STRING_GET(e_connman_network_wifi_mode_get, 1),
TEST_DESC_STRING_GET(e_connman_network_wifi_security_get, 1),
TEST_DESC_STRING_GET(e_connman_network_wifi_passphrase_get, 1),
+ TEST_DESC_USHORT_GET(e_connman_network_wifi_channel_get, 1),
+ TEST_DESC_STRING_GET(e_connman_network_wifi_eap_get, 1),
TEST_DESC_SENTINEL
};
EAPI bool e_connman_network_strength_get(const E_Connman_Element *network, unsigned char *strength) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
+ EAPI bool e_connman_network_frequency_get(const E_Connman_Element *network, unsigned short *frequency) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
EAPI bool e_connman_network_device_get(const E_Connman_Element *network, E_Connman_Element **element) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
EAPI bool e_connman_network_wifi_ssid_get(const E_Connman_Element *network, unsigned int *count, unsigned char **wifi_ssid) EINA_ARG_NONNULL(1, 2, 3) EINA_PURE EINA_WARN_UNUSED_RESULT;
EAPI bool e_connman_network_wifi_security_get(const E_Connman_Element *network, const char **wifi_security) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
- EAPI bool e_connman_network_wifi_passphrase_get(const E_Connman_Element *network, const char **wifi_passphare) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
+ EAPI bool e_connman_network_wifi_passphrase_get(const E_Connman_Element *network, const char **wifi_passphrase) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
+ EAPI bool e_connman_network_wifi_channel_get(const E_Connman_Element *network, unsigned short *wifi_channel) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
+ EAPI bool e_connman_network_wifi_eap_get(const E_Connman_Element *network, const char **wifi_eap) EINA_ARG_NONNULL(1, 2) EINA_PURE EINA_WARN_UNUSED_RESULT;
+
- // TODO: wifi_channel_get (missing in their docs)
- // TODO: wifi_eap_get (missing in their docs, only if ieee8021x)
// TODO: frequency_get (missing in their docs)
#ifdef __cplusplus
const char *e_connman_prop_scan_interval = NULL;
const char *e_connman_prop_scanning = NULL;
const char *e_connman_prop_state = NULL;
-const char *e_connman_prop_strengh = NULL;
+const char *e_connman_prop_strength = NULL;
+const char *e_connman_prop_frequency = NULL;
const char *e_connman_prop_type = NULL;
const char *e_connman_prop_wifi_mode = NULL;
const char *e_connman_prop_wifi_passphrase = NULL;
const char *e_connman_prop_wifi_security = NULL;
const char *e_connman_prop_wifi_ssid = NULL;
+const char *e_connman_prop_wifi_channel = NULL;
+const char *e_connman_prop_wifi_eap = NULL;
const char *e_connman_prop_error = NULL;
const char *e_connman_prop_mode = NULL;
const char *e_connman_prop_security = NULL;
e_connman_prop_scanning = eina_stringshare_add("Scanning");
if (e_connman_prop_state == NULL)
e_connman_prop_state = eina_stringshare_add("State");
- if (e_connman_prop_strengh == NULL)
- e_connman_prop_strengh = eina_stringshare_add("Strength");
+ if (e_connman_prop_strength == NULL)
+ e_connman_prop_strength = eina_stringshare_add("Strength");
+ if (e_connman_prop_frequency == NULL)
+ e_connman_prop_frequency = eina_stringshare_add("Frequency");
if (e_connman_prop_type == NULL)
e_connman_prop_type = eina_stringshare_add("Type");
if (e_connman_prop_wifi_mode == NULL)
e_connman_prop_wifi_security = eina_stringshare_add("WiFi.Security");
if (e_connman_prop_wifi_ssid == NULL)
e_connman_prop_wifi_ssid = eina_stringshare_add("WiFi.SSID");
+ if (e_connman_prop_wifi_channel == NULL)
+ e_connman_prop_wifi_channel = eina_stringshare_add("WiFi.Channel");
+ if (e_connman_prop_wifi_eap == NULL)
+ e_connman_prop_wifi_eap = eina_stringshare_add("WiFi.EAP");
if (e_connman_prop_error == NULL)
e_connman_prop_error = eina_stringshare_add("Error");
if (e_connman_prop_mode == NULL)
_stringshare_del(&e_connman_prop_scan_interval);
_stringshare_del(&e_connman_prop_scanning);
_stringshare_del(&e_connman_prop_state);
- _stringshare_del(&e_connman_prop_strengh);
+ _stringshare_del(&e_connman_prop_strength);
+ _stringshare_del(&e_connman_prop_frequency);
_stringshare_del(&e_connman_prop_type);
_stringshare_del(&e_connman_prop_wifi_mode);
_stringshare_del(&e_connman_prop_wifi_passphrase);
_stringshare_del(&e_connman_prop_wifi_security);
_stringshare_del(&e_connman_prop_wifi_ssid);
+ _stringshare_del(&e_connman_prop_wifi_channel);
+ _stringshare_del(&e_connman_prop_wifi_eap);
_stringshare_del(&e_connman_prop_error);
_stringshare_del(&e_connman_prop_mode);
_stringshare_del(&e_connman_prop_security);
EINA_SAFETY_ON_NULL_RETURN_VAL(network, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(strength, 0);
return e_connman_element_property_get_stringshared
- (network, e_connman_prop_strengh, NULL, strength);
+ (network, e_connman_prop_strength, NULL, strength);
+}
+
+/**
+ * Get property "Frequency" value.
+ *
+ * If this property isn't found then 0 is returned.
+ * If zero is returned, then this call failed and parameter-returned
+ * values shall be considered invalid.
+ *
+ * Indicates the frequency of the network.
+ *
+ * @param network path to get property.
+ * @param frequency where to store the property value, must be a pointer
+ * to uint16 (unsigned short*).
+ *
+ * @return 1 on success, 0 otherwise.
+ */
+bool
+e_connman_network_frequency_get(const E_Connman_Element *network, unsigned short *frequency)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(network, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(frequency, 0);
+ return e_connman_element_property_get_stringshared
+ (network, e_connman_prop_frequency, NULL, frequency);
}
/**
return e_connman_element_property_get_stringshared
(network, e_connman_prop_wifi_passphrase, NULL, wifi_passphrase);
}
+
+/**
+ * Get property "WiFi.Channel" value.
+ *
+ * If this property isn't found then 0 is returned.
+ * If zero is returned, then this call failed and parameter-returned
+ * values shall be considered invalid.
+ *
+ * Indicates the channel this network is.
+ *
+ * @param network path to get property.
+ * @param channel where to store the property value, must be a pointer
+ * to uint16 (unsigned short*).
+ *
+ * @return 1 on success, 0 otherwise.
+ */
+bool
+e_connman_network_wifi_channel_get(const E_Connman_Element *network, unsigned short *wifi_channel)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(network, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(wifi_channel, 0);
+ return e_connman_element_property_get_stringshared
+ (network, e_connman_prop_wifi_channel, NULL, wifi_channel);
+}
+
+/**
+ * Get property "WiFi.EAP" value.
+ *
+ * If this property isn't found then 0 is returned.
+ * If zero is returned, then this call failed and parameter-returned
+ * values shall be considered invalid.
+ *
+ * This property is only available if WiFi.Security is "ieee8021x".
+ *
+ * For systems using PolicyKit, the access to this value
+ * will be protected by the security policy.
+ *
+ * @param network path to get property.
+ * @param wifi_eap where to store the property value, must be a pointer
+ * to string (const char **), it will not be allocated or
+ * copied and references will be valid until element changes,
+ * so copy it if you want to use it later.
+ *
+ * @return 1 on success, 0 otherwise.
+ */
+bool
+e_connman_network_wifi_eap_get(const E_Connman_Element *network, const char **wifi_eap)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(network, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(wifi_eap, 0);
+ return e_connman_element_property_get_stringshared
+ (network, e_connman_prop_wifi_eap, NULL, wifi_eap);
+}
extern const char *e_connman_prop_scan_interval;
extern const char *e_connman_prop_scanning;
extern const char *e_connman_prop_state;
-extern const char *e_connman_prop_strengh;
+extern const char *e_connman_prop_strength;
+extern const char *e_connman_prop_frequency;
extern const char *e_connman_prop_type;
extern const char *e_connman_prop_wifi_mode;
extern const char *e_connman_prop_wifi_passphrase;
extern const char *e_connman_prop_wifi_security;
extern const char *e_connman_prop_wifi_ssid;
+extern const char *e_connman_prop_wifi_channel;
+extern const char *e_connman_prop_wifi_eap;
extern const char *e_connman_prop_error;
extern const char *e_connman_prop_mode;
extern const char *e_connman_prop_security;
EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(strength, 0);
return e_connman_element_property_get_stringshared
- (service, e_connman_prop_strengh, NULL, strength);
+ (service, e_connman_prop_strength, NULL, strength);
}
/**