void wifi_startup(){

  config_wifi();            // This function sets up the wifi sensor for operation.  Basic housekeeping.
  wifi_auth_mode(2);        // Set the authentication mode.
                            // 0 is none or WPA // 1 is Open network // 2 is Shared with WEP
  setDHCP(1);               // Get us an IP number
  set_wpa_psk();            // Calculates your psk
  Receive(true);            // Housekeeping
  Receive(true);            // Housekeeping
  connect_to_ssid();        // Connects to the wifi network you've designated
  PlaySound(soundBeepBeep); // After connection, announce to the world you're connected.
  Receive(true);            // Housekeeping.
}
Example #2
0
bool JPWiFly::createApModeNetwork(const char *ssid, int channel, const int port) {
	StCommand st(this);
	setJoin(WIFLY_WLAN_JOIN_APMODE);
	setChannel(channel);
	setSSID(ssid);
	setDHCP(WIFLY_DHCP_MODE_SERVER);
	setPort(port);
	setIP(PSTR("1.2.3.4"));
	setNetmask(PSTR("255.255.255.0"));
	setGateway(PSTR("1.2.3.4"));
	
	save();
	reboot();
	return true;
}
Example #3
0
bool JPWiFly::enableDHCP() {
	return setDHCP(WIFLY_DHCP_MODE_ON);
}
Example #4
0
bool JPWiFly::disableDHCP() {
	return setDHCP(WIFLY_DHCP_MODE_OFF);
}