setRouteOptions
Command
Sets new route options
BND_MESSAGE extra of an Intent with the action ACTION_RNC_BROADCAST, to BeNav's activity or receiver: see Sending commands.Sets how BeNav computes routes and presents them: fastest or shortest, whether motorways, tolls, ferries, unpaved roads and border crossings are allowed, whether traffic is used and whether the route is recalculated when it changes, plus units and map theme.
This is how a client application applies its own routing policy to every journey, instead of depending on whatever each driver happens to have set. Only the fields sent are changed (everything omitted keeps its current value) and if a journey is already running it is recomputed straight away with the new settings.
Worth knowing
- Nothing stops the driver changing these back afterwards. Pair it with
lockSettingswhen the configuration has to hold. - If any value in the command is not recognised, nothing at all is applied and the response names the offending fields: the settings never end up half-changed.
Example: enforcing a no-toll policy
A haulier does not reimburse tolls. Its application sends setRouteOptions with
toll: false when the driver starts a shift, then lockSettings so the toll
switch is greyed out on the device. Every route BeNav computes that day avoids toll roads, and the
setting cannot be quietly turned back on.
routeMode accepts only FASTEST and SHORTEST; ECO is rejected. If any provided value is unrecognised the command answers -32700 with a message naming the offending fields (e.g. parse.error: routeMode, units) and nothing is applied.
Command#
{
"jsonrpc": "2.0",
"method": "setRouteOptions",
"params": {
"routeMode": "FASTEST",
"crossing": true,
"ferry": true,
"motorway": true,
"sideArrival": false,
"toll": true,
"traffic": true,
"autoReroute": true,
"unpaved": true,
"altRoutes": true,
"units": "IMPERIAL",
"showVehicleProfileName": false,
"showRestrictions": false,
"mapDisplayMode": "DARK"
},
"id": "1"
}routeModePossible values [FASTEST|SHORTEST].crossingAllow or disallow border crossing (if possible) [true|false] (defaulttrue)ferryFerry allowed [true|false] (defaulttrue)motorwayMotorway allowed [true|false] (defaulttrue)sideArrivalArrival on defined destination side or not [true|false] (defaulttrue)tollToll roads allowed [true|false] (defaulttrue)trafficTake into account traffic jams during route calculations (if traffic service available) [true|false] (defaulttrue)autoRerouteAuto-reroute when traffic information is updated (iftrafficis enabled) [true|false] (defaultfalse)unpavedUnpaved roads allowed [true|false] (defaultfalse)altRoutesAlternative routes enabled or disabled [true|false] (defaulttrue)unitsPossible values [METRIC|IMPERIAL]. (defaultMETRIC)showVehicleProfileNameShow vehicle profile's name on the map (defaultfalse)showRestrictionsShow vehicle restrictions on map (defaulttrue)mapDisplayModePossible values [LIGHT|DARK|AUTO]. (defaultLIGHT)
Response#
Generic Command responses.