@@ -921,6 +921,42 @@ int8_t WiFiDrv::wifiSetApPassphrase(const char* ssid, uint8_t ssid_len, const ch
921921 return _data;
922922}
923923
924+ int8_t WiFiDrv::wifiSetEnterprise (uint8_t eapType, const char * ssid, uint8_t ssid_len, const char *username, const uint8_t username_len, const char *password, const uint8_t password_len, const char *identity, const uint8_t identity_len, const char * ca_cert, uint16_t ca_cert_len)
925+ {
926+ WAIT_FOR_SLAVE_SELECT ();
927+ // Send Command
928+ SpiDrv::sendCmd (SET_ENT_CMD, PARAM_NUMS_6);
929+ SpiDrv::sendBuffer (&eapType, sizeof (eapType));
930+ SpiDrv::sendBuffer ((uint8_t *)ssid, ssid_len);
931+ SpiDrv::sendBuffer ((uint8_t *)username, username_len);
932+ SpiDrv::sendBuffer ((uint8_t *)password, password_len);
933+ SpiDrv::sendBuffer ((uint8_t *)identity, identity_len);
934+ SpiDrv::sendBuffer ((uint8_t *)ca_cert, ca_cert_len, LAST_PARAM);
935+
936+ // pad to multiple of 4
937+ int commandSize = 15 + sizeof (eapType) + ssid_len + username_len + password_len + identity_len + ca_cert_len;
938+ while (commandSize % 4 ) {
939+ SpiDrv::readChar ();
940+ commandSize++;
941+ }
942+
943+ SpiDrv::spiSlaveDeselect ();
944+ // Wait the reply elaboration
945+ SpiDrv::waitForSlaveReady ();
946+ SpiDrv::spiSlaveSelect ();
947+
948+ // Wait for reply
949+ uint8_t _data = 0 ;
950+ uint8_t _dataLen = 0 ;
951+ if (!SpiDrv::waitResponseCmd (SET_ENT_CMD, PARAM_NUMS_1, &_data, &_dataLen))
952+ {
953+ WARN (" error waitResponse" );
954+ _data = WL_FAILURE;
955+ }
956+ SpiDrv::spiSlaveDeselect ();
957+ return _data;
958+ }
959+
924960int16_t WiFiDrv::ping (uint32_t ipAddress, uint8_t ttl)
925961{
926962 WAIT_FOR_SLAVE_SELECT ();
0 commit comments