コード例 #1
0
ファイル: osmc_bluetooth.py プロジェクト: danidomi/osmc
def toggle_bluetooth_state(state):
    if state:
        if not systemd.is_service_running(BLUETOOTH_SERVICE):
            systemd.toggle_service(BLUETOOTH_SERVICE, state)
        connman.toggle_technology_state("bluetooth", state)
    else:
        connman.toggle_technology_state("bluetooth", state)
コード例 #2
0
ファイル: osmc_bluetooth.py プロジェクト: darkflag/osmc
def toggle_bluetooth_state(state):
    if state:
        if not systemd.is_service_running(BLUETOOTH_SERVICE):
            systemd.toggle_service(BLUETOOTH_SERVICE, state)
        connman.toggle_technology_state('bluetooth', state)
    else:
        connman.toggle_technology_state('bluetooth', state)
コード例 #3
0
ファイル: osmc_bluetooth.py プロジェクト: danidomi/osmc
def is_bluetooth_enabled():
    connman_status = connman.is_technology_enabled("bluetooth")
    service_status = systemd.is_service_running(BLUETOOTH_SERVICE)
    return connman_status and service_status
コード例 #4
0
ファイル: osmc_bluetooth.py プロジェクト: darkflag/osmc
def is_bluetooth_enabled():
    connman_status = connman.is_technology_enabled('bluetooth')
    service_status = systemd.is_service_running(BLUETOOTH_SERVICE)
    return connman_status and service_status