UNIX_FD in practice?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- ruby
- Ambito
- backend, networking
Direzione di ricerca
Start at the DBus::Object NewConnection declaration and the RegisterProfile call shown in the issue, then reproduce the Bluetooth connection while watching the dbus monitor output. Trace why the method call containing a file descriptor is rejected before the callback runs; done means the callback receives the descriptor without the NotSupported error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Heya!
I'm using ruby-dbus to attempt a Bluetooth serial profile callback, and I'm
running into a "Tried to send message with Unix file descriptors to a client that
doesn't support that." error message from dbus.
It's entirely possible I'm defining the callback incorrectly, but I think that's
correct. Example profile definition and registration (as defined here)
class SerialConnection < DBus::Object
dbus_interface( 'org.bluez.Profile1' ) do
dbus_method( :Release ) do
puts "... release"
nil
end
dbus_method( :NewConnection, "in device:o, in fd:h, in fd_props:a{sv}" ) do |device, fd, fd_props|
puts "... incoming connection %p %p %p" % [ device, fd, fd_props ]
# sock = Socket.for_fd( fd )
# ...
nil
end
dbus_method( :RequestDisconnection, "in device:o" ) do |device|
puts "... disconnect"
nil
end
end
end
serial_conn = SerialConnection.new( '/serial/connection' )
bluez_service = DBus::SystemBus.instance.service( 'org.bluez' ).introspect
bluez_profile_manager = bluez_service[ '/org/bluez' ][ 'org.bluez.ProfileManager1' ]
bluez_profile_manager.RegisterProfile( serial_conn.path, '1101', {
'Name' => 'Serial Port',
'Role' => 'server',
'RequireAuthorization' => false,
'Channel' => DBus.variant( 'q', 22 )
});
# ... enter dbus main loop here
When an RFCOMM compatible client connects, the dbus monitor shows it disconnect
immediately (the callback doesn't fire at all).
signal time=1649451498.238931 sender=:1.2 -> destination=(null destination) serial=870 path=/org/bluez/hci0/dev_0C_8D_CA_99_D7_E7; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.Device1"
array [
dict entry(
string "Connected"
variant boolean true
)
]
array [
]
method call time=1649451498.709483 sender=:1.2 -> destination=:1.73 serial=871 path=/serial/connection; interface=org.bluez.Profile1; member=NewConnection
object path "/org/bluez/hci0/dev_0C_8D_CA_99_D7_E7"
file descriptor
inode: 72836 type: socket
address family: bluetooth
array [
]
error time=1649451498.709751 sender=org.freedesktop.DBus -> destination=:1.2 error_name=org.freedesktop.DBus.Error.NotSupported reply_serial=871
string "Tried to send message with Unix file descriptorsto a client that doesn't support that."
signal time=1649451503.316416 sender=:1.2 -> destination=(null destination) serial=872 path=/org/bluez/hci0/dev_0C_8D_CA_99_D7_E7; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.Device1"
array [
dict entry(
string "Connected"
variant boolean false
)
]
array [
]
It seems like it's complaining specifically about the second argument to the
NewConnection method.
file descriptor
inode: 72836 type: socket
address family: bluetooth
Is there a different path I should be taking to tackle this?
Thanks for any insight provided.
- Lingua principale
- Ruby
- Stelle
- 174
- Fork
- 51
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mvidner/ruby-dbus
-
Specify rexml versioningAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Rexml or Nokogiri?Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
NetworkManager.Settings.Connection cannot round-trip, calling Update with what GetSettings returnedAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di mvidner/ruby-dbus
Issue simili
-
Windows: packaged_agent_ruby? never matches 'Puppet Labs\Puppet', so the openvox gem is not foundAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Falha nos links do postAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
temporalio/sdk-ruby#625 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 94/100
zerocracy/judges-action#2803 ·
I maintainer di solito rispondono entro 5 giorni
-
empty tone.rbAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100