TrafficBroadcast (API Reference)
Class TrafficBroadcast
- All Implemented Interfaces:
LocationListener
A TrafficBroadcast is expecting the RDS-TMC
format and it can be used when there is no internet connection, so that the OfflineRoutingEngine
can utilize traffic data coming over a radio channel. The activate() method needs to be called to
receive traffic data events.
Note: In order to adopt the TrafficDataProvider interface special hardware is required. Talk
to your HERE representative for more details. Only by adopting the TrafficDataProvider interface
you can integrate radio station signals providing traffic broadcasts. Traffic broadcasts are meant
to be used independently from the already included traffic on routes, on the map and from the
HERE backends (when using the TrafficEngine).
This class continuously reacts to new locations provided from a location source and acts as a
LocationListener. The location must be updated regardless of calling activate().
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Constructor Summary
ConstructorsConstructorDescriptionTrafficBroadcast(SDKNativeEngine sdkEngine, TrafficBroadcastParameters parameters) Creates a new instance of this class.TrafficBroadcast(TrafficBroadcastParameters parameters) Creates a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates the reception of traffic data over the radio channel.voidDeactivates the reception of traffic data over the radio channel.voidonLocationUpdated(Location location) Called each time a new location is available.voidonTMCDataUpdated(TMCData tmcData) Must be called on every TMC data update.voidonTMCServiceProviderInfoUpdated(TMCServiceProviderInfo tmcServiceProdiverInfo) Must be called on every TMC service prodiver info update.
-
Constructor Details
-
TrafficBroadcast
public TrafficBroadcast(@NonNull TrafficBroadcastParameters parameters) throws InstantiationErrorException Creates a new instance of this class.
- Parameters:
parameters-The necessary parameters to start traffic broadcast.
- Throws:
InstantiationErrorException-when the object was not initialized properly.
-
TrafficBroadcast
public TrafficBroadcast(@NonNull SDKNativeEngine sdkEngine, @NonNull TrafficBroadcastParameters parameters) throws InstantiationErrorException Creates a new instance of this class.
- Parameters:
sdkEngine-Instance of an existing SDKEngine.
parameters-The necessary parameters to start traffic broadcast.
- Throws:
InstantiationErrorException-when the object was not initialized properly.
-
-
Method Details
-
activate
public void activate()Activates the reception of traffic data over the radio channel. This method is supposed to be called when the system loses internet connection, so that traffic data can be switched from the online source to the radio channel. When activation is done, requestTMCService is called from TMCServiceInterface
-
deactivate
public void deactivate()Deactivates the reception of traffic data over the radio channel. When deactivation is done, requestTMCService is called from TMCServiceInterface With special case of countryCode parameter = 0
-
onTMCServiceProviderInfoUpdated
Must be called on every TMC service prodiver info update.
- Parameters:
tmcServiceProdiverInfo-Contains service prodiver info in RDS-TMC format.
-
onTMCDataUpdated
Must be called on every TMC data update.
- Parameters:
tmcData-Contains the traffic events in RDS-TMC format.
-
getTrafficDataProvider
- Returns:
The traffic data provider that provides the traffic information.
-
onLocationUpdated
Called each time a new location is available. In a navigation context while using the
NavigatororVisualNavigator, it's required to set theLocation.timeparameter for eachLocationobject so that the HERE SDK can map-match the locations properly. If theLocation.timeparameter is missing, the location will be ignored. For navigation, it is also recommended to provide thebearingandspeedparameters for eachLocationobject. Invoked on the main thread.- Specified by:
onLocationUpdatedin interfaceLocationListener- Parameters:
location-Current location.
-