1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Added function to get firmware version

This commit is contained in:
Mimmo La Fauci
2012-06-08 18:56:47 +02:00
parent 6ab79f0536
commit 6f27863ae5
6 changed files with 52 additions and 5 deletions

View File

@ -26,6 +26,8 @@ uint8_t WiFiDrv::_mac[] = {0};
uint8_t WiFiDrv::_localIp[] = {0};
uint8_t WiFiDrv::_subnetMask[] = {0};
uint8_t WiFiDrv::_gatewayIp[] = {0};
// Firmware version
char WiFiDrv::fwVersion[] = {0};
// Private Methods
@ -467,4 +469,23 @@ int WiFiDrv::getHostByName(const char* aHostname, IPAddress& aResult)
return (retry>0);
}
char* WiFiDrv::getFwVersion()
{
WAIT_FOR_SLAVE_SELECT();
// Send Command
SpiDrv::sendCmd(GET_FW_VERSION_CMD, PARAM_NUMS_0);
//Wait the reply elaboration
SpiDrv::waitForSlaveReady();
// Wait for reply
uint8_t _dataLen = 0;
if (!SpiDrv::waitResponseCmd(GET_FW_VERSION_CMD, PARAM_NUMS_1, (uint8_t*)fwVersion, &_dataLen))
{
WARN("error waitResponse");
}
SpiDrv::spiSlaveDeselect();
return fwVersion;
}
WiFiDrv wiFiDrv;