# Description: Can access NFC
# Usage: common

# NFC read/write using neard
dbus (receive, send)
    bus=system
    peer=(name="org.neard{,.*}", label=unconfined),

# Required for tags detection signals
dbus (receive)
    bus=system
    path=/
    interface="org.freedesktop.DBus.{ObjectManager,Properties}"
    member="{InterfacesAdded,InterfacesRemoved}"
    peer=(label=unconfined),

# NFC-DEP P2P communication
dbus (send)
    bus=system
    path=/
    interface=org.sailfishos.nfc.Daemon
    member="{GetAdapters,RequestMode,ReleaseMode,RegisterLocalService,UnregisterLocalService}"
    peer=(label=unconfined),

dbus (receive)
    bus=system
    interface=org.sailfishos.nfc.LocalService
    member="{Accept,DatagramReceived,PeerArrived,PeerLeft}",

# Peer detection
dbus (receive)
    bus=system
    interface="org.sailfishos.nfc.Adapter"
    member="PeersChanged"
    peer=(label=unconfined),

# Service consumption
dbus (send)
    bus=system
    interface="org.sailfishos.nfc.Peer"
    member="{ConnectServiceName,ConnectAccessPoint}"
    peer=(label=unconfined),

dbus (receive)
    bus=system
    interface="org.sailfishos.nfc.Peer"
    member="{Removed,WellKnownServicesChanged}"
    peer=(label=unconfined),
