If you implement a server (autopilot or simulator), register the mode microservice during server device build:
var serverDevice = ServerDevice.Create(
new MavlinkIdentity(config.SystemId, config.ComponentId),
core,
builder =>
{
// register other services...
// you need to pass your own work mode
builder.RegisterMode(
ArduCopterMode.Guided,
ArduCopterMode.AllModes,
mode => new SomeWorkMode(mode));
});
RegisterMode depends on the status-text, command-long, and heartbeat services.
After building, you can get the service and request mode changes: