こんにちは、dbus を使用して保護された WiFi ネットワークに接続しようとしているときに、ここ数日間この問題が発生しています。したがって、これまでに開発したコードは次のとおりです。
登録エージェント
var dbus = require('dbus-native');
var bus = dbus.systemBus();
bus.invoke({
destination: 'net.connman',
path: '/',
'interface': 'net.connman.Manager',
member: 'RegisterAgent',
type: dbus.messageType.methodCall,
signature: 'o',
body: [
'/test/agent'
]
}, function(error, response) {
if (error) {
console.error('Error', error);
//process.exit(1);
} else {
console.info('Success', response);
// process.exit(0);
}
});
出力
> Success
Wi-Fi をスキャン
var dbus = require('dbus-native');
var bus = dbus.systemBus();
bus.invoke({
destination: 'net.connman',
path: '/net/connman/technology/wifi',
'interface': 'net.connman.Technology',
member: 'Scan',
type: dbus.messageType.methodCall,
}, function(error, response) {
if (error) {
console.error('Error', error);
//process.exit(1);
} else {
console.info('Success', response);
//process.exit(0);
}
});
出力
> Success
WiFi サービスに接続する
var dbus = require('dbus-native');
var bus = dbus.systemBus();
bus.invoke({
destination: 'net.connman',
path: '/net/connman/service/wifi_00e04c81923e_4469676957494649_managed_psk',
'interface': 'net.connman.Service',
member: 'Connect',
type: dbus.messageType.methodCall,
}, function(error, response) {
if (error) {
console.error('Error', error);
//process.exit(1);
} else {
console.info('Success', response);
//process.exit(0);
}
});
出力
> Error ['Invalid Arguments']
connMan ログからの出力
connmand[1899]: src/agent.c:agent_receive_message() エージェント 0x55640fe8 req 0x55644378
connmand[1899]: src/service.c:request_input_cb() RequestInput リターン、0x55649ad0
connmand[1899]:src/service.c:request_input_cb()error:org.freedesktop.DBus.Error.UnknownService
connmand[1899]: src/service.c:__connman_service_return_error() サービス 0x55649ad0 エラー 22 user_data (nil)
connmand[1899]: src/service.c:__connman_service_set_hidden_data() サービス 0x55649ad0 保留中 (nil)
connmand[1899]: src/service.c:service_save() サービス 0x55649ad0 新しい 1
connmand[1899]: src/connection.c:update_order()
connmand[1899]: src/service.c:__connman_service_get_order() サービス名 0x55640a08 有線注文 1 分割 0
connmand[1899]: src/connection.c:find_default_gateway() デフォルト 0x5563b250 オーダー 1
connmand[1899]: src/connection.c:__connman_connection_update_gateway() デフォルト 0x5563b250
connmand[1899]: src/service.c:connman_service_unref_debug() 0x55649ad0 ref 1 by src/service.c:6945:agent_context_unref()
基本的に、誰かが WiFi ネットワークのパスフレーズを含むユーザー データを返す方法を教えていただければ幸いです。
どんな助けでも大歓迎ですか?(connMan バージョン 1.20)
ありがとう