Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacFrameworks/CWWiFiClient
Function:
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacFrameworks/CWWiFiClient
This example is the version from Fri, 3rd May 2018.
Project "CWWiFiClient.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() CWWiFiClient = new MyCWWiFiClientMBS CWWiFiClient.list = list // it may be okay to have some fail... startMonitoring CWWiFiClientMBS.CWEventTypeBSSIDDidChange startMonitoring CWWiFiClientMBS.CWEventTypeCountryCodeDidChange startMonitoring CWWiFiClientMBS.CWEventTypeLinkDidChange startMonitoring CWWiFiClientMBS.CWEventTypeLinkQualityDidChange startMonitoring CWWiFiClientMBS.CWEventTypeModeDidChange startMonitoring CWWiFiClientMBS.CWEventTypePowerDidChange startMonitoring CWWiFiClientMBS.CWEventTypeRangingReportEvent startMonitoring CWWiFiClientMBS.CWEventTypeScanCacheUpdated startMonitoring CWWiFiClientMBS.CWEventTypeSSIDDidChange startMonitoring CWWiFiClientMBS.CWEventTypeVirtualInterfaceStateChanged End EventHandler
Sub startMonitoring(type as integer) dim error as NSErrorMBS if CWWiFiClient.startMonitoring(type, error) then // ok else List.AddRow "startMonitoring failed with type "+str(type)+": "+error.LocalizedDescription end if End Sub
Property CWWiFiClient As MyCWWiFiClientMBS
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class MyCWWiFiClientMBS Inherits CWWiFiClientMBS
EventHandler Sub bssidDidChangeForWiFiInterfaceWithName(interfaceName as String) log CurrentMethodName +" "+interfaceName dim i as CWInterfaceMBS = me.interfaceWithName(interfaceName) log "BSSID: "+i.bssid End EventHandler
EventHandler Sub clientConnectionInterrupted() log CurrentMethodName End EventHandler
EventHandler Sub clientConnectionInvalidated() log CurrentMethodName End EventHandler
EventHandler Sub countryCodeDidChangeForWiFiInterfaceWithName(interfaceName as String) log CurrentMethodName +" "+interfaceName dim i as CWInterfaceMBS = me.interfaceWithName(interfaceName) log "countryCode: "+i.countryCode End EventHandler
EventHandler Sub linkDidChangeForWiFiInterfaceWithName(interfaceName as String) log CurrentMethodName +" "+interfaceName End EventHandler
EventHandler Sub linkQualityDidChangeForWiFiInterfaceWithName(interfaceName as String, rssi as Integer, transmitRate as double) log CurrentMethodName +" "+interfaceName+" rssi: "+str(rssi)+" transmitRate: "+str(transmitRate) End EventHandler
EventHandler Sub modeDidChangeForWiFiInterfaceWithName(interfaceName as String) log CurrentMethodName +" "+interfaceName dim i as CWInterfaceMBS = me.interfaceWithName(interfaceName) log "interfaceMode: "+str(i.interfaceMode) End EventHandler
EventHandler Sub powerStateDidChangeForWiFiInterfaceWithName(interfaceName as String) log CurrentMethodName +" "+interfaceName dim i as CWInterfaceMBS = me.interfaceWithName(interfaceName) log "powerOn: "+str(i.powerOn) End EventHandler
EventHandler Sub rangingReportEventForWiFiInterfaceWithName(interfaceName as String, rangingData() as Dictionary, error as NSErrorMBS) log CurrentMethodName +" "+interfaceName if error <> nil then log "error: "+error.LocalizedDescription end if End EventHandler
EventHandler Sub scanCacheUpdatedForWiFiInterfaceWithName(interfaceName as String) log CurrentMethodName +" "+interfaceName dim i as CWInterfaceMBS = me.interfaceWithName(interfaceName) dim c() as CWNetworkMBS = i.cachedScanResults for each n as CWNetworkMBS in c log "network: "+n.ssid+" "+n.bssid next End EventHandler
EventHandler Sub ssidDidChangeForWiFiInterfaceWithName(interfaceName as String) log CurrentMethodName +" "+interfaceName dim i as CWInterfaceMBS = me.interfaceWithName(interfaceName) log "SSID: "+i.ssid End EventHandler
EventHandler Sub virtualInterfaceStateChangedForWiFiInterfaceWithName(interfaceName as String) log CurrentMethodName +" "+interfaceName End EventHandler
Sub log(s as string) List.addrow s list.ScrollPosition = list.LastIndex End Sub
Property list As listbox
End Class
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacFrameworks Plugin.





Links
MBS Xojo Plugins