SIO Command $FC Get Scan Result - FujiNetWIFI/fujinet-firmware GitHub Wiki

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

Get Scan Result ($FC)

Description

After running Command $FD to scan networks, this command returns the result specified by DAUX parameter, in the following format (33 bytes total):

Size Parameter Description
33 SSID Name Name of the detected network, NUL ($00) terminated.
1 RSSI Signal Strength expressed in a single byte as dBm, e.g. -90 = -90dBm

Parameters

DCB Value
DDEVIC $70
DUNIT $01
DCOMND $FC
DSTATS $40
DBUF 33 byte buffer, example struct below
DTIMLO $0F
DBYT 33
DAUX1 # of network result to return
DAUX2 Not used

Examples

C

union
{
  struct
  {
    char ssid[33];
    signed char rssi;
  };
  unsigned char rawData[34];
} ssidInfo;

/**
 * Return Network entry from last scan
 */
unsigned char config_scan_result(unsigned char n)
{
  OS.dcb.ddevic=0x70;
  OS.dcb.dunit=1;
  OS.dcb.dcomnd=0xFC; // Return scan result
  OS.dcb.dstats=0x40; // Peripheral->Computer
  OS.dcb.dbuf=&ssidInfo.rawData;
  OS.dcb.dtimlo=0x0F; // 15 second timeout
  OS.dcb.dbyt=sizeof(ssidInfo.rawData);
  OS.dcb.daux1=n;     // get entry #n
  siov();

  return OS.dcb.dstats;
}

See Also

  • Scan Networks
  • Set SSID