API Reference - pims.vehicle.media-scan
Info: Stellantis Mobile SDK is not publicly available.
Component:
📻
Media
PSA
SDK Version:
v2.3
API Available since:
v2.3
API Last update:
v2.3
New
API!
Plateforme Compatibility: PSA
Security:
- Authentication: Authentication is required.
Operations:
Listen to available radio stations scan.
Input Parameters Object | |||||
---|---|---|---|---|---|
Param name | Description | Type | Unit/Values | Example | Required |
action | Action Name, in this case |
String |
|
scan
|
true |
Output Data Object | ||||
---|---|---|---|---|
Data name | Description | Type | Unit/Values | Example |
stations | Informations about available stations. |
Array of Objects |
/ |
|
stations
.sid |
sID of the station. |
Integer |
|
|
stations
.channelName |
Station’s channel. |
String |
|
MyRadio
|
stations
.frequency |
Frequency of the station. |
String |
|
100
|
stations
.preset |
Preset position number of the station. |
String |
|
1
|
stations
.name |
Name of the station. |
String |
|
BBC World News
|
stations
.programName |
Current program name of the station. |
String |
|
HARDtalk
|
stations
.serviceCount |
Service count of the station. |
Integer |
|
|
stations
.serviceIndex |
Service index of the station. |
Integer |
|
|
stations
.used |
‘Used’ of the station. |
Integer |
|
|
stations
.band |
Band of the station. |
Enum of Strings |
- am
- fm
- dab
|
|
Error | ||
---|---|---|
No errors |
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Subscribe, see unsubscribe below */
pims.subscribe("pims.vehicle.media",
mapOf( /* parameters */
Pair("action", "scan")
)
) { message -> when (message["status"] as? String) {
"SUCCEEDED" -> { } // handle succeeded status
"FAILED" -> { } // handle failed status
"RESULT" -> {
if(message["error"] != null) { } // handle error event code
else { } // handle result event code
}
} }
/* Unsubscribe */
pims.unsubscribe( "pims.vehicle.media" /* no params */ )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Subscribe, see unsubscribe below */
pims.subscribe(api: "pims.vehicle.media",
parameters: [
"action": "scan"
]
) { (message) in
if message["status"] == "SUCCEEDED" { } // handle succeeded status
else if message["status"] == "FAILED" { } // handle failed status
else if status == "RESULT" {
if !message["error"].isEmpty { } // handle error event code
else { } // handle result event code
}
}
/* Unsubscribe */
pims.unsubscribe( api: "pims.vehicle.media" /* no params */ )
1
2
3
4
5
6
// representation of the `succeeded` dictionary object message as JSON
{
"transactionId": "953cfefb-bc72",
"status": "SUCCEEDED",
"result": { }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// representation of the `result` dictionary object message as JSON
{
"transactionId": "953cfefb-bc72",
"status": "RESULT",
"result": {
"stations": [
{
"sid": ,
"channelName": "MyRadio",
"frequency": "100",
"preset": "1",
"name": "BBC World News",
"programName": "HARDtalk",
"serviceCount": ,
"serviceIndex": ,
"used": ,
"band": ""
}, /* Other stations objects */ ]
}
}
false