Wiki Home >> SIO-Command-$FA-Get-WiFi-Status

SIO-Command-$FA-Get-WiFi-Status


This is a command for Device $70 - The FujiNet Device itself (see SIO-Commands-for-Device-ID-$70).

Get WiFi Status ($FA)

Description

Return the WiFi Status, this is currently equivalent to sending a $53 'S', returns a single byte.

Return values

OffsetDescription
0WiFi Status

WiFi Status Values

ValueDescription
0WIFI is idle
1No SSID Available
2Scan Completed
3Connected to network, and active
4Last connect failed
5WiFi Connection Lost
6WiFi explicitly disconnected

Parameters

DCBValue
DDEVIC$70
DUNIT$01
DCOMND$FA
DSTATS$40
DBUFPointer to 1 byte for status buffer.
DTIMLO$0F
DBYT1
DAUX10
DAUX20

Examples

CC65

unsigned char wifiStatus;

/**
 * Get WiFi Network Status
 */
unsigned char config_get_wifi_status(void)
{
  OS.dcb.ddevic=0x70;
  OS.dcb.dunit=1;
  OS.dcb.dcomnd=0xFA; // Return wifi status
  OS.dcb.dstats=0x40; // Peripheral->Computer
  OS.dcb.dbuf=&wifiStatus;
  OS.dcb.dtimlo=0x0F; // 15 second timeout
  OS.dcb.dbyt=1;
  OS.dcb.daux1=0;
  siov();

  return OS.dcb.dstats;
}

See Also

  • Scan Wifi Networks
  • Wifi Result
  • Set SSID

Wiki content is mirrored from the FujiNet Github Wiki