Change to wifi AP mode. SSID "GR-PEACH_1", PSK "12345"

Dependencies:   DhcpServer EthernetInterface FATFileSystem GR-PEACH_WlanBP3595AP GR-PEACH_video GraphicsFramework HttpServer_snapshot R_BSP mbed-rpc mbed-rtos mbed

Fork of GR-Boards_WebCamera by Renesas

Revision:
17:493d36f1febf
Parent:
16:b5469a6226c7
--- a/main.cpp	Thu Jun 02 05:39:35 2016 +0000
+++ b/main.cpp	Wed Sep 07 08:28:18 2016 +0000
@@ -7,6 +7,7 @@
 #include "RomRamFileSystem.h"
 #include "file_table.h"        //Binary data of web pages
 #include "i2c_setting.h"
+#include "DhcpServer.h"
 
 #define VIDEO_CVBS             (0)                 /* Analog  Video Signal */
 #define VIDEO_CMOS_CAMERA      (1)                 /* Digital Video Signal */
@@ -16,17 +17,17 @@
 
 /**** User Selection *********/
 /** Network setting **/
-#define USE_DHCP               (1)                 /* Select  0(static configuration) or 1(use DHCP) */
+#define USE_DHCP               (0)                 /* Select  0(static configuration) or 1(use DHCP) */
 #if (USE_DHCP == 0)
   #define IP_ADDRESS           ("192.168.0.2")     /* IP address      */
   #define SUBNET_MASK          ("255.255.255.0")   /* Subnet mask     */
   #define DEFAULT_GATEWAY      ("192.168.0.3")     /* Default gateway */
 #endif
-#define NETWORK_TYPE           (0)                 /* Select  0(EthernetInterface) or 1(GR_PEACH_WlanBP3595) */
+#define NETWORK_TYPE           (1)                 /* Select  0(EthernetInterface) or 1(GR_PEACH_WlanBP3595) */
 #if (NETWORK_TYPE == 1)
-  #define WLAN_SSID            ("SSIDofYourAP")    /* SSID */
-  #define WLAN_PSK             ("PSKofYourAP")     /* PSK(Pre-Shared Key) */
-  #define WLAN_SECURITY        NSAPI_SECURITY_WPA2 /* NSAPI_SECURITY_NONE, NSAPI_SECURITY_WEP, NSAPI_SECURITY_WPA or NSAPI_SECURITY_WPA2 */
+  #define WLAN_SSID            ("GR-PEACH_1")      /* SSID */
+  #define WLAN_PSK             ("12345")           /* PSK(Pre-Shared Key) */
+  #define WLAN_SECURITY        NSAPI_SECURITY_WEP  /* NSAPI_SECURITY_NONE, NSAPI_SECURITY_WEP, NSAPI_SECURITY_WPA or NSAPI_SECURITY_WPA2 */
 #endif
 /** Camera setting **/
 #define VIDEO_INPUT_METHOD     (VIDEO_CMOS_CAMERA) /* Select  VIDEO_CVBS or VIDEO_CMOS_CAMERA                       */
@@ -428,6 +429,7 @@
     printf("NetMask is %s\r\n", network.getNetworkMask());
     printf("Gateway Address is %s\r\n", network.getGateway());
     printf("Network Setup OK\r\n");
+    DhcpServer dhcp_server("GR-PEACH_1", network.getIPAddress());
 
     SnapshotHandler::attach_req(&snapshot_req);
     HTTPServerAddHandler<SnapshotHandler>("/camera"); //Camera