Wireless Communication Library Support Forum

Frameworks => WiFi Framework => Topic started by: rstruebl on April 09, 2015, 01:09:33 PM

Title: TwclWifiManager without vcl, problems with events
Post by: rstruebl on April 09, 2015, 01:09:33 PM
Hello!

I tried to implement the TwclWifiManager without the usage of the vcl in an external unit:

-------------------------------------------------------
constructor TRsWLan.Create;
begin

  inherited Create(nil);

  wclAPI         := TwclAPI.Create(nil);
  wclWiFiManager := TwclWiFiManager.Create(nil);

  // ---> events
  wclWiFiManager.OnConnected    := OnApConnected;        // WclWiFiConnectionEvent
  wclWiFiManager.OnDisconnected := OnApDisConnected;   // WclWiFiConnectionEvent
  wclWiFiManager.OnOpened       := OnApOpened;             // TNotifyEvent
  // <--- events
 
 ...

----------------------------------------------------------------

My problem is, that only the "OnOpened" shows an reaction, not the important ones
"wclWiFiManager.OnConnected / wclWiFiManager.OnDisconnected". The only difference I could see is that the reacting one is type of "TNotifyEvent", the others "WclWiFiConnectionEvent".
In a windows based application everything works fine, but I have to write a driver for a console application...

Is there any possibility to get them working?


Best Regards
rstruebl

Title: Re: TwclWifiManager without vcl, problems with events
Post by: Mike Petrichenko on April 09, 2015, 04:12:22 PM
Hello,

WCL requires Message Loop in your console app.

If you know C++ a bit you may take a look on BluetoothConsole demo from WCL C++ Edition.
Title: Re: TwclWifiManager without vcl, problems with events
Post by: rstruebl on April 16, 2015, 09:41:58 AM
Hi Mike,

thanks a lot!
I got it working.

Best Regards
rstruebl