aboutsummaryrefslogtreecommitdiffstats
path: root/src/sm-def.h
blob: 0bab88dc96a67f3f513b666063652aa77c791273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
 * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef SOUNDMANAGER_DEFINE_H
#define SOUNDMANAGER_DEFINE_H

#define AM_NAME "org.genivi.audiomanager"
#define AM_CMD_PATH     "/org/genivi/audiomanager/commandinterface"
#define AM_ROUTE_PATH   "/org/genivi/audiomanager/routinginterface"
#define SOUND_MANAGER_RETURN_INTERFACE   "org.genivi.audiomanager.routing.soundmanager"
#define SOUND_MANAGER_BUS_NAME "org.genivi.audiomanager.routing.soundmanager"
#define SOUND_MANAGER_PATH "/org/genivi/audiomanager/routing/soundmanager"

#define COMMAND_EVENT_NUM 10
#define ROUTING_EVENT_NUM 10
#define DEFAULT_SINK 1
#define DEFAULT_SOURCE_CLASS_ID 101
#define DYNAMIC_DOMAIN_ID 100
#define DEFAULT_DOMAIN_ID 0
#define DYNAMIC_SOURCE_ID 0
#define DEFAULT_VOLUME 100
#define DEFAULT_AVAILABLES 1
#define DEFAULT_CONNECTION_FORMAT 2
#define DEFAULT_INTERRUPT 0
#define DEFAULT_SOURCE_STATE 2
#define DS_CONTROLLED 1

#define EVENT_SUBSCRIBE_ERROR_CODE 100

#define KEY_SOURCE_ID "sourceID"
#define KEY_SINK_ID "sinkID"
#define KEY_SINK_NAME "sinkName"
#define KEY_MAIN_CONNECTION_ID "mainConnectionID"
#define KEY_DELAY "delay"
#define KEY_CONNECTION_STATE "connectionState"
#define KEY_CONNECTION_ID "connectionID"
#define KEY_VOLUME "volume"
#define KEY_VOLUME_STEP "volumeStep"
#define KEY_INTERRUPT "interrupt"
#define KEY_MUTE_STATE "muteState"

#define KEY_DOMAIN_ID "domainID"
#define KEY_HANDLE "handle"
#define KEY_APPNAME "appname"
#define KEY_RAMP "ramp"
#define KEY_TIME "time"
#define KEY_SOURCE_STATE "sourceState"
#define KEY_SOURCE_CLASS_ID "sourceClassID"
#define KEY_SINK_CLASS_ID "sinkClassID"
#define KEY_ERROR "error"
#define KEY_SINK_DATA "sinkData"
#define KEY_SOURCE_DATA "sourceData"
#define KEY_INTERRUPT_STATE "interruptState"
#define KEY_AVAILABILITY "availability"
#define KEY_AVAILABILITY_REASON "availabilityReason"
#define KEY_LIST_VOLUMES "listVolumes"
#define KEY_PAYLOAD "payload"
#define KEY_CONNECTION_FORMAT "connectionFormat"
#define KEY_EVENT "event"

#define KEY_RESPONSE "response"

#ifdef  ENABLE_AGL_AHL
#define KEY_AHL_AUDIO_ROLE "audio_role"
#define KEY_AHL_ENDPOINT_ID "endpoint_id"
#define KEY_AHL_ENDPOINT_TYPE "endpoint_type"
#define KEY_AHL_REP_STREAM_ID "stream_id"

typedef enum {
  ENDPOINT_SINK,
  ENDPOINT_SOURCE,
} EndPointType;
#endif

typedef enum {
  NOT_INITIALIZED = -2,
  UNABLE_SEND,
  OK = 0,
  UNKNOWN,
  OUT_RANGE,
  NOT_USED,
  DATABASE_ERR,
  OBJECT_ALREADY_EXIST,
  NO_CHANGE,
  ACTION_IMPOSSIBLE,
  OBJECT_NOT_EXIST,
  ASYNC_ACTION_ABORTED,
  CONNECTION_FORMAT_ERR,
  COMMUNICATION_ERR,
  EVENT_NOT_EXIST = 100
} ErrorCode;

typedef enum {
    REQ_FAIL,
    OUT_OF_RANGE,
    NOT_NUMBER,
    REQ_OK
} REQ_ERROR;

#define MAX_LENGTH_STR 256

#endif // SOUNDMANAGER_DEFINE_H