Expand description
Starting and stopping active route following, on the wire.
Distinct from crate::resources (which only ever stores a route,
never sails one) and from crate::anchor (a plain data-model path
with no server-side logic behind it): navigation.course.* is
Signal K’s own Course API, a dedicated REST resource with a handler
that resolves a route resource, decides which waypoint is next, and
publishes that back out as navigation.course.nextPoint/
previousPoint deltas. That handler is why this module exists
rather than one more anchor-style bare-value PUT. Confirmed
against the Course API bundled with signalk-server
(dist/api/course):
- It lives under
/signalk/v2/api/vessels/self/navigation/course, one full API version ahead of the plain/v1/api/...data-model pathscrate::anchorPUTs to: thev1path answers a bare 404, thev2one a realCourseInfobody. Sharing the rest of the path withanchor(vessels/self/navigation/...) does not carry over. PUT .../activeRoutetakes the destination body unwrapped ({"href": ..., "pointIndex": ...}directly, not{"value": {...}}}the wayanchor’s plain data-model paths do, since this is a REST resource endpoint, not a generic value write), and replies with the exactstate/statusCode/messageshapecrate::anchor::read_request_responsealready reads, reused here rather than duplicated.DELETE .../course(the bare path, no/activeRoutesuffix) is how the server defines “stop”, not aPUTofnull.PUT .../activeRoute/nextPoint, value{"value": 1}, advancespointIndexby one; the server recomputesnextPoint/previousPointitself from the route’s own geometry (confirmed by reading the server’s own handler,dist/api/course, theactiveRoute/:actionroute).
Reading back what is being followed (nextPoint, previousPoint)
is not this module’s job: a client watches the delta stream for
that, the same way crate::anchor’s own doc explains for
navigation.anchor.position. This module provides only the write
half: starting or stopping the follow.
Structs§
- Client
- A client for starting or stopping active route following on one server.