Network information

Handling WiFi network. More...

Functions

kvrStatus kvrNetworkConnectionTest (kvrConfigHandle handle, int32_t active)
 
kvrStatus kvrNetworkGetRssiRtt (kvrConfigHandle handle, kvrRssiHistory *rssi, uint32_t rssi_size, uint32_t *rssi_count, kvrRttHistory *rtt, uint32_t rtt_size, uint32_t *rtt_count)
 
kvrStatus kvrWlanStartScan (kvrConfigHandle handle, int32_t active, int32_t bss_type, int32_t domain)
 
kvrStatus kvrWlanGetScanResults (kvrConfigHandle handle, int32_t *rssi, int32_t *channel, kvrAddress *mac, int32_t *bss_type, char *ssid, uint32_t *capability, uint32_t *type_wpa, kvrCipherInfoElement *wpa_info, kvrCipherInfoElement *rsn_info)
 
kvrStatus kvrNetworkGetHostName (kvrConfigHandle handle, char *buffer, uint32_t buffer_size)
 
kvrStatus kvrHostName (uint32_t ean_hi, uint32_t ean_lo, uint32_t ser_no, char *buffer, uint32_t buffer_size)
 
kvrStatus kvrNetworkGetConnectionStatus (kvrConfigHandle handle, int32_t *state, int32_t *tx_rate, int32_t *rx_rate, int32_t *channel, int32_t *rssi, int32_t *tx_power)
 
kvrStatus kvrNetworkGetAddressInfo (kvrConfigHandle handle, kvrAddress *address1, kvrAddress *address2, kvrAddress *netmask, kvrAddress *gateway, int32_t *dhcp)
 

Detailed Description

Handling WiFi network.

Function Documentation

◆ kvrHostName()

kvrStatus kvrHostName ( uint32_t  ean_hi,
uint32_t  ean_lo,
uint32_t  ser_no,
char *  buffer,
uint32_t  buffer_size 
)

Read the generated Hostname.

Parameters
[in]ean_hiThe device EAN_high number.
[in]ean_loThe device EAN_low number.
[in]ser_noThe device serial number.
[out]bufferThe device Hostname as a C string.
[in]buffer_sizeThe device Hostname buffer size.
Returns
kvrOK on success or any other kvrStatus on failure.

◆ kvrNetworkConnectionTest()

kvrStatus kvrNetworkConnectionTest ( kvrConfigHandle  handle,
int32_t  active 
)

Activate or deactivate connection test. When actived, the device will connect and start pinging itself to measure RTT. Use kvrNetworkGetRssiRtt() (after a while) to get the latest values.

Parameters
[in]handleA configuration handle.
[in]activeActivate or deactivate connection test.
Returns
kvrOK on success or any other kvrStatus on failure.
See also
kvrNetworkGetRssiRtt()
Examples:
example/c/kvrConfig.c, and example/c/kvrNetworkConnectionTest.c.

◆ kvrNetworkGetAddressInfo()

kvrStatus kvrNetworkGetAddressInfo ( kvrConfigHandle  handle,
kvrAddress address1,
kvrAddress address2,
kvrAddress netmask,
kvrAddress gateway,
int32_t *  dhcp 
)

Get information about the network address settings. For a WLAN connected device, address1, netmask and gateway are IP addresses and address2 is the MAC address.

Parameters
[in]handleA configuration handle.
[out]address1The first address associated with the device.
[out]address2The second address associated with the device.
[out]netmaskThe netmask for the device.
[out]gatewayThe gateway for the device.
[out]dhcpThe device ueses Dynamic Host Configuration Protocol (DHCP).
Returns
kvrOK on success or any other kvrStatus on failure.
Examples:
example/c/kvrConfig.c.

◆ kvrNetworkGetConnectionStatus()

kvrStatus kvrNetworkGetConnectionStatus ( kvrConfigHandle  handle,
int32_t *  state,
int32_t *  tx_rate,
int32_t *  rx_rate,
int32_t *  channel,
int32_t *  rssi,
int32_t *  tx_power 
)

Get connection status information.

Parameters
[in]handleA configuration handle.
[out]stateNetwork connection state, see kvrNetworkState_xxx.
[out]tx_rateTransmit rate in kbit/s.
[out]rx_rateReceive rate in kbit/s.
[out]channelChannel.
[out]rssiReceive Signal Strength Indicator (RSSI).
[out]tx_powerTransmit power level in dB.
Returns
kvrOK on success or any other kvrStatus on failure.
Examples:
example/c/kvrConfig.c.

◆ kvrNetworkGetHostName()

kvrStatus kvrNetworkGetHostName ( kvrConfigHandle  handle,
char *  buffer,
uint32_t  buffer_size 
)

Read the device Hostname.

Parameters
[in]handleA configuration handle
[out]bufferThe device Hostname as a C string.
[in]buffer_sizeThe device Hostname buffer size.
Returns
kvrOK on success or any other kvrStatus on failure.

◆ kvrNetworkGetRssiRtt()

kvrStatus kvrNetworkGetRssiRtt ( kvrConfigHandle  handle,
kvrRssiHistory rssi,
uint32_t  rssi_size,
uint32_t *  rssi_count,
kvrRttHistory rtt,
uint32_t  rtt_size,
uint32_t *  rtt_count 
)

Get a history of Receive Signal Strength Indicator (RSSI) and round-trip delay time (RTT) from the connection test.

Parameters
[in]handleA configuration handle.
[out]rssiReceive Signal Strength Indicator.
[in]rssi_sizeNumber of entries in rssi.
[out]rssi_countNumber of RSSI elements returned.
[out]rttRound-trip delay time.
[in]rtt_sizeNumber of entries in rtt.
[out]rtt_countNumber of RTT elements returned.
Returns
kvrOK on success or any other kvrStatus on failure.
See also
kvrNetworkConnectionTest()
Examples:
example/c/kvrConfig.c, and example/c/kvrNetworkConnectionTest.c.

◆ kvrWlanGetScanResults()

kvrStatus kvrWlanGetScanResults ( kvrConfigHandle  handle,
int32_t *  rssi,
int32_t *  channel,
kvrAddress mac,
int32_t *  bss_type,
char *  ssid,
uint32_t *  capability,
uint32_t *  type_wpa,
kvrCipherInfoElement wpa_info,
kvrCipherInfoElement rsn_info 
)

Get results from WLAN scan. Call kvrWlanGetScanResults() until it returns kvrERR_BLANK to mark that no more information is available from this scan.

To convert the security information into a more human readable form, use kvrWlanGetSecurityText().

Parameters
[in]handleA configuration handle.
[out]rssiReceive Signal Strength Indicator (RSSI).
[out]channelWLAN Channel.
[out]macMedia Access Control address.
[out]bss_typeBasic Service Set (BSS) (see kvrBss_xxx).
[out]ssidService Set Identifier(SSID) as a C string. Maximum length is 32 bytes.
[out]capabilityThe advertised capabilities of the BSS.
[out]type_wpaOnly type 1 (802.1X) is supported for connection.
[out]wpa_infoAdvertised information for WPA (see kvrCipherInfoElement).
[out]rsn_infoAdvertised information for RSN (see kvrCipherInfoElement).
Returns
kvrOK on success, kvrERR_NO_ANSWER when waiting for further scan results kvrERR_BLANK when no further scan results are available or any other kvrStatus on failure.
Examples:
example/c/kvrConfig.c.

◆ kvrWlanStartScan()

kvrStatus kvrWlanStartScan ( kvrConfigHandle  handle,
int32_t  active,
int32_t  bss_type,
int32_t  domain 
)

Initiate a scan for existing WLAN networks. The result is acquired with consecutive calls to kvrWlanGetScanResults(). A new scan can not be initiated until all data has been retrieved from the previous one.

Note
The device should not be connected to a network when scanning. This includes the implicit connection done by kvrNetworkConnectionTest().
Parameters
[in]handleA configuration handle.
[in]activeIf set, performs an active scan.
[in]bss_typeBasic service set (BSS) selection. kvrBss_xxx.
[in]domainRegulatory domain. See kvrRegulatoryDomain_xxx.
Returns
kvrOK on success, kvrERR_NO_ANSWER when previous scan is ongoing or any other kvrStatus on failure.
Examples:
example/c/kvrConfig.c.