1 # -*- coding: utf-8 -*-
3 # Copyright (C) 2012, BMW AG
5 # This file is part of GENIVI Project AudioManager.
7 # Contributions are licensed to the GENIVI Alliance under one or more
8 # Contribution License Agreements.
11 # This Source Code Form is subject to the terms of the
12 # Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
13 # this file, You can obtain one at http://mozilla.org/MPL/2.0/.
16 # \author Christian Linke, christian.linke@bmw.de BMW 2012
18 # For further information see http://www.genivi.org/.
28 def nodeState (nodeState):
29 bus = dbus.SessionBus()
30 remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
31 iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
32 iface.sendNodeState(int(nodeState))
34 def appMode (appMode):
35 bus = dbus.SessionBus()
36 remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
37 iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
38 iface.sendNodeApplicationMode(int(appMode))
40 def sessionState (SessionStateName,SeatID,SessionState):
41 bus = dbus.SessionBus()
42 remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
43 iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
44 iface.sendSessionState(SessionStateName,int(SeatID),int(SessionState))
47 bus = dbus.SessionBus()
48 remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
49 iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
52 def LifecycleRequest(Request,RequestID):
53 bus = dbus.SessionBus()
54 remote_object = bus.get_object('org.genivi.NodeStateManager','/org/genivi/NodeStateManager')
55 iface = dbus.Interface(remote_object, 'org.genivi.NodeStateManager.Control')
56 iface.sendLifeCycleRequest(dbus.UInt32(Request),dbus.UInt32(RequestID))
59 if command=="nodeState":
60 nodeState(sys.argv[2])
63 if command=="appMode":
65 if command=="sessionState":
66 sessionState(sys.argv[2],sys.argv[3],sys.argv[4])
67 if command=="LifecycleRequest":
68 LifecycleRequest(sys.argv[2],sys.argv[3])