Application Overview

The application demonstrates how to configure Quessence in client mode and ping an IP address.

 Click here  to download the source code for the Station Ping Application.

Setup Required

  1. Quessence
  2. 32/64-bit PC with minimum 2GB RAM and USB port for power, downloading and debugging software
  3. Windows 7/8/8.1/10 Operating System. It should have the Keil IDE and the CMSIS DAP drivers installed on it. Refer to installation section for download and installation steps.

Configure the Application

Use an IDE to edit the station_ping.c file available in the path Station_ping/Applications  to make the following changes.

Macro Value Description
SSID
   “”
This macro refers to the SSID name of your Access point to connect.
CHANNEL_NO
          0
This macro refers to the channel in which device should scan. If it is 0 , device will scan all channels.
SECURITY_TYPE
    
This macro refers to the security type of Access point to connect.
PSK
   “”
This macro refers to the Pre-shared key of the connected Access point.
REMOTE_IP
    
This macro is to configure IP address of the destination server
PING_SIZE
    
This macro is to configure the ping size.
NUMBER_OF_PACKETS
    
This macro is to configure Number of packets to send.
GLOBAL_BUFF_LEN
       8000
This macro is to configure Application memory length which is required by the driver
DHCP_MODE

 

To configure IP for configured station through dhcp set DHCP_MODE  to 1, else configure to 0

NOTE – In this application we are not providing the facility to configure the Access point’s IP parameters

To configure static IP address

IP address to be configured to the device should be in long format and in little endian byte order.

Example: 1.To configure “192.168.10.101” as IP address,update the macro DEVICE_IP as 0x650AA8C0.

2. To configure “192.168.10.1” as Gateway,update the macro  GATEWAY as 0x010AA8C0.

3.To configure “255.255.255.0” as network mask,update the macro NETMASK as 0x00FFFFFF 

#define  DEVICE_IP    
#define  GATEWAY      
#define  NETMASK      

 

A sample configuration is shown in the below snapshot.

Update the WLAN Configuration File

Check the following configuration of rsi_wlan_config.h file available in the path Station_ping/Libraries/Wireless/include

Macro Value
CONCURRENT_MODE RSI_DISABLE
RSI_FEATURE_BIT_MAP FEAT_SECURITY_OPEN
RSI_TCP_IP_BYPASS RSI_DISABLE
RSI_TCP_IP_FEATURE_BIT_MAP (TCP_IP_FEAT_DHCPV4_CLIENT | TCP_IP_FEAT_ICMP)
RSI_CUSTOM_FEATURE_BIT_MAP 0
RSI_BAND RSI_BAND_2P4GHZ

 

Execute the Application

  1. Connect Quessence to the Windows PC running Keil IDE.
  2. Configure the macros in the files rsi_station_ping.c and rsi_wlan_config.h as mentioned above.
  3. Build and launch the application.
  4. Quessence connects to the configured Access point as a client.
  5. Quessence starts pinging the configured  REMOTE_IP with the allocated PING_SIZE to check for the  availability of the target Device. It sends NUMBER_OF_PACKETS number of  ping packets .
  6. In station_ping.c file, rsi_wlan_ping_async function returns a success status to indicate a successfully transmitted ping packet. Use the status parameter of the callback function (rsi_ping_response_handler) registered in the Ping API to check for  a response to the ping from the remote side.