mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-20 21:01:25 +03:00
WiFi libraries: fix compiler warning
This commit is contained in:
@ -46,6 +46,7 @@ int WiFiClass::begin()
|
|||||||
{
|
{
|
||||||
// Add procedure to read the latest configuration from eeprom/dataflash
|
// Add procedure to read the latest configuration from eeprom/dataflash
|
||||||
// and start the wifi connection
|
// and start the wifi connection
|
||||||
|
return WL_IDLE_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WiFiClass::begin(char* ssid)
|
int WiFiClass::begin(char* ssid)
|
||||||
|
@ -36,6 +36,7 @@ int WiFiClient::connect(const char* host, uint16_t port) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WiFiClient::connect(IPAddress ip, uint16_t port) {
|
int WiFiClient::connect(IPAddress ip, uint16_t port) {
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "socket.h"
|
#include "socket.h"
|
||||||
|
|
||||||
SOCKET socket(uint8 protocol) {} // Opens a socket(TCP or UDP or IP_RAW mode)
|
SOCKET socket(uint8 protocol) {return 0;} // Opens a socket(TCP or UDP or IP_RAW mode)
|
||||||
void close(SOCKET s) {} // Close socket
|
void close(SOCKET s) {} // Close socket
|
||||||
uint8 connect(SOCKET s, uint8 * addr, uint16 port) {} // Establish TCP connection (Active connection)
|
uint8 connect(SOCKET s, uint8 * addr, uint16 port) {return 0;} // Establish TCP connection (Active connection)
|
||||||
void disconnect(SOCKET s) {} // disconnect the connection
|
void disconnect(SOCKET s) {} // disconnect the connection
|
||||||
uint8 listen(SOCKET s) {} // Establish TCP connection (Passive connection)
|
uint8 listen(SOCKET s) { return 0;} // Establish TCP connection (Passive connection)
|
||||||
uint16 send(SOCKET s, const uint8 * buf, uint16 len) {} // Send data (TCP)
|
uint16 send(SOCKET s, const uint8 * buf, uint16 len) { return 0;} // Send data (TCP)
|
||||||
uint16 recv(SOCKET s, uint8 * buf, uint16 len) {} // Receive data (TCP)
|
uint16 recv(SOCKET s, uint8 * buf, uint16 len) {return 0;} // Receive data (TCP)
|
||||||
uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port) {} // Send data (UDP/IP RAW)
|
uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port) {return 0;} // Send data (UDP/IP RAW)
|
||||||
uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16 *port) {} // Receive data (UDP/IP RAW)
|
uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16 *port) {return 0;} // Receive data (UDP/IP RAW)
|
||||||
|
|
||||||
uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len) {}
|
uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len) {return 0;}
|
||||||
|
@ -181,7 +181,7 @@ void SpiDrv::getParam(uint8_t* param)
|
|||||||
int SpiDrv::waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t* param, uint8_t* param_len)
|
int SpiDrv::waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t* param, uint8_t* param_len)
|
||||||
{
|
{
|
||||||
char _data = 0;
|
char _data = 0;
|
||||||
int i =0, ii = 0;
|
int ii = 0;
|
||||||
|
|
||||||
IF_CHECK_START_CMD(_data)
|
IF_CHECK_START_CMD(_data)
|
||||||
{
|
{
|
||||||
@ -233,7 +233,7 @@ int SpiDrv::waitResponse(uint8_t cmd, uint8_t numParam, uint8_t* param, uint16_t
|
|||||||
int SpiDrv::waitResponseData16(uint8_t cmd, uint8_t* param, uint16_t* param_len)
|
int SpiDrv::waitResponseData16(uint8_t cmd, uint8_t* param, uint16_t* param_len)
|
||||||
{
|
{
|
||||||
char _data = 0;
|
char _data = 0;
|
||||||
int i =0, ii = 0;
|
uint16_t ii = 0;
|
||||||
|
|
||||||
IF_CHECK_START_CMD(_data)
|
IF_CHECK_START_CMD(_data)
|
||||||
{
|
{
|
||||||
@ -259,7 +259,7 @@ int SpiDrv::waitResponseData16(uint8_t cmd, uint8_t* param, uint16_t* param_len)
|
|||||||
int SpiDrv::waitResponseData8(uint8_t cmd, uint8_t* param, uint8_t* param_len)
|
int SpiDrv::waitResponseData8(uint8_t cmd, uint8_t* param, uint8_t* param_len)
|
||||||
{
|
{
|
||||||
char _data = 0;
|
char _data = 0;
|
||||||
int i =0, ii = 0;
|
int ii = 0;
|
||||||
|
|
||||||
IF_CHECK_START_CMD(_data)
|
IF_CHECK_START_CMD(_data)
|
||||||
{
|
{
|
||||||
@ -464,7 +464,7 @@ uint16_t SpiDrv::readParamLen16(uint16_t* param_len)
|
|||||||
|
|
||||||
void SpiDrv::sendBuffer(uint8_t* param, uint16_t param_len, uint8_t lastParam)
|
void SpiDrv::sendBuffer(uint8_t* param, uint16_t param_len, uint8_t lastParam)
|
||||||
{
|
{
|
||||||
int i = 0;
|
uint16_t i = 0;
|
||||||
|
|
||||||
// Send Spi paramLen
|
// Send Spi paramLen
|
||||||
sendParamLen16(param_len);
|
sendParamLen16(param_len);
|
||||||
@ -483,7 +483,6 @@ void SpiDrv::sendBuffer(uint8_t* param, uint16_t param_len, uint8_t lastParam)
|
|||||||
|
|
||||||
void SpiDrv::sendParam(uint16_t param, uint8_t lastParam)
|
void SpiDrv::sendParam(uint16_t param, uint8_t lastParam)
|
||||||
{
|
{
|
||||||
int i = 0;
|
|
||||||
// Send Spi paramLen
|
// Send Spi paramLen
|
||||||
sendParamLen8(2);
|
sendParamLen8(2);
|
||||||
|
|
||||||
|
@ -41,8 +41,6 @@ void WiFiDrv::getNetworkData(uint8_t *ip, uint8_t *mask, uint8_t *gwip)
|
|||||||
SpiDrv::waitForSlaveReady();
|
SpiDrv::waitForSlaveReady();
|
||||||
|
|
||||||
// Wait for reply
|
// Wait for reply
|
||||||
uint8_t _data = 0;
|
|
||||||
uint8_t _dataLen = 0;
|
|
||||||
SpiDrv::waitResponseParams(GET_IPADDR_CMD, PARAM_NUMS_3, params);
|
SpiDrv::waitResponseParams(GET_IPADDR_CMD, PARAM_NUMS_3, params);
|
||||||
|
|
||||||
SpiDrv::spiSlaveDeselect();
|
SpiDrv::spiSlaveDeselect();
|
||||||
@ -182,7 +180,7 @@ uint8_t* WiFiDrv::getMacAddress()
|
|||||||
|
|
||||||
// Wait for reply
|
// Wait for reply
|
||||||
uint8_t _dataLen = 0;
|
uint8_t _dataLen = 0;
|
||||||
uint8_t result = SpiDrv::waitResponseCmd(GET_MACADDR_CMD, PARAM_NUMS_1, _mac, &_dataLen);
|
SpiDrv::waitResponseCmd(GET_MACADDR_CMD, PARAM_NUMS_1, _mac, &_dataLen);
|
||||||
|
|
||||||
SpiDrv::spiSlaveDeselect();
|
SpiDrv::spiSlaveDeselect();
|
||||||
|
|
||||||
@ -200,14 +198,12 @@ void WiFiDrv::getIpAddress(IPAddress& ip)
|
|||||||
{
|
{
|
||||||
getNetworkData(_localIp, _subnetMask, _gatewayIp);
|
getNetworkData(_localIp, _subnetMask, _gatewayIp);
|
||||||
ip = _subnetMask;
|
ip = _subnetMask;
|
||||||
//memcpy(ip, _subnetMask, WL_IPV4_LENGTH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WiFiDrv::getGatewayIP(IPAddress& ip)
|
void WiFiDrv::getGatewayIP(IPAddress& ip)
|
||||||
{
|
{
|
||||||
getNetworkData(_localIp, _subnetMask, _gatewayIp);
|
getNetworkData(_localIp, _subnetMask, _gatewayIp);
|
||||||
ip = _gatewayIp;
|
ip = _gatewayIp;
|
||||||
//memcpy(ip, _gatewayIp, WL_IPV4_LENGTH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char* WiFiDrv::getCurrentSSID()
|
char* WiFiDrv::getCurrentSSID()
|
||||||
@ -225,7 +221,7 @@ char* WiFiDrv::getCurrentSSID()
|
|||||||
|
|
||||||
// Wait for reply
|
// Wait for reply
|
||||||
uint8_t _dataLen = 0;
|
uint8_t _dataLen = 0;
|
||||||
uint8_t result = SpiDrv::waitResponseCmd(GET_CURR_SSID_CMD, PARAM_NUMS_1, (uint8_t*)_ssid, &_dataLen);
|
SpiDrv::waitResponseCmd(GET_CURR_SSID_CMD, PARAM_NUMS_1, (uint8_t*)_ssid, &_dataLen);
|
||||||
|
|
||||||
SpiDrv::spiSlaveDeselect();
|
SpiDrv::spiSlaveDeselect();
|
||||||
|
|
||||||
@ -247,7 +243,7 @@ uint8_t* WiFiDrv::getCurrentBSSID()
|
|||||||
|
|
||||||
// Wait for reply
|
// Wait for reply
|
||||||
uint8_t _dataLen = 0;
|
uint8_t _dataLen = 0;
|
||||||
uint8_t result = SpiDrv::waitResponseCmd(GET_CURR_BSSID_CMD, PARAM_NUMS_1, _bssid, &_dataLen);
|
SpiDrv::waitResponseCmd(GET_CURR_BSSID_CMD, PARAM_NUMS_1, _bssid, &_dataLen);
|
||||||
|
|
||||||
SpiDrv::spiSlaveDeselect();
|
SpiDrv::spiSlaveDeselect();
|
||||||
|
|
||||||
@ -270,7 +266,7 @@ int32_t WiFiDrv::getCurrentRSSI()
|
|||||||
// Wait for reply
|
// Wait for reply
|
||||||
uint8_t _dataLen = 0;
|
uint8_t _dataLen = 0;
|
||||||
int32_t rssi = 0;
|
int32_t rssi = 0;
|
||||||
uint8_t result = SpiDrv::waitResponseCmd(GET_CURR_RSSI_CMD, PARAM_NUMS_1, (uint8_t*)&rssi, &_dataLen);
|
SpiDrv::waitResponseCmd(GET_CURR_RSSI_CMD, PARAM_NUMS_1, (uint8_t*)&rssi, &_dataLen);
|
||||||
|
|
||||||
SpiDrv::spiSlaveDeselect();
|
SpiDrv::spiSlaveDeselect();
|
||||||
|
|
||||||
@ -293,7 +289,7 @@ uint8_t WiFiDrv::getCurrentEncryptionType()
|
|||||||
// Wait for reply
|
// Wait for reply
|
||||||
uint8_t dataLen = 0;
|
uint8_t dataLen = 0;
|
||||||
uint8_t encType = 0;
|
uint8_t encType = 0;
|
||||||
uint8_t result = SpiDrv::waitResponseCmd(GET_CURR_ENCT_CMD, PARAM_NUMS_1, (uint8_t*)encType, &dataLen);
|
SpiDrv::waitResponseCmd(GET_CURR_ENCT_CMD, PARAM_NUMS_1, (uint8_t*)encType, &dataLen);
|
||||||
|
|
||||||
SpiDrv::spiSlaveDeselect();
|
SpiDrv::spiSlaveDeselect();
|
||||||
|
|
||||||
@ -314,12 +310,8 @@ uint8_t WiFiDrv::scanNetworks()
|
|||||||
SpiDrv::waitForSlaveReady();
|
SpiDrv::waitForSlaveReady();
|
||||||
|
|
||||||
// Wait for reply
|
// Wait for reply
|
||||||
uint16_t _dataLen = 0;
|
|
||||||
|
|
||||||
tParam params[WL_NETWORKS_LIST_MAXNUM];
|
|
||||||
|
|
||||||
uint8_t ssidListNum = 0;
|
uint8_t ssidListNum = 0;
|
||||||
uint8_t result = SpiDrv::waitResponse(SCAN_NETWORKS, &ssidListNum, (uint8_t**)_networkSsid, WL_NETWORKS_LIST_MAXNUM);
|
SpiDrv::waitResponse(SCAN_NETWORKS, &ssidListNum, (uint8_t**)_networkSsid, WL_NETWORKS_LIST_MAXNUM);
|
||||||
|
|
||||||
SpiDrv::spiSlaveDeselect();
|
SpiDrv::spiSlaveDeselect();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user