X-NUCLEO-IDW01M1 Wi-Fi expansion board mbed OS 2 ("Classic") library. mbed OS 5 library also available (see below).

Dependencies:   SPWF01SA

Dependents:   SpwfInterface_NSAPI_Testsv2 Nucleo_read_a0_thingspace Nucleo_read_a0_thingspace_mems Cayenne-X-NUCLEO-IDW01M1 ... more

Fork of X_NUCLEO_IDW01M1v2 by ST Expansion SW Team

Introduction

X_NUCLEO_IDW01M1 is a mbed library for the Wi-Fi expansion board X-NUCLEO-IDW01M1 compatible with STM32 Nucleo.

The software can be used for building Wi-Fi applications with the SPWF01SA module. It is an implementation of the NetworkSocketAPI library from mbed OS 2 ("Classic").
mbed OS 5 library can instead be found at this link.

Firmware Library

The X_NUCLEO_IDW01M1 library comes with a sample application (HelloWorld_IDW01M1v2) and a NSAPI test suite application (SpwfInterface_NSAPI_Testsv2).

This library is only supported on NUCLEO platforms and any platforms with Arduino connector. However connection to arduino needs to be done manually using 4 wires for Vdd, Gnd, Rx and Tx. Example applications have more specific details on exact connections to be used.

The features of the library are :

  • Supports mbed OS 2 ("Classic") NetworkSocketAPI
  • Supports both client sockets
  • Configuration of USART pins to be used

Class SpwfSAInterface is intended to represent the X-NUCLEO-IDW01M1 expansion board with the SPWF module.

The expansion board is basically featuring the component:

  1. a SPWF01SA Serial-to-Wi-Fi module

Example Applications

NSAPI Test Suite

Files at this revision

API Documentation at this revision

Comitter:
mapellil
Date:
Fri Jan 13 14:37:49 2017 +0000
Parent:
15:0a075334e0e9
Commit message:
added get_time API

Changed in this revision

SPWF01SA.lib Show annotated file Show diff for this revision Revisions of this file
SpwfInterface.cpp Show annotated file Show diff for this revision Revisions of this file
SpwfInterface.h Show annotated file Show diff for this revision Revisions of this file
diff -r 0a075334e0e9 -r c8697141ce44 SPWF01SA.lib
--- a/SPWF01SA.lib	Tue Jan 10 10:39:56 2017 +0000
+++ b/SPWF01SA.lib	Fri Jan 13 14:37:49 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST/code/SPWF01SA/#6b79352bc1fa
+https://developer.mbed.org/teams/ST/code/SPWF01SA/#0dc1402f42a9
diff -r 0a075334e0e9 -r c8697141ce44 SpwfInterface.cpp
--- a/SpwfInterface.cpp	Tue Jan 10 10:39:56 2017 +0000
+++ b/SpwfInterface.cpp	Fri Jan 13 14:37:49 2017 +0000
@@ -167,6 +167,16 @@
     return (_spwf.settime(ctTime));
 }
 
+/**
+* @brief  get UTC time on wifi module
+* @param  time since epoch in UTC format
+* @retval true on succes
+*/
+int SpwfSAInterface::get_time(time_t *ctTime)
+{
+    return (_spwf.gettime(ctTime));
+}
+
 int SpwfSAInterface::set_TLS_certificate(char *cert, unsigned int size, CertType_t type)
 {
     return (_spwf.setTLScertificate(cert, size, type));    
@@ -223,7 +233,7 @@
     socket->server_port = id;
     socket->proto = proto;
     socket->connected = false;
-    if (isSecure_socket()) socket->secure = true;    
+    if (isSecure_mode()) socket->secure = true;    
     else socket->secure = false;
     *handle = socket;
     return 0;
@@ -254,7 +264,7 @@
 * @param  none
 * @retval true if secure
 */
-bool SpwfSAInterface::isSecure_socket(void)
+bool SpwfSAInterface::isSecure_mode(void)
 {
     return isSecure;
 }
diff -r 0a075334e0e9 -r c8697141ce44 SpwfInterface.h
--- a/SpwfInterface.h	Tue Jan 10 10:39:56 2017 +0000
+++ b/SpwfInterface.h	Fri Jan 13 14:37:49 2017 +0000
@@ -63,11 +63,12 @@
     // implementation of secure sockets
     virtual     void set_secure_mode(void);    // to be called before socket creation if TLS/SSL is required
     virtual     void set_unsecure_mode(void);  // to be called after socket creation to set unsecure mode (deft)
-    virtual     bool isSecure_socket(void);       
-    virtual     int set_time(time_t ctTime);      // TLS/SSL requires correct system time to check certificates 
-    virtual     int set_TLS_certificate(char * cert, unsigned int size, CertType_t type); // root cert in PEM format 
-    virtual     int set_TLS_SRV_domain(char * domain, CertType_t type);  // secure server domain
-    virtual     int clean_TLS_certificate(CertType_t type);
+    virtual     bool isSecure_mode(void);  
+    virtual     int  set_time(time_t ctTime);      // TLS/SSL requires correct system time to check certificates 
+    virtual     int  get_time(time_t *ctTime);        
+    virtual     int  set_TLS_certificate(char * cert, unsigned int size, CertType_t type); // root cert in PEM format 
+    virtual     int  set_TLS_SRV_domain(char * domain, CertType_t type);  // secure server domain
+    virtual     int  clean_TLS_certificate(CertType_t type);
     void        debug(const char * string);
     
     //Implementation of NetworkStack