Gute Leute,
Ich versuche, das neu eingeführte AccessoireSetupKit von Apple für mein Projekt zu verwenden. Ich habe die Dokumentation befolgt, aber irgendwie gelingt mir keine Verbindung. Lassen Sie mich die Details mitteilen:
Ich habe alle erforderlichen Funktionen hinzugefügt.
Ich habe da zwei Ansätze. Ein Ansatz ist die alte NEHotspotConfiguration, die gut funktioniert.
Wenn ich jedoch die Auswahl anzeige, wird mir die Liste der verfügbaren WLANs angezeigt. Dann wähle ich ein Zubehörteil aus und es wird hinzugefügt. Wenn ich jedoch versuche, eine Verbindung zur Wi-Fi-SSID herzustellen, wird mir „System verweigert“ angezeigt. Ich verstehe nicht, warum es passiert. Alle Vorschläge sind willkommen. Ich hänge das Protokoll, den Screenshot und meinen Code unten an:
Received event type ASAccessoryEventType(rawValue: 40)
Accessory added
Picker dismissed
Couldn't connect automatically to access point: system denied configuration of the accessory network.
Received event type ASAccessoryEventType(rawValue: 31)
Couldn't present the accessory: Error Domain=ASErrorDomain Code=550 "Application is not in foreground." UserInfo={NSDebugDescription=Application is not in foreground., cuErrorMsg=Application is not in foreground., NSLocalizedFailureReason=Application is not in foreground.}
(The log below is the 2nd approach when I press the 2nd button)
Successfully connected to the access point.
Das Video dieser Beispiel-App hänge ich hier an.
Videoaufzeichnungen
Gute Leute, Ich versuche, das neu eingeführte AccessoireSetupKit von Apple für mein Projekt zu verwenden. Ich habe die Dokumentation befolgt, aber irgendwie gelingt mir keine Verbindung. Lassen Sie mich die Details mitteilen: [list] [*]Ich habe alle erforderlichen Funktionen hinzugefügt. [*]Ich habe da zwei Ansätze. Ein Ansatz ist die alte NEHotspotConfiguration, die gut funktioniert. Wenn ich jedoch die Auswahl anzeige, wird mir die Liste der verfügbaren WLANs angezeigt. Dann wähle ich ein Zubehörteil aus und es wird hinzugefügt. Wenn ich jedoch versuche, eine Verbindung zur Wi-Fi-SSID herzustellen, wird mir „System verweigert“ angezeigt. Ich verstehe nicht, warum es passiert. Alle Vorschläge sind willkommen. Ich hänge das Protokoll, den Screenshot und meinen Code unten an: [/list] [code]import SwiftUI internal import AccessorySetupKit import NetworkExtension
struct ContentView: View {
let cmDisplayItem = AccessPointDescriptor().cmDisplayItem() let ssidName = "LH_36.460.618.4" var session = ASAccessorySession() @State var accessory: ASAccessory?
func presentPicker() { Task { /// If the accessory is already added, it doesn't appear next time though i am not connected /// and the ssid is visible/broadcasted. That's why i am removing it first now if let item = session.accessories.first { do { try await session.removeAccessory(item) } catch { print("Couldn't remove the accessory: \(error)") } } do { try await session.showPicker(for: [cmDisplayItem]) } catch { print("Couldn't present the accessory: \(error)") } } }
func handleSessionEvent(event: ASAccessoryEvent) { switch event.eventType { case .activated: print("Session is activated and ready to use") case .accessoryAdded: print("Accessory added ") self.accessory = event.accessory
case .pickerDidDismiss: print("Picker dismissed ") // if let ssid = self.accessory?.ssid { // print("SSID - \(ssid)") // connect(ssid: ssid) // } connect(ssid: ssidName) default: print("Received event type \(event.eventType)") } }
func connect(ssid: String) { Task { let config = NEHotspotConfiguration(ssid: ssidName) NEHotspotConfigurationManager.shared.apply(config) { error in if let error, let connectionError = NEHotspotConfigurationError(rawValue: (error as NSError).code), connectionError == .userDenied { print("User denied to connect automatically to access point.") } else if let error { print("Couldn't connect automatically to access point: \(error.localizedDescription)") } else { print("Successfully connected to access point.") } } } } }
func cmDisplayItem() -> ASPickerDisplayItem { return ASPickerDisplayItem(name: "CM AccessPoint", productImage: .add, descriptor: cmAccessPointDescription) } } [/code] Hier ist das Protokoll, wenn ich den obigen Code ausführe: [code]Received event type ASAccessoryEventType(rawValue: 40) Accessory added Picker dismissed Couldn't connect automatically to access point: system denied configuration of the accessory network. Received event type ASAccessoryEventType(rawValue: 31) Couldn't present the accessory: Error Domain=ASErrorDomain Code=550 "Application is not in foreground." UserInfo={NSDebugDescription=Application is not in foreground., cuErrorMsg=Application is not in foreground., NSLocalizedFailureReason=Application is not in foreground.} (The log below is the 2nd approach when I press the 2nd button) Successfully connected to the access point. [/code] Das Video dieser Beispiel-App hänge ich hier an. Videoaufzeichnungen
Ich werde zunächst sagen, dass ich, obwohl ich in C für eingebettete Geräte programmiert habe, sehr neu in der Android -Entwicklung. Der private Broker wurde korrekt mit Portweiterleitung usw....
Die drahtlose ADB-Verbindung funktioniert einwandfrei auf meinem Android 11-Telefon und meiner Windows-Workstation.
Aber das ist nicht praktisch, da ich jedes Mal, wenn die WLAN-Verbindung des...
Dies ist der Fehler, der Host „2B011HFGN3FZ18“ und Port 5555 nicht auflösen kann: Es ist kein solcher Host bekannt. (11001) und ich habe alles versucht, was mir einfiel, und ich kann das drahtlose...
Ich versuche, in OPEN AI einen Agenten zu erstellen, der sich basierend auf Benutzereingaben beim VS-Codeserver authentifiziert. Der VS-Codeserver wird im Docker-Container docker-vscode-1 ausgeführt....