Sync inav to Gitea
Make sure docs are updated / settings_md (push) Canceled after 0s
Build firmware / test (push) Canceled after 0s
Build firmware / build-SITL-Windows (push) Canceled after 0s
Build firmware / build-SITL-Mac (push) Canceled after 0s
Build firmware / build-SITL-Linux (push) Canceled after 0s
Build firmware / build-SITL-Linux-arm64 (push) Canceled after 0s
Build firmware / upload-artifacts (push) Canceled after 0s
Build firmware / build-single-target (push) Canceled after 0s
Build firmware / build (9) (push) Canceled after 0s
Build firmware / build (8) (push) Canceled after 0s
Build firmware / build (7) (push) Canceled after 0s
Build firmware / build (6) (push) Canceled after 0s
Build firmware / build (5) (push) Canceled after 0s
Build firmware / build (4) (push) Canceled after 0s
Build firmware / build (3) (push) Canceled after 0s
Build firmware / build (2) (push) Canceled after 0s
Build firmware / build (14) (push) Canceled after 0s
Build firmware / build (13) (push) Canceled after 0s
Build firmware / build (12) (push) Canceled after 0s
Build firmware / build (11) (push) Canceled after 0s
Build firmware / build (10) (push) Canceled after 0s
Build firmware / build (1) (push) Canceled after 0s
Build firmware / build (0) (push) Canceled after 0s
Build firmware / detect (push) Canceled after 0s
Build pre-release / build (push) Canceled after 0s
Build pre-release / Release (push) Canceled after 0s

This commit is contained in:
2026-08-03 16:37:40 +08:00
commit dac37fd077
14095 changed files with 5603119 additions and 0 deletions
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team via this [link](https://www.st.com/content/st_com/en/contact-us.html).
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
For answers to common questions about this code of conduct, see the [FAQ section](https://www.contributor-covenant.org/faq).
@@ -0,0 +1,40 @@
# Contributing guide
This guide serves as a checklist before contributing to this repository. It mainly focuses on the steps to follow to submit an issue or a pull-request.
## 1. Issues
### 1.1 Before opening an issue
Please check the following points before posting an issue:
* Make sure you are using the latest commit (major releases are tagged, but corrections are available as new commits).
* Make sure your issue is a question/feedback/suggestions **related to** the software provided in this repository. Otherwise, please refer to section [3](CONTRIBUTING.md#3-support-requests-and-questions) below.
* Make sure your issue is not already reported/fixed on GitHub or discussed on a previous issue. Do not forget to browse into the **closed** issues.
### 1.2 Posting the issue
When you have checked the previous points, create a new report from the **Issues** tab of this repository. A template is available [here](../../issues/new/choose) to help you report the issue you are facing or the enhancement you would like to propose.
## 2. Pull Requests
### 2.1 Before opening a pull-request
STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure.
* If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual [CLA](https://cla.st.com).
* If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate [CLA](https://cla.st.com) mentioning your GitHub account name.
* If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check the [CLA](https://cla.st.com) dedicated page.
Please note that:
* The Corporate CLA will always take precedence over the Individual CLA.
* One CLA submission is sufficient, for any project proposed by STMicroelectronics.
### 2.2 How to proceed
* We recommend to engage first a communication thru an issue, in order to present your proposal, just to confirm that it corresponds to STMicroelectronics' domain or scope.
* Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version.
* Please, submit one pull-request per new feature or proposal. This will ease the analysis and the final merge if accepted.
## 3. Support requests and questions
For support requests or any other question related to the product, the tools, the environment, you can submit a post to the **ST Community** on the appropriate topic [page](https://community.st.com/s/topiccatalog).
@@ -0,0 +1,34 @@
# BSP STM32-ES-WIFI ES WIFI Component
![latest tag](https://img.shields.io/github/v/tag/STMicroelectronics/stm32-es-wifi.svg?color=brightgreen)
## Overview
**STM32Cube** is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost.
**STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.
* The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
* The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
* The BSP drivers of each evaluation, demonstration or nucleo board provided for this STM32 series.
* A consistent set of middleware libraries such as RTOS, USB, FatFS, graphics, touch sensing library...
* A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.
Two models of publication are proposed for the STM32Cube embedded software:
* The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series).
* The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.
## Description
This **stm32-es-wifi** MCU component repository is one element **common to all** STM32Cube MCU embedded software packages, providing the **ES-WIFI** BSP component part.
## Release note
Details about the content of this release are available in the release note [here](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/stm32-es-wifi/blob/main/Release_Notes.html).
## Compatibility information
Please refer to the repository of the BSP **board** driver you are using to know which version of this BSP component driver to use. It is **crucial** that you use a consistent set of versions as indicated.
## Troubleshooting
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
@@ -0,0 +1,147 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>Release Notes for ES_WIFI Component Driver</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="../../../../_htmresc/mini-st.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<div class="row">
<div class="col-sm-12 col-lg-4">
<div class="card fluid">
<div class="sectione dark">
<center>
<h1 id="release-notes-for-es_wifi-component-driver"><small>Release Notes for</small> <mark>ES_WIFI Component Driver</mark></h1>
<p>Copyright © 2017 STMicroelectronics<br />
Microcontrollers Division - Application Team</p>
<a href="https://www.st.com" class="logo"><img src="../../../../_htmresc/st_logo.png" alt="ST logo" /></a>
</center>
</div>
</div>
<h1 id="license">License</h1>
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
<h1 id="purpose">Purpose</h1>
<p>This directory contains the ES_WIFI component driver.</p>
</div>
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
<input type="checkbox" id="collapse-section25" checked aria-hidden="true"> <label for="collapse-section25" aria-hidden="true">V1.6.0 / 09-Apr-2020</label>
<div>
<h2 id="main-changes">Main Changes</h2>
<ul>
<li>Add country code definition in configuration file to allow higher WiFi channels support</li>
<li>Replaced strtok() by strtok_r() to be thread-safe</li>
<li>Add Sock info and Peer info functions</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section24" aria-hidden="true"> <label for="collapse-section24" aria-hidden="true">V1.5.0 / 21-Nov-2019</label>
<div>
<h2 id="main-changes-1">Main Changes</h2>
<ul>
<li>Add partial support of new Inventek Module for Tiny Shark board</li>
<li>Fix MISRA deviation</li>
<li>Improve embedded TLS support API</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section23" aria-hidden="true"> <label for="collapse-section23" aria-hidden="true">V1.4.0 / 03-July-2019</label>
<div>
<h2 id="main-changes-2">Main Changes</h2>
<ul>
<li>Set a default value to read and write time-out when non blocking</li>
<li>Add ES_WIFI_MAX_SO_TIMEOUT</li>
<li>Apply new template for sources</li>
<li>New release notes format</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section22" aria-hidden="true"> <label for="collapse-section22" aria-hidden="true">V1.3.0 / 10-Sept-2018</label>
<div>
<h2 id="main-changes-3">Main Changes</h2>
<ul>
<li>Add support of TLS connection based on internal WIFI module support</li>
<li>Ability to list Access Point one by one from Inventek firmware version 3.5.2.5</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section20" aria-hidden="true"> <label for="collapse-section20" aria-hidden="true">V1.2.0 / 24-July-2018</label>
<div>
<h2 id="main-changes-4">Main Changes</h2>
<ul>
<li>Add parameter to ES_WIFI_Ping() API to get the time for each ping.</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section19" aria-hidden="true"> <label for="collapse-section19" aria-hidden="true">V1.1.2 / 07-June-2018</label>
<div>
<h2 id="main-changes-5">Main Changes</h2>
<ul>
<li>Fix in UDP support along new Inventek FW versions &gt;= C3.5.2.4.STM.RC11</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section185" aria-hidden="true"> <label for="collapse-section185" aria-hidden="true">V1.1.1 / 27-February-2018</label>
<div>
<h2 id="main-changes-6">Main Changes</h2>
<ul>
<li>Improve TCP server command</li>
<li>Improve Robustness on potential memory overflows</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section18" aria-hidden="true"> <label for="collapse-section18" aria-hidden="true">V1.1.0 / 05-February-2018</label>
<div>
<h2 id="main-changes-7">Main Changes</h2>
<ul>
<li>Support for UDP sockets</li>
<li>Spport for projects using RTOS</li>
<li>Fix issue on never ending reads on stuffing bits</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section17" aria-hidden="true"> <label for="collapse-section17" aria-hidden="true">V1.0.1 / 31-August-2017</label>
<div>
<h2 id="main-changes-8">Main Changes</h2>
<ul>
<li>Corrections for ES_WIFI WiFi component.</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section16" aria-hidden="true"> <label for="collapse-section16" aria-hidden="true">V1.0.0 / 23-February-2017</label>
<div>
<h2 id="main-changes-9">Main Changes</h2>
<ul>
<li>First official release of ES_WIFI WiFi component.</li>
</ul>
</div>
</div>
</div>
</div>
<footer class="sticky">
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <a href="http://www.st.com/STM32">http://www.st.com/STM32</a>
</footer>
</body>
</html>
@@ -0,0 +1,31 @@
# Report potential product security vulnerabilities
ST places a high priority on security, and our Product Security Incident
Response Team (PSIRT) is committed to rapidly addressing potential security
vulnerabilities affecting our products. PSIRT's long history and vast experience
in security allows ST to perform clear analyses and provide appropriate guidance
on mitigations and solutions when applicable.
If you wish to report potential security vulnerabilities regarding our products,
**please do not report them through public GitHub issues.** Instead, we
encourage you to report them to our ST PSIRT following the process described at:
**https://www.st.com/content/st_com/en/security/report-vulnerabilities.html**
### IMPORTANT - READ CAREFULLY:
STMicroelectronics International N.V., on behalf of itself, its affiliates and
subsidiaries, (collectively “ST”) takes all potential security vulnerability
reports or other related communications (“Report(s)”) seriously. In order to
review Your Report (the terms “You” and “Yours” include your employer, and all
affiliates, subsidiaries and related persons or entities) and take actions as
deemed appropriate, ST requires that we have the rights and Your permission to
do so.
As such, by submitting Your Report to ST, You agree that You have the right to
do so, and You grant to ST the rights to use the Report for purposes related to
security vulnerability analysis, testing, correction, patching, reporting and
any other related purpose or function.
By submitting Your Report, You agree that STs
[Privacy Policy](https://www.st.com/content/st_com/en/common/privacy-portal.html)
applies to all related communications.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,359 @@
/**
******************************************************************************
* @file es_wifi.h
* @author MCD Application Team
* @brief header file for the es_wifi module.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef ES_WIFI_H
#define ES_WIFI_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/*cstat -MISRAC2012-Dir-4.10 */
#include "stdint.h"
#include "string.h"
#include "stdbool.h"
#include "stdio.h"
#include "es_wifi_conf.h"
/*cstat +MISRAC2012-Dir-4.10 */
/* Exported Constants --------------------------------------------------------*/
#define ES_WIFI_PAYLOAD_SIZE 1200
#define ES_WIFI_MAX_SO_TIMEOUT 30000
typedef int8_t (*IO_Init_Func)(uint16_t );
typedef int8_t (*IO_DeInit_Func)( void);
typedef void (*IO_Delay_Func)(uint32_t);
typedef int16_t (*IO_Send_Func)( uint8_t *, uint16_t len, uint32_t);
typedef int16_t (*IO_Receive_Func)(uint8_t *, uint16_t len, uint32_t);
/* Exported typedef ----------------------------------------------------------*/
typedef enum {
ES_WIFI_INIT = 0,
ES_WIFI_RESET = 1
}
ES_WIFI_InitMode_t;
typedef enum {
ES_WIFI_STATUS_OK = 0,
ES_WIFI_STATUS_REQ_DATA_STAGE = 1,
ES_WIFI_STATUS_ERROR = 2,
ES_WIFI_STATUS_TIMEOUT = 3,
ES_WIFI_STATUS_IO_ERROR = 4,
ES_WIFI_STATUS_UNEXPECTED_CLOSED_SOCKET = 5,
ES_WIFI_STATUS_MODULE_CRASH = 6
} ES_WIFI_Status_t;
#define ES_WIFI_ERROR_SPI_FAILED -1
#define ES_WIFI_ERROR_WAITING_DRDY_RISING -2
#define ES_WIFI_ERROR_WAITING_DRDY_FALLING -3
#define ES_WIFI_ERROR_STUFFING_FOREVER -4
#define ES_WIFI_ERROR_SPI_INIT -5
typedef enum {
ES_WIFI_MODE_SINGLE = 0,
ES_WIFI_MODE_MULTI = 1,
} ES_WIFI_ConnMode_t;
typedef enum {
ES_WIFI_TCP_CONNECTION = 0,
ES_WIFI_UDP_CONNECTION = 1,
ES_WIFI_UDP_LITE_CONNECTION = 2,
ES_WIFI_TCP_SSL_CONNECTION = 3,
ES_WIFI_MQTT_CONNECTION = 4,
} ES_WIFI_ConnType_t;
/* Security settings for wifi network */
typedef enum {
ES_WIFI_SEC_OPEN = 0x00, /*!< Wifi is open */
ES_WIFI_SEC_WEP = 0x01, /*!< Wired Equivalent Privacy option for wifi security. \note This mode can't be used when setting up ES_WIFI wifi */
ES_WIFI_SEC_WPA = 0x02, /*!< Wi-Fi Protected Access */
ES_WIFI_SEC_WPA2 = 0x03, /*!< Wi-Fi Protected Access 2 */
ES_WIFI_SEC_WPA_WPA2= 0x04, /*!< Wi-Fi Protected Access with both modes */
ES_WIFI_SEC_WPA2_TKIP= 0x05, /*!< Wi-Fi Protected Access with both modes */
ES_WIFI_SEC_UNKNOWN = 0xFF, /*!< Wi-Fi Unknown Security mode */
} ES_WIFI_SecurityType_t;
typedef enum {
ES_WIFI_IPV4 = 0x00,
ES_WIFI_IPV6 = 0x01,
} ES_WIFI_IPVer_t;
typedef enum {
ES_WIFI_AP_NONE = 0x00,
ES_WIFI_AP_ASSIGNED = 0x01,
ES_WIFI_AP_JOINED = 0x02,
ES_WIFI_AP_ERROR = 0xFF,
} ES_WIFI_APState_t;
typedef enum {
ES_WIFI_FUNCTION_TLS = 0x00,
ES_WIFI_FUNCTION_AWS = 0x01,
} ES_WIFI_CredsFunction_t;
typedef enum {
ES_WIFI_TLS_CHECK_NOTHING = 0x00,
ES_WIFI_TLS_CHECK_ROOTCA = 0x01,
ES_WIFI_TLS_CHECK_DEVICE_CERTS = 0x02
} ES_WIFI_TlsCheckCertificatMode_t;
#define ES_WIFI_TLS_MULTIPLE_WRITE_SLOT 3
typedef struct
{
uint32_t Port;
uint32_t BaudRate;
uint32_t DataWidth;
uint32_t Parity;
uint32_t StopBits;
uint32_t Mode;
} ES_WIFI_UARTConfig_t;
typedef struct
{
uint32_t Configuration;
uint32_t WPSPin;
uint32_t VID;
uint32_t PID;
uint8_t MAC[6];
uint8_t AP_IPAddress[4];
uint32_t PS_Mode;
uint32_t RadioMode;
uint32_t CurrentBeacon;
uint32_t PrevBeacon;
uint32_t ProductName;
} ES_WIFI_SystemConfig_t;
typedef struct {
uint8_t* Address; /*!< Pointer to domain or IP to ping */
uint32_t Time; /*!< Time in milliseconds needed for pinging */
uint8_t Success; /*!< Status indicates if ping was successful */
} ES_WIFI_Ping_t;
typedef struct {
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Service Set Identifier value.Wi-Fi spot name */
ES_WIFI_SecurityType_t Security; /*!< Security of Wi-Fi spot. */
int16_t RSSI; /*!< Signal strength of Wi-Fi spot */
uint8_t MAC[6]; /*!< MAC address of spot */
uint8_t Channel; /*!< Wi-Fi channel */
} ES_WIFI_AP_t;
/* Access point configuration */
typedef struct {
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Network public name for ESP AP mode */
uint8_t Pass[ES_WIFI_MAX_PSWD_NAME_SIZE + 1]; /*!< Network password for ESP AP mode */
ES_WIFI_SecurityType_t Security; /*!< Security of Wi-Fi access point */
uint8_t Channel; /*!< Channel Wi-Fi is operating at */
uint8_t MaxConnections; /*!< Max number of stations that are allowed to connect to ESP AP, between 1 and 4 */
uint8_t Hidden; /*!< Set to 1 if network is hidden (not broadcast) or zero if visible */
} ES_WIFI_APConfig_t;
typedef struct {
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Network public name for ESP AP mode */
uint8_t IP_Addr[4]; /*!< IP Address */
uint8_t MAC_Addr[6]; /*!< MAC address */
} ES_WIFI_APSettings_t;
typedef struct {
ES_WIFI_AP_t AP[ES_WIFI_MAX_DETECTED_AP];
uint8_t nbr;
} ES_WIFI_APs_t;
typedef struct {
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1];
uint8_t pswd[ES_WIFI_MAX_PSWD_NAME_SIZE + 1];
ES_WIFI_SecurityType_t Security;
uint8_t DHCP_IsEnabled;
uint8_t JoinRetries;
uint8_t IsConnected;
uint8_t AutoConnect;
ES_WIFI_IPVer_t IP_Ver;
uint8_t IP_Addr[4];
uint8_t IP_Mask[4];
uint8_t Gateway_Addr[4];
uint8_t DNS1[4];
uint8_t DNS2[4];
} ES_WIFI_Network_t;
typedef struct {
ES_WIFI_ConnType_t Protocol;
uint8_t Local_IP_Addr[4];
uint16_t Local_Port;
uint8_t Remote_IP_Addr[4];
uint16_t Remote_Port;
uint8_t TCP_Server;
uint8_t UDP_Server;
uint8_t TCP_Backlogs;
uint8_t Accept_Loop;
uint8_t Read_Mode;
} ES_WIFI_Transport_t;
#if (ES_WIFI_USE_AWS == 1)
typedef struct {
ES_WIFI_ConnType_t Type;
uint8_t Number;
uint16_t RemotePort;
uint8_t RemoteIP[4];
uint8_t *PublishTopic;
uint8_t *SubscribeTopic;
uint8_t *ClientID;
uint8_t MQTTMode;
} ES_WIFI_AWS_Conn_t;
#endif
typedef struct {
ES_WIFI_ConnType_t Type;
ES_WIFI_TlsCheckCertificatMode_t TLScheckMode;
uint8_t Number;
uint16_t RemotePort;
uint16_t LocalPort;
uint8_t RemoteIP[4];
char* Name;
uint8_t Backlog;
} ES_WIFI_Conn_t;
typedef struct {
IO_Init_Func IO_Init;
IO_DeInit_Func IO_DeInit;
IO_Delay_Func IO_Delay;
IO_Send_Func IO_Send;
IO_Receive_Func IO_Receive;
} ES_WIFI_IO_t;
typedef struct {
uint8_t Product_ID[ES_WIFI_PRODUCT_ID_SIZE];
uint8_t FW_Rev[ES_WIFI_FW_REV_SIZE];
uint8_t API_Rev[ES_WIFI_API_REV_SIZE];
uint8_t Stack_Rev[ES_WIFI_STACK_REV_SIZE];
uint8_t RTOS_Rev[ES_WIFI_RTOS_REV_SIZE];
uint8_t Product_Name[ES_WIFI_PRODUCT_NAME_SIZE];
uint32_t CPU_Clock;
ES_WIFI_SecurityType_t Security;
ES_WIFI_Network_t NetSettings;
ES_WIFI_APSettings_t APSettings;
ES_WIFI_IO_t fops;
uint8_t CmdData[ES_WIFI_DATA_SIZE];
uint32_t Timeout;
uint32_t BufferSize;
} ES_WIFIObject_t;
/* Exported functions --------------------------------------------------------*/
ES_WIFI_Status_t ES_WIFI_Init(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_DeInit(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_SetTimeout(ES_WIFIObject_t *Obj, uint32_t Timeout);
ES_WIFI_Status_t ES_WIFI_ListAccessPoints(ES_WIFIObject_t *Obj, ES_WIFI_APs_t *APs);
ES_WIFI_Status_t ES_WIFI_Connect(ES_WIFIObject_t *Obj, const char* SSID, const char* Password,
ES_WIFI_SecurityType_t SecType);
ES_WIFI_Status_t ES_WIFI_Disconnect(ES_WIFIObject_t *Obj);
uint8_t ES_WIFI_IsConnected(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_GetNetworkSettings(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_GetMACAddress(ES_WIFIObject_t *Obj, uint8_t *mac);
ES_WIFI_Status_t ES_WIFI_GetIPAddress(ES_WIFIObject_t *Obj, uint8_t *ipaddr);
ES_WIFI_Status_t ES_WIFI_GetProductID(ES_WIFIObject_t *Obj, uint8_t *productID);
ES_WIFI_Status_t ES_WIFI_GetFWRevID(ES_WIFIObject_t *Obj, uint8_t *FWRev);
ES_WIFI_Status_t ES_WIFI_GetRTOSRev(ES_WIFIObject_t *Obj, uint8_t *RTOSRev);
ES_WIFI_Status_t ES_WIFI_GetProductName(ES_WIFIObject_t *Obj, uint8_t *productName);
ES_WIFI_Status_t ES_WIFI_GetAPIRev(ES_WIFIObject_t *Obj, uint8_t *APIRev);
ES_WIFI_Status_t ES_WIFI_GetStackRev(ES_WIFIObject_t *Obj, uint8_t *StackRev);
ES_WIFI_Status_t ES_WIFI_SetMACAddress(ES_WIFIObject_t *Obj, uint8_t *mac);
ES_WIFI_Status_t ES_WIFI_ResetToFactoryDefault(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_ResetModule(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_HardResetModule(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_SetProductName(ES_WIFIObject_t *Obj, uint8_t *ProductName);
#if (ES_WIFI_USE_PING == 1)
ES_WIFI_Status_t ES_WIFI_Ping(ES_WIFIObject_t *Obj, uint8_t *address, uint16_t count, uint16_t interval_ms, int32_t res[]);
#endif
ES_WIFI_Status_t ES_WIFI_DNS_LookUp(ES_WIFIObject_t *Obj, const char *url, uint8_t *ipaddress);
ES_WIFI_Status_t ES_WIFI_StartClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
ES_WIFI_Status_t ES_WIFI_StopClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
#if (ES_WIFI_USE_AWS == 1)
ES_WIFI_Status_t ES_WIFI_StartAWSClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_AWS_Conn_t *conn);
#endif
ES_WIFI_Status_t ES_WIFI_StartServerSingleConn(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
ES_WIFI_Status_t ES_WIFI_WaitServerConnection(ES_WIFIObject_t *Obj,uint32_t Timeout,ES_WIFI_Conn_t *con);
ES_WIFI_Status_t ES_WIFI_CloseServerConnection(ES_WIFIObject_t *Obj,int socket);
ES_WIFI_Status_t ES_WIFI_StopServerSingleConn(ES_WIFIObject_t *Obj, int socket);
ES_WIFI_Status_t ES_WIFI_StartServerMultiConn(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
ES_WIFI_Status_t ES_WIFI_StopServerMultiConn(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_SendData(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen , uint16_t *SentLen, uint32_t Timeout);
ES_WIFI_Status_t ES_WIFI_SendDataTo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen , uint16_t *SentLen, uint32_t Timeout, uint8_t *IPaddr, uint16_t Port);
ES_WIFI_Status_t ES_WIFI_ReceiveData(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen, uint16_t *Receivedlen, uint32_t Timeout);
ES_WIFI_Status_t ES_WIFI_ReceiveDataFrom(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen, uint16_t *Receivedlen, uint32_t Timeout, uint8_t *IPaddr, uint16_t *pPort);
ES_WIFI_Status_t ES_WIFI_ActivateAP(ES_WIFIObject_t *Obj, ES_WIFI_APConfig_t *ApConfig);
ES_WIFI_APState_t ES_WIFI_WaitAPStateChange(ES_WIFIObject_t *Obj);
ES_WIFI_Status_t ES_WIFI_PeerInfo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *IPaddr, uint16_t *pPort);
ES_WIFI_Status_t ES_WIFI_SockInfo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *IPaddr, uint16_t *pPort);
#if (ES_WIFI_USE_FIRMWAREUPDATE == 1)
ES_WIFI_Status_t ES_WIFI_OTA_Upgrade(ES_WIFIObject_t *Obj, uint8_t *link);
#endif
#if (ES_WIFI_USE_UART == 1)
ES_WIFI_Status_t ES_WIFI_SetUARTBaudRate(ES_WIFIObject_t *Obj, uint16_t BaudRate);
ES_WIFI_Status_t ES_WIFI_GetUARTConfig(ES_WIFIObject_t *Obj, ES_WIFI_UARTConfig_t *pconf);
#endif
ES_WIFI_Status_t ES_WIFI_GetSystemConfig(ES_WIFIObject_t *Obj, ES_WIFI_SystemConfig_t *pconf);
ES_WIFI_Status_t ES_WIFI_RegisterBusIO(ES_WIFIObject_t *Obj, IO_Init_Func IO_Init,
IO_DeInit_Func IO_DeInit,
IO_Delay_Func IO_Delay,
IO_Send_Func IO_Send,
IO_Receive_Func IO_Receive);
ES_WIFI_Status_t ES_WIFI_StoreCreds( ES_WIFIObject_t *Obj,
ES_WIFI_CredsFunction_t credsFunction, uint8_t credSet,
uint8_t* ca, uint16_t caLength,
uint8_t* certificate, uint16_t certificateLength,
uint8_t* key, uint16_t keyLength );
ES_WIFI_Status_t ES_WIFI_StoreCA( ES_WIFIObject_t *Obj,
ES_WIFI_CredsFunction_t credsFunction,
uint8_t credSet,
uint8_t* ca,
uint16_t caLength );
ES_WIFI_Status_t ES_WIFI_StoreCertificate( ES_WIFIObject_t *Obj,
ES_WIFI_CredsFunction_t credsFunction,
uint8_t credSet,
uint8_t* certificate,
uint16_t certificateLength );
ES_WIFI_Status_t ES_WIFI_StoreKey( ES_WIFIObject_t *Obj,
ES_WIFI_CredsFunction_t credsFunction,
uint8_t credSet,
uint8_t* key,
uint16_t keyLength );
#ifdef __cplusplus
}
#endif
#endif /* ES_WIFI_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
@@ -0,0 +1,91 @@
/**
******************************************************************************
* @file es_wifi_conf.h
* @author MCD Application Team
* @brief ES_WIFI configuration.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef ES_WIFI_CONF_H
#define ES_WIFI_CONF_H
#ifdef __cplusplus
extern "C" {
#endif
//#define WIFI_USE_CMSIS_OS
#ifdef WIFI_USE_CMSIS_OS
#include "cmsis_os.h"
extern osMutexId es_wifi_mutex;
#define LOCK_SPI() osMutexWait(spi_mutex, 0)
#define UNLOCK_SPI() osMutexRelease(spi_mutex)
#define LOCK_WIFI() osMutexWait(es_wifi_mutex, 0)
#define UNLOCK_WIFI() osMutexRelease(es_wifi_mutex)
#define SEM_SIGNAL(a) osSemaphoreRelease(a)
#define SEM_WAIT(a,timeout) osSemaphoreWait(a,timeout)
#else /* WIFI_USE_CMSIS_OS */
#define LOCK_SPI()
#define LOCK_WIFI()
#define UNLOCK_SPI()
#define UNLOCK_WIFI()
#define SEM_SIGNAL(a)
#endif /* WIFI_USE_CMSIS_OS */
#define ES_WIFI_MAX_SSID_NAME_SIZE 32
#define ES_WIFI_MAX_PSWD_NAME_SIZE 32
#define ES_WIFI_PRODUCT_ID_SIZE 32
#define ES_WIFI_PRODUCT_NAME_SIZE 32
#define ES_WIFI_FW_REV_SIZE 24
#define ES_WIFI_API_REV_SIZE 16
#define ES_WIFI_STACK_REV_SIZE 16
#define ES_WIFI_RTOS_REV_SIZE 16
#define ES_WIFI_DATA_SIZE 1400
#define ES_WIFI_MAX_DETECTED_AP 10
#define ES_WIFI_TIMEOUT 0xFFFF
#define ES_WIFI_USE_PING 1
#define ES_WIFI_USE_AWS 0
#define ES_WIFI_USE_FIRMWAREUPDATE 0
#define ES_WIFI_USE_WPS 0
#define ES_WIFI_USE_SPI 0
#define ES_WIFI_USE_UART (!ES_WIFI_USE_SPI)
/* Definitions of Country codes for "CN" AT command */
/* Allows to change WiFi channels range */
#define ES_WIFI_COUNTRY_FR "FR/0" /* allows WiFi channels 1-13 */
#define ES_WIFI_COUNTRY_JP "JP/0" /* allows WiFi channels 1-14 (channel 14 low power) */
#define ES_WIFI_COUNTRY_CA "CA/0" /* allows WiFi channels 1-12 (channel 12 low power) */
#define ES_WIFI_COUNTRY_US "US/0" /* allows WiFi channels 1-11 (set by default) */
/* define ES_WIFI_COUNTRY to one of ES_WIFI_COUNTRY_FR, ES_WIFI_COUNTRY_JP, ... */
/* define it only if country is not US (US is the default setting) */
/* #define ES_WIFI_COUNTRY ES_WIFI_COUNTRY_FR */
#ifdef __cplusplus
}
#endif
#endif /* ES_WIFI_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/