Arduino  1.8.10
WiFiDrv クラス

#include <wifi_drv.h>

静的公開メンバ関数

static void wifiDriverInit ()
 
static int8_t wifiSetNetwork (char *ssid, uint8_t ssid_len)
 
static int8_t wifiSetPassphrase (char *ssid, uint8_t ssid_len, const char *passphrase, const uint8_t len)
 
static int8_t wifiSetKey (char *ssid, uint8_t ssid_len, uint8_t key_idx, const void *key, const uint8_t len)
 
static void config (uint8_t validParams, uint32_t local_ip, uint32_t gateway, uint32_t subnet)
 
static void setDNS (uint8_t validParams, uint32_t dns_server1, uint32_t dns_server2)
 
static int8_t disconnect ()
 
static uint8_t getConnectionStatus ()
 
static uint8_t * getMacAddress ()
 
static void getIpAddress (IPAddress &ip)
 
static void getSubnetMask (IPAddress &mask)
 
static void getGatewayIP (IPAddress &ip)
 
static char * getCurrentSSID ()
 
static uint8_t * getCurrentBSSID ()
 
static int32_t getCurrentRSSI ()
 
static uint8_t getCurrentEncryptionType ()
 
static int8_t startScanNetworks ()
 
static uint8_t getScanNetworks ()
 
static char * getSSIDNetoworks (uint8_t networkItem)
 
static int32_t getRSSINetoworks (uint8_t networkItem)
 
static uint8_t getEncTypeNetowrks (uint8_t networkItem)
 
static int getHostByName (const char *aHostname, IPAddress &aResult)
 
static char * getFwVersion ()
 

フレンド

class WiFiUDP
 

詳解

wifi_drv.h35 行目に定義があります。

関数詳解

◆ config()

void WiFiDrv::config ( uint8_t  validParams,
uint32_t  local_ip,
uint32_t  gateway,
uint32_t  subnet 
)
static

wifi_drv.cpp174 行目に定義があります。

175 {
177  // Send Command
179  SpiDrv::sendParam((uint8_t*)&validParams, 1, NO_LAST_PARAM);
180  SpiDrv::sendParam((uint8_t*)&local_ip, 4, NO_LAST_PARAM);
181  SpiDrv::sendParam((uint8_t*)&gateway, 4, NO_LAST_PARAM);
182  SpiDrv::sendParam((uint8_t*)&subnet, 4, LAST_PARAM);
183 
184  //Wait the reply elaboration
186 
187  // Wait for reply
188  uint8_t _data = 0;
189  uint8_t _dataLen = 0;
190  if (!SpiDrv::waitResponseCmd(SET_IP_CONFIG_CMD, PARAM_NUMS_1, &_data, &_dataLen))
191  {
192  WARN("error waitResponse");
193  _data = WL_FAILURE;
194  }
196 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define WARN(msg, args...)
Definition: debug.h:140
#define NO_LAST_PARAM
Definition: spi_drv.h:28
#define LAST_PARAM
Definition: spi_drv.h:29
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
#define local_ip
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ disconnect()

int8_t WiFiDrv::disconnect ( )
static

wifi_drv.cpp223 行目に定義があります。

224 {
226  // Send Command
228 
229  uint8_t _dummy = DUMMY_DATA;
230  SpiDrv::sendParam(&_dummy, 1, LAST_PARAM);
231 
232  //Wait the reply elaboration
234 
235  // Wait for reply
236  uint8_t _data = 0;
237  uint8_t _dataLen = 0;
238  int8_t result = SpiDrv::waitResponseCmd(DISCONNECT_CMD, PARAM_NUMS_1, &_data, &_dataLen);
239 
241 
242  return result;
243 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define LAST_PARAM
Definition: spi_drv.h:29
#define DUMMY_DATA
Definition: ard_spi.h:46
int result
Definition: ard_spi.c:174
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ getConnectionStatus()

uint8_t WiFiDrv::getConnectionStatus ( )
static

wifi_drv.cpp245 行目に定義があります。

246 {
248 
249  // Send Command
251 
252  //Wait the reply elaboration
254 
255  // Wait for reply
256  uint8_t _data = -1;
257  uint8_t _dataLen = 0;
259 
261 
262  return _data;
263 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151

◆ getCurrentBSSID()

uint8_t * WiFiDrv::getCurrentBSSID ( )
static

wifi_drv.cpp327 行目に定義があります。

328 {
330 
331  // Send Command
333 
334  uint8_t _dummy = DUMMY_DATA;
335  SpiDrv::sendParam(&_dummy, 1, LAST_PARAM);
336 
337  //Wait the reply elaboration
339 
340  // Wait for reply
341  uint8_t _dataLen = 0;
343 
345 
346  return _bssid;
347 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define LAST_PARAM
Definition: spi_drv.h:29
#define DUMMY_DATA
Definition: ard_spi.h:46
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ getCurrentEncryptionType()

uint8_t WiFiDrv::getCurrentEncryptionType ( )
static

wifi_drv.cpp372 行目に定義があります。

373 {
375 
376  // Send Command
378 
379  uint8_t _dummy = DUMMY_DATA;
380  SpiDrv::sendParam(&_dummy, 1, LAST_PARAM);
381 
382  //Wait the reply elaboration
384 
385  // Wait for reply
386  uint8_t dataLen = 0;
387  uint8_t encType = 0;
388  SpiDrv::waitResponseCmd(GET_CURR_ENCT_CMD, PARAM_NUMS_1, (uint8_t*)&encType, &dataLen);
389 
391 
392  return encType;
393 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define LAST_PARAM
Definition: spi_drv.h:29
#define DUMMY_DATA
Definition: ard_spi.h:46
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ getCurrentRSSI()

int32_t WiFiDrv::getCurrentRSSI ( )
static

wifi_drv.cpp349 行目に定義があります。

350 {
352 
353  // Send Command
355 
356  uint8_t _dummy = DUMMY_DATA;
357  SpiDrv::sendParam(&_dummy, 1, LAST_PARAM);
358 
359  //Wait the reply elaboration
361 
362  // Wait for reply
363  uint8_t _dataLen = 0;
364  int32_t rssi = 0;
365  SpiDrv::waitResponseCmd(GET_CURR_RSSI_CMD, PARAM_NUMS_1, (uint8_t*)&rssi, &_dataLen);
366 
368 
369  return rssi;
370 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define LAST_PARAM
Definition: spi_drv.h:29
#define DUMMY_DATA
Definition: ard_spi.h:46
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ getCurrentSSID()

char * WiFiDrv::getCurrentSSID ( )
static

wifi_drv.cpp305 行目に定義があります。

306 {
308 
309  // Send Command
311 
312  uint8_t _dummy = DUMMY_DATA;
313  SpiDrv::sendParam(&_dummy, 1, LAST_PARAM);
314 
315  //Wait the reply elaboration
317 
318  // Wait for reply
319  uint8_t _dataLen = 0;
320  SpiDrv::waitResponseCmd(GET_CURR_SSID_CMD, PARAM_NUMS_1, (uint8_t*)_ssid, &_dataLen);
321 
323 
324  return _ssid;
325 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define LAST_PARAM
Definition: spi_drv.h:29
#define DUMMY_DATA
Definition: ard_spi.h:46
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ getEncTypeNetowrks()

uint8_t WiFiDrv::getEncTypeNetowrks ( uint8_t  networkItem)
static

wifi_drv.cpp448 行目に定義があります。

449 {
450  if (networkItem >= WL_NETWORKS_LIST_MAXNUM)
451  return NULL;
452 
454 
455  // Send Command
457 
458  SpiDrv::sendParam(&networkItem, 1, LAST_PARAM);
459 
460  //Wait the reply elaboration
462 
463  // Wait for reply
464  uint8_t dataLen = 0;
465  uint8_t encType = 0;
466  SpiDrv::waitResponseCmd(GET_IDX_ENCT_CMD, PARAM_NUMS_1, (uint8_t*)&encType, &dataLen);
467 
469 
470  return encType;
471 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define LAST_PARAM
Definition: spi_drv.h:29
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
#define WL_NETWORKS_LIST_MAXNUM
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382
#define NULL
Definition: def.h:44

◆ getFwVersion()

char * WiFiDrv::getFwVersion ( )
static

wifi_drv.cpp560 行目に定義があります。

561 {
563  // Send Command
565 
566  //Wait the reply elaboration
568 
569  // Wait for reply
570  uint8_t _dataLen = 0;
571  if (!SpiDrv::waitResponseCmd(GET_FW_VERSION_CMD, PARAM_NUMS_1, (uint8_t*)fwVersion, &_dataLen))
572  {
573  WARN("error waitResponse");
574  }
576  return fwVersion;
577 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define WARN(msg, args...)
Definition: debug.h:140
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
const char * fwVersion
Definition: main.c:42

◆ getGatewayIP()

void WiFiDrv::getGatewayIP ( IPAddress ip)
static

wifi_drv.cpp299 行目に定義があります。

300  {
301  getNetworkData(_localIp, _subnetMask, _gatewayIp);
302  ip = _gatewayIp;
303  }

◆ getHostByName()

int WiFiDrv::getHostByName ( const char *  aHostname,
IPAddress aResult 
)
static

wifi_drv.cpp545 行目に定義があります。

546 {
547  uint8_t retry = 10;
548  if (reqHostByName(aHostname))
549  {
550  while(!getHostByName(aResult) && --retry > 0)
551  {
552  delay(1000);
553  }
554  }else{
555  return 0;
556  }
557  return (retry>0);
558 }
void delay(unsigned long)
Definition: wiring.c:106

◆ getIpAddress()

void WiFiDrv::getIpAddress ( IPAddress ip)
static

wifi_drv.cpp287 行目に定義があります。

288 {
289  getNetworkData(_localIp, _subnetMask, _gatewayIp);
290  ip = _localIp;
291 }

◆ getMacAddress()

uint8_t * WiFiDrv::getMacAddress ( )
static

wifi_drv.cpp265 行目に定義があります。

266 {
268 
269  // Send Command
271 
272  uint8_t _dummy = DUMMY_DATA;
273  SpiDrv::sendParam(&_dummy, 1, LAST_PARAM);
274 
275  //Wait the reply elaboration
277 
278  // Wait for reply
279  uint8_t _dataLen = 0;
281 
283 
284  return _mac;
285 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define LAST_PARAM
Definition: spi_drv.h:29
#define DUMMY_DATA
Definition: ard_spi.h:46
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ getRSSINetoworks()

int32_t WiFiDrv::getRSSINetoworks ( uint8_t  networkItem)
static

wifi_drv.cpp473 行目に定義があります。

474 {
475  if (networkItem >= WL_NETWORKS_LIST_MAXNUM)
476  return NULL;
477  int32_t networkRssi = 0;
478 
480 
481  // Send Command
483 
484  SpiDrv::sendParam(&networkItem, 1, LAST_PARAM);
485 
486  //Wait the reply elaboration
488 
489  // Wait for reply
490  uint8_t dataLen = 0;
491  SpiDrv::waitResponseCmd(GET_IDX_RSSI_CMD, PARAM_NUMS_1, (uint8_t*)&networkRssi, &dataLen);
492 
494 
495  return networkRssi;
496 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define LAST_PARAM
Definition: spi_drv.h:29
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
#define WL_NETWORKS_LIST_MAXNUM
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382
#define NULL
Definition: def.h:44

◆ getScanNetworks()

uint8_t WiFiDrv::getScanNetworks ( )
static

wifi_drv.cpp421 行目に定義があります。

422 {
424 
425  // Send Command
427 
428  //Wait the reply elaboration
430 
431  // Wait for reply
432  uint8_t ssidListNum = 0;
433  SpiDrv::waitResponse(SCAN_NETWORKS, &ssidListNum, (uint8_t**)_networkSsid, WL_NETWORKS_LIST_MAXNUM);
434 
436 
437  return ssidListNum;
438 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
#define WL_NETWORKS_LIST_MAXNUM
static int waitResponse(uint8_t cmd, uint8_t *numParamRead, uint8_t **params, uint8_t maxNumParams)
Definition: spi_drv.cpp:335

◆ getSSIDNetoworks()

char * WiFiDrv::getSSIDNetoworks ( uint8_t  networkItem)
static

wifi_drv.cpp440 行目に定義があります。

441 {
442  if (networkItem >= WL_NETWORKS_LIST_MAXNUM)
443  return NULL;
444 
445  return _networkSsid[networkItem];
446 }
#define WL_NETWORKS_LIST_MAXNUM
#define NULL
Definition: def.h:44

◆ getSubnetMask()

void WiFiDrv::getSubnetMask ( IPAddress mask)
static

wifi_drv.cpp293 行目に定義があります。

294  {
295  getNetworkData(_localIp, _subnetMask, _gatewayIp);
296  mask = _subnetMask;
297  }

◆ setDNS()

void WiFiDrv::setDNS ( uint8_t  validParams,
uint32_t  dns_server1,
uint32_t  dns_server2 
)
static

wifi_drv.cpp198 行目に定義があります。

199 {
201  // Send Command
203  SpiDrv::sendParam((uint8_t*)&validParams, 1, NO_LAST_PARAM);
204  SpiDrv::sendParam((uint8_t*)&dns_server1, 4, NO_LAST_PARAM);
205  SpiDrv::sendParam((uint8_t*)&dns_server2, 4, LAST_PARAM);
206 
207  //Wait the reply elaboration
209 
210  // Wait for reply
211  uint8_t _data = 0;
212  uint8_t _dataLen = 0;
213  if (!SpiDrv::waitResponseCmd(SET_DNS_CONFIG_CMD, PARAM_NUMS_1, &_data, &_dataLen))
214  {
215  WARN("error waitResponse");
216  _data = WL_FAILURE;
217  }
219 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define WARN(msg, args...)
Definition: debug.h:140
#define NO_LAST_PARAM
Definition: spi_drv.h:28
#define LAST_PARAM
Definition: spi_drv.h:29
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ startScanNetworks()

int8_t WiFiDrv::startScanNetworks ( )
static

wifi_drv.cpp395 行目に定義があります。

396 {
398 
399  // Send Command
401 
402  //Wait the reply elaboration
404 
405  // Wait for reply
406  uint8_t _data = 0;
407  uint8_t _dataLen = 0;
408 
409  if (!SpiDrv::waitResponseCmd(START_SCAN_NETWORKS, PARAM_NUMS_1, &_data, &_dataLen))
410  {
411  WARN("error waitResponse");
412  _data = WL_FAILURE;
413  }
414 
416 
417  return (_data == WL_FAILURE)? _data : WL_SUCCESS;
418 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define WARN(msg, args...)
Definition: debug.h:140
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151

◆ wifiDriverInit()

void WiFiDrv::wifiDriverInit ( )
static

wifi_drv.cpp98 行目に定義があります。

99 {
100  SpiDrv::begin();
101 }
static void begin()
Definition: spi_drv.cpp:39

◆ wifiSetKey()

int8_t WiFiDrv::wifiSetKey ( char *  ssid,
uint8_t  ssid_len,
uint8_t  key_idx,
const void *  key,
const uint8_t  len 
)
static

wifi_drv.cpp150 行目に定義があります。

151 {
153  // Send Command
155  SpiDrv::sendParam((uint8_t*)ssid, ssid_len, NO_LAST_PARAM);
157  SpiDrv::sendParam((uint8_t*)key, len, LAST_PARAM);
158 
159  //Wait the reply elaboration
161 
162  // Wait for reply
163  uint8_t _data = 0;
164  uint8_t _dataLen = 0;
165  if (!SpiDrv::waitResponseCmd(SET_KEY_CMD, PARAM_NUMS_1, &_data, &_dataLen))
166  {
167  WARN("error waitResponse");
168  _data = WL_FAILURE;
169  }
171  return _data;
172 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define WARN(msg, args...)
Definition: debug.h:140
#define NO_LAST_PARAM
Definition: spi_drv.h:28
#define LAST_PARAM
Definition: spi_drv.h:29
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
#define KEY_IDX_LEN
Definition: wifi_drv.h:29
char ssid[]
Definition: wifiConfig.h:119
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ wifiSetNetwork()

int8_t WiFiDrv::wifiSetNetwork ( char *  ssid,
uint8_t  ssid_len 
)
static

wifi_drv.cpp103 行目に定義があります。

104 {
106  // Send Command
108  SpiDrv::sendParam((uint8_t*)ssid, ssid_len, LAST_PARAM);
109 
110  //Wait the reply elaboration
112 
113  // Wait for reply
114  uint8_t _data = 0;
115  uint8_t _dataLen = 0;
116  if (!SpiDrv::waitResponseCmd(SET_NET_CMD, PARAM_NUMS_1, &_data, &_dataLen))
117  {
118  WARN("error waitResponse");
119  _data = WL_FAILURE;
120  }
122 
123  return(_data == WIFI_SPI_ACK) ? WL_SUCCESS : WL_FAILURE;
124 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define WARN(msg, args...)
Definition: debug.h:140
#define LAST_PARAM
Definition: spi_drv.h:29
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
#define WIFI_SPI_ACK
Definition: wifi_spi.h:16
char ssid[]
Definition: wifiConfig.h:119
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

◆ wifiSetPassphrase()

int8_t WiFiDrv::wifiSetPassphrase ( char *  ssid,
uint8_t  ssid_len,
const char *  passphrase,
const uint8_t  len 
)
static

wifi_drv.cpp126 行目に定義があります。

127 {
129  // Send Command
131  SpiDrv::sendParam((uint8_t*)ssid, ssid_len, NO_LAST_PARAM);
132  SpiDrv::sendParam((uint8_t*)passphrase, len, LAST_PARAM);
133 
134  //Wait the reply elaboration
136 
137  // Wait for reply
138  uint8_t _data = 0;
139  uint8_t _dataLen = 0;
140  if (!SpiDrv::waitResponseCmd(SET_PASSPHRASE_CMD, PARAM_NUMS_1, &_data, &_dataLen))
141  {
142  WARN("error waitResponse");
143  _data = WL_FAILURE;
144  }
146  return _data;
147 }
#define WAIT_FOR_SLAVE_SELECT()
Definition: spi_drv.h:33
static void sendCmd(uint8_t cmd, uint8_t numParam)
Definition: spi_drv.cpp:472
static void spiSlaveDeselect()
Definition: spi_drv.cpp:67
#define WARN(msg, args...)
Definition: debug.h:140
#define NO_LAST_PARAM
Definition: spi_drv.h:28
#define LAST_PARAM
Definition: spi_drv.h:29
static void waitForSlaveReady()
Definition: spi_drv.cpp:139
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t *param, uint8_t *param_len)
Definition: spi_drv.cpp:151
char ssid[]
Definition: wifiConfig.h:119
static void sendParam(uint8_t *param, uint8_t param_len, uint8_t lastParam=NO_LAST_PARAM)
Definition: spi_drv.cpp:382

フレンドと関連関数の詳解

◆ WiFiUDP

friend class WiFiUDP
friend

wifi_drv.h261 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: