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

Files at this revision

API Documentation at this revision

Comitter:
dkato
Date:
Wed Jun 01 07:35:41 2016 +0000
Parent:
14:212f66386982
Child:
16:b5469a6226c7
Commit message:
Supports Wifi BP3595(for STA mode).

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
GR-PEACH_WlanBP3595STA.lib Show annotated file Show diff for this revision Revisions of this file
GR-PEACH_video.lib Show annotated file Show diff for this revision Revisions of this file
GraphicsFramework.lib Show annotated file Show diff for this revision Revisions of this file
R_BSP.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rpc.lib Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface.lib	Tue Apr 19 02:22:08 2016 +0000
+++ b/EthernetInterface.lib	Wed Jun 01 07:35:41 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#4d7bff17a592
+http://mbed.org/users/mbed_official/code/EthernetInterface/#183490eb1b4a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GR-PEACH_WlanBP3595STA.lib	Wed Jun 01 07:35:41 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Rohm/code/GR-PEACH_WlanBP3595STA/#14efbf8a07ea
--- a/GR-PEACH_video.lib	Tue Apr 19 02:22:08 2016 +0000
+++ b/GR-PEACH_video.lib	Wed Jun 01 07:35:41 2016 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/Renesas/code/GR-PEACH_video/#3149baf7925b
+http://developer.mbed.org/teams/Renesas/code/GR-PEACH_video/#e0e475089616
--- a/GraphicsFramework.lib	Tue Apr 19 02:22:08 2016 +0000
+++ b/GraphicsFramework.lib	Wed Jun 01 07:35:41 2016 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/Renesas/code/GraphicsFramework/#9a05caaee29a
+http://developer.mbed.org/teams/Renesas/code/GraphicsFramework/#5a1c5bffebce
--- a/R_BSP.lib	Tue Apr 19 02:22:08 2016 +0000
+++ b/R_BSP.lib	Wed Jun 01 07:35:41 2016 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/Renesas/code/R_BSP/#c5c630882b90
+http://developer.mbed.org/teams/Renesas/code/R_BSP/#fb9eda52224e
--- a/main.cpp	Tue Apr 19 02:22:08 2016 +0000
+++ b/main.cpp	Wed Jun 01 07:35:41 2016 +0000
@@ -2,7 +2,6 @@
 #include "DisplayBace.h"
 #include "rtos.h"
 #include "JPEG_Converter.h"
-#include "EthernetInterface.h"
 #include "HTTPServer.h"
 #include "mbed_rpc.h"
 #include "RomRamFileSystem.h"
@@ -23,6 +22,12 @@
   #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) */
+#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 */
+#endif
 /** Camera setting **/
 #define VIDEO_INPUT_METHOD     (VIDEO_CMOS_CAMERA) /* Select  VIDEO_CVBS or VIDEO_CMOS_CAMERA                       */
 #define VIDEO_INPUT_FORMAT     (VIDEO_YCBCR422)    /* Select  VIDEO_YCBCR422 or VIDEO_RGB888 or VIDEO_RGB565        */
@@ -52,7 +57,16 @@
 #define VIDEO_BUFFER_STRIDE    (((PIXEL_HW * DATA_SIZE_PER_PIC) + 31u) & ~31u)
 #define VIDEO_BUFFER_HEIGHT    (PIXEL_VW)
 
-EthernetInterface network;
+#if (NETWORK_TYPE == 0)
+  #include "EthernetInterface.h"
+  EthernetInterface network;
+#elif (NETWORK_TYPE == 1)
+  #include "GR_PEACH_WlanBP3595.h"
+  GR_PEACH_WlanBP3595 network;
+  DigitalOut usb1en(P3_8);
+#else
+  #error NETWORK_TYPE error
+#endif /* NETWORK_TYPE */
 RomRamFileSystem romramfs("romram");
 
 #if defined(__ICCARM__)
@@ -280,7 +294,8 @@
 }
 
 static void TerminalWrite(Arguments* arg, Reply* r) {
-    printf("%s\n",arg->argv[0]);
+    printf("touch count=%s, %s\n", arg->argv[0], arg->argv[1]);
+    r->putData<const char*>("ok");
 }
 
 static void mount_romramfs(void) {
@@ -376,6 +391,14 @@
     RPCFunction rpcFunc(TerminalWrite, "TerminalWrite");
     RPCFunction rpcSetI2C(SetI2CfromWeb, "SetI2CfromWeb");
 
+#if (NETWORK_TYPE == 1)
+    //Audio Camera Shield USB1 enable for WlanBP3595
+    usb1en = 1;        //Outputs high level
+    Thread::wait(5);
+    usb1en = 0;        //Outputs low level
+    Thread::wait(5);
+#endif
+
     printf("Network Setting up...\r\n");
 #if (USE_DHCP == 1)
     if (network.init() != 0) {                             //for DHCP Server
@@ -385,7 +408,11 @@
         printf("Network Initialize Error \r\n");
         return -1;
     }
+#if (NETWORK_TYPE == 0)
     if (network.connect() != 0) {
+#else
+    if (network.connect(WLAN_SSID, WLAN_PSK, WLAN_SECURITY) != 0) {
+#endif
         printf("Network Connect Error \r\n");
         return -1;
     }
--- a/mbed-rpc.lib	Tue Apr 19 02:22:08 2016 +0000
+++ b/mbed-rpc.lib	Wed Jun 01 07:35:41 2016 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/mbed/code/mbed-rpc/#188b1505f827
+http://developer.mbed.org/teams/mbed/code/mbed-rpc/#33e21ae4d434
--- a/mbed-rtos.lib	Tue Apr 19 02:22:08 2016 +0000
+++ b/mbed-rtos.lib	Wed Jun 01 07:35:41 2016 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/mbed_official/code/mbed-rtos/#bdd541595fc5
+http://developer.mbed.org/users/mbed_official/code/mbed-rtos/#4c105b8d7cae
--- a/mbed.bld	Tue Apr 19 02:22:08 2016 +0000
+++ b/mbed.bld	Wed Jun 01 07:35:41 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file