syntax = "proto2";
// fundamental types
import "machinetalk/protobuf/nanopb.proto";

// see README.msgid
// msgid base: 1400

package machinetalk;

enum ValueType {
    //  the following tags correspond to hal.h: hal_type_t;
    HAL_BIT   = 1;
    HAL_FLOAT = 2;
    HAL_S32   = 3;
    HAL_U32   = 4;
    HAL_S64   = 5;
    HAL_U64   = 6;
    // STRING and BYTES not currently used
    STRING    = 7;
    BYTES     = 8;

    INT32     = 20;
    UINT32    = 30;
    INT64     = 40;
    UINT64    = 50;
    DOUBLE    = 60;
    BOOL      = 80;

    CARTESIAN = 100;
    LEGACY_CARTESIAN = 110;
    POSE      = 120;
    LEGACY_POSE    = 130;
}

enum HalPinDirection {
    //  the following tags correspond to hal.h: hal_pin_dir_t
    HAL_IN = 16;
    HAL_OUT = 32;
    HAL_IO = 48; // (HAL_IN | HAL_OUT),
}

enum HalParamDirection {
    //  the following tags correspond to hal.h: hal_param_dir_t
    HAL_RO = 64;
    HAL_RW = 192;
}

enum HalFunctType {
    FS_LEGACY_THREADFUNC = 0;  // legacy API
    FS_XTHREADFUNC = 1;        // extended API
    FS_USERLAND = 2;           // userland-callable, with argc/arv vector
}

enum ObjectType {
    //  the following tags correspond to hal.h:hal_object_type
    HAL_OBJECT_INVALID = 0;
    HAL_PIN           = 1;
    HAL_SIGNAL        = 2;
    HAL_PARAM         = 3;
    HAL_THREAD        = 4;
    HAL_FUNCT         = 5;
    HAL_COMPONENT     = 6;
    HAL_VTABLE        = 7;
    HAL_INST          = 8;
    HAL_RING          = 9;
    HAL_GROUP         = 10;
    HAL_MEMBER        = 11;
    HAL_PLUG          = 12;

    // used at all?
    // VALUE             = 120;
    // INSTANCE          = 121;
    // ORIGINATOR        = 122;
    // NAMED_VALUE       = 125;
    // OT_ERROR          = 130;
}

enum msgidType {
    // all "option (nanopb_msgopt).msgid = <values> MUST be less than MSGID_MAX
    MSGID_MAX = 4000;

    // the empty zeromq frame which delimits route from payload
    MSGID_ROUTE_DELIMITER = 4001;

    // inband error message - use if a comp needs to signal an error with zeroMQ framing etc
    MSGID_ERROR_MSG = 4002;

    // an uninterpreted blob:
    MSGID_BLOB = 4003;
    // an uninterpreted string:
    MSGID_STRING = 4004;

    // when using multiframe rings with zeromq router/dealer, routing elements are
    // tagged MSGID_HOP
    MSGID_HOP = 4005;
}

enum socketType {
    ST_ZMQ_PAIR = 0;
    ST_ZMQ_PUB = 1;
    ST_ZMQ_SUB = 2;
    ST_ZMQ_REQ = 3;
    ST_ZMQ_REP = 4;
    ST_ZMQ_DEALER = 5;
    ST_ZMQ_ROUTER = 6;
    ST_ZMQ_PULL = 7;
    ST_ZMQ_PUSH = 8;
    ST_ZMQ_XPUB = 9;
    ST_ZMQ_XSUB = 10;
    ST_ZMQ_STREAM = 11;

    ST_ZMQ_INVALID = 15;
};

enum securityMechanism {
    SM_ZMQ_NONE = -1;
    SM_ZMQ_NULL = 0;
    SM_ZMQ_PLAIN = 1;
    SM_ZMQ_CURVE = 2;
};

enum RCS_STATUS {
    UNINITIALIZED_STATUS = -1;
    RCS_DONE = 1;
    RCS_EXEC = 2;
    RCS_ERROR = 3;
    RCS_RECEIVED = 4;
};

// see rtapi.h
enum  MsgOrigin {
    MSG_KERNEL = 0;
    MSG_RTUSER = 1;
    MSG_ULAPI = 2;
};


enum MsgLevel {
     // see enum msg_level_t in rtapi.h
    RTAPI_MSG_NONE = 0;
    RTAPI_MSG_ERR = 1;
    RTAPI_MSG_WARN = 2;
    RTAPI_MSG_INFO = 3;
    RTAPI_MSG_DBG = 4;
    RTAPI_MSG_ALL = 5;
}

enum OriginDetail {
    UNIX_SIGNAL     = 10;
    INSTANCE_SHUTDOWN = 20;
    ZMQ_SOCKET      = 70;
    NML_LAYER       = 80;
    RCS_LAYER       = 90;
    CMS_LAYER       = 100;
    IP_LAYER        = 110;
    TCP_LAYER       = 120;
    PGM_LAYER       = 130;
}

enum OriginType {
    PROCESS         = 10;
    USER_THREAD     = 20;
    RT_THREAD       = 30;
    COMPONENT       = 40;
    THREAD_FUNCTION = 50;
    COMPONENT_INIT  = 60;
    COMPONENT_EXIT  = 70;
    GROUP           = 80;
    PIN             = 90;
    SIGNAL          = 100;
}

enum Severity {
    S_INFORMATIONAL   = 1;
    S_WARNING         = 2;
    S_FAIL            = 4;
}

enum StatusType {
    ENQUEUED    = 1; // intermediate
    PROCESSING  = 2; // -- '' --
    COMPLETE    = 3; // final
    FAILED      = 4; // -- '' --
}

enum ReplyType {
    // NONE wont work with zmq REQ/REP sockets:
    // they require a reply
    // better to use XREQ/XREP
    NONE           = 0;
    ON_RECEPTION   = 1;
    ON_QUEUED      = 2;
    ON_COMPLETION  = 4;

    ALL_STEPS      = 255;
}

// services exported by various entities
enum ServiceType {

    ST_LOGGING       = 1;
    ST_CONFIG        = 2;
    ST_REDIS         = 3;
    ST_HTTP          = 4;
    ST_HTTPS         = 5;
    ST_WEBSOCKET     = 6;
    ST_WEBSOCKETS    = 7;
    ST_RTAPI_COMMAND = 8;

    ST_STP_HALGROUP       = 9;
    ST_STP_HALRCOMP       = 10;
    ST_STP_INTERP         = 11;
    ST_STP_TASK           = 12;

    ST_HAL_RCOMMAND       = 13;
    ST_TASK_COMMAND       = 14;
    ST_INTERP_COMMAND     = 15;

    ST_MESSAGEBUS_COMMAND = 16;
    ST_MESSAGEBUS_RESPONSE  = 17;
}

enum ServiceAPI {
    SA_ZMQ_PROTOBUF = 1;
    SA_WS_JSON      = 2;
}

enum ContainerType {

    MT_RTMESSAGE      = 2;
    MT_MOTCMD         = 3;
    MT_MOTSTATUS      = 4;
    MT_LEGACY_MOTCMD  = 5;
    MT_LEGACY_MOTSTATUS  = 6;
    MT_WOU            = 7;
    MT_HALUPDATE      = 8;
    MT_RTAPI_MESSAGE  = 9;
    MT_LOG_MESSAGE    = 10;

    MT_PREVIEW        = 11;
    MT_PROGRESS       = 12;
    MT_INTERP_STAT    = 13;

    MT_SYSLOG         = 18;
    MT_LEGACY_NML     = 19;
    MT_LEGACY_MOTCONFIG = 20;


    //    MT_HALUPDATE_FULL  = 25;
    MT_STP_UPDATE_FULL = 26;
    MT_STP_UPDATE     = 28;
    MT_STP_NOGROUP     = 27;

    // MT_OFFER          = 30;
    // MT_CONFIRM_OFFER  = 35;
    // MT_DISPLAY_MESSAGE = 40;
    MT_SHUTDOWN         = 45;
    MT_CONFIRM_SHUTDOWN = 50;

    // identification of individual RTMessage submessages
    // field Container.rtmessage
    MT_RTMESSAGE0     = 30;
    MT_RTMESSAGE1     = 31;
    MT_RTMESSAGE2     = 32;
    MT_RTMESSAGE3     = 33;
    MT_RTMESSAGE4     = 34;


    MT_ASCII          = 100;
    MT_UNICODE        = 101;
    MT_GCODE          = 102;
    MT_PYTHON         = 103;
    MT_PICKLE         = 104;
    MT_TCL            = 105;
    MT_XML            = 106;
    MT_JSON           = 107;
    MT_JPEG           = 108;
    MT_PNG            = 109;
    MT_TIFF           = 110;
    MT_POSTSCRIPT     = 111;
    MT_SVG            = 112;

    // in-band zeroMQ commands, evaluated in webtalk_jsonpolicy.cc

    MT_ZMQ_SUBSCRIBE      = 150;
    MT_ZMQ_UNSUBSCRIBE   = 151;

    MT_PING            = 210;  // keepalive test
    MT_PING_ACKNOWLEDGE = 215;
    MT_REJECT          = 220;
    MT_DONE            = 240;

    // ask for a specific list of services as specified in a ServiceRequest
    MT_SERVICE_REQUEST      = 250;
    // respond to the above with one or several ServiceDescription messages
    MT_SERVICE_ANNOUNCEMENT = 251;
    // query for all available services
    MT_SERVICE_PROBE        = 252;

    // error message generated by messagebus
    // also fills in note, destinaton
    MT_MESSAGEBUS_NO_DESTINATION = 255;

    // rcomp creation and binding
    MT_HALRCOMP_BIND  = 256;
    MT_HALRCOMP_BIND_CONFIRM  = 257;
    MT_HALRCOMP_BIND_REJECT  = 258;

    // the following to a similar to MT_HALRCOMMAND_SET and  MT_HALRCOMMAND_GET, except
    // in the context of HALRcomp, only pins and params are evaluated
    // also, to set a pin or param, it must have direction HAL_OUT or HAL_IO
    MT_HALRCOMP_SET  = 259;
    MT_HALRCOMP_SET_REJECT  = 260;
    MT_HALRCOMP_ACK  = 263;

    // HAL object general setter/getter operations
    // these work as viewed from halcmd and include signals
    MT_HALRCOMMAND_SET = 265;
    MT_HALRCOMMAND_SET_REJECT = 266;

    MT_HALRCOMMAND_GET = 267;
    MT_HALRCOMMAND_GET_REJECT = 268;

    MT_HALRCOMMAND_CREATE = 269;
    MT_HALRCOMMAND_CREATE_REJECT = 270;

    MT_HALRCOMMAND_DELETE = 271;
    MT_HALRCOMMAND_DELETE_REJECT = 272;

    MT_HALRCOMMAND_ACK = 273;
    MT_HALRCOMMAND_ERROR = 274;

    // introspection request
    MT_HALRCOMMAND_DESCRIBE  = 276;
    // full HAL description 
    MT_HALRCOMMAND_DESCRIPTION  = 277;

    // rcomp tracking
    MT_HALRCOMP_FULL_UPDATE = 288;
    MT_HALRCOMP_INCREMENTAL_UPDATE = 289;
    MT_HALRCOMP_ERROR = 290;

    // group creation and binding
    MT_HALGROUP_BIND  = 294;
    MT_HALGROUP_BIND_CONFIRM  = 295;
    MT_HALGROUP_BIND_REJECT  = 296;

    // group tracking
    MT_HALGROUP_FULL_UPDATE = 297;
    MT_HALGROUP_INCREMENTAL_UPDATE = 298;
    MT_HALGROUP_ERROR = 299;


    // rtapi_app commands from halcmd:
    MT_RTAPI_APP_EXIT = 300;
    MT_RTAPI_APP_PING = 301;
    MT_RTAPI_APP_LOADRT = 302;
    MT_RTAPI_APP_LOG = 303;
    MT_RTAPI_APP_UNLOADRT= 305;
    MT_RTAPI_APP_NEWINST= 306;
    MT_RTAPI_APP_NEWTHREAD = 307;
    MT_RTAPI_APP_DELTHREAD = 308;
    MT_RTAPI_APP_CALLFUNC = 309;

    MT_RTAPI_APP_REPLY = 310;
    MT_RTAPI_APP_DELINST= 311;


    // application discovery
    MT_LIST_APPLICATIONS = 350;
    // this is answered with a MT_DESCRIBE_APPLICATION type
    // and repeated field apps
    // (see message Application)
    MT_DESCRIBE_APPLICATION = 351;

    MT_RETRIEVE_APPLICATION = 352;
    // this is answered with a MT_APPLICATION_DETAIL type and
    // a single field apps
    // BUT all files and config items are attached in the
    // message Application
    MT_APPLICATION_DETAIL = 353;

    // generic error reply. note field contains explanation.
    MT_ERROR = 360;

    // generic full update and incremental update
    MT_FULL_UPDATE = 370;
    MT_INCREMENTAL_UPDATE = 371;

    // generic cmd reply
    MT_CMD_COMPLETE = 380;

    // task/client comms
    MT_TASK_REPLY     = 400;
    MT_TICKET_UPDATE  = 401;

    // credit-based flow control for queues
    MT_CREDIT_UPDATE  = 450;  // sent by consumer

    // Motion command types. Frequently used, so bring in at offset 1000.
    // (see emc/motion/motion.h)

    // in case a Motion message type was added:
    // first run: make
    // then manually include protobuf/generated/mottypes.proto here

    // adjust this to be below lowest motion message type
    MT_EMCMOT_LOWER		= 1000;
    // adjust this to be above highest motion message type
    MT_EMCMOT_UPPER		= 1100;
    // neded for the  is_Motion_container(msgtype) test in container.hh

    // --- snip ---
    MT_EMCMOT_ABORT		= 1001;
    MT_EMCMOT_AXIS_ABORT		= 1002;
    MT_EMCMOT_ENABLE		= 1003;
    MT_EMCMOT_DISABLE		= 1004;
    MT_EMCMOT_ENABLE_AMPLIFIER		= 1005;
    MT_EMCMOT_DISABLE_AMPLIFIER		= 1006;
    MT_EMCMOT_ENABLE_WATCHDOG		= 1007;
    MT_EMCMOT_DISABLE_WATCHDOG		= 1008;
    MT_EMCMOT_ACTIVATE_JOINT		= 1009;
    MT_EMCMOT_DEACTIVATE_JOINT		= 1010;
    MT_EMCMOT_PAUSE		= 1011;
    MT_EMCMOT_RESUME		= 1012;
    MT_EMCMOT_STEP		= 1013;
    MT_EMCMOT_FREE		= 1014;
    MT_EMCMOT_COORD		= 1015;
    MT_EMCMOT_TELEOP		= 1016;
    MT_EMCMOT_SPINDLE_SCALE		= 1017;
    MT_EMCMOT_SS_ENABLE		= 1018;
    MT_EMCMOT_FEED_SCALE		= 1019;
    MT_EMCMOT_FS_ENABLE		= 1020;
    MT_EMCMOT_FH_ENABLE		= 1021;
    MT_EMCMOT_AF_ENABLE		= 1022;
    MT_EMCMOT_OVERRIDE_LIMITS		= 1023;
    MT_EMCMOT_HOME		= 1024;
    MT_EMCMOT_UNHOME		= 1025;
    MT_EMCMOT_JOG_CONT		= 1026;
    MT_EMCMOT_JOG_INCR		= 1027;
    MT_EMCMOT_JOG_ABS		= 1028;
    MT_EMCMOT_SET_LINE		= 1029;
    MT_EMCMOT_SET_CIRCLE		= 1030;
    MT_EMCMOT_SET_TELEOP_VECTOR		= 1031;
    MT_EMCMOT_CLEAR_PROBE_FLAGS		= 1032;
    MT_EMCMOT_PROBE		= 1033;
    MT_EMCMOT_RIGID_TAP		= 1034;
    MT_EMCMOT_SET_POSITION_LIMITS		= 1035;
    MT_EMCMOT_SET_BACKLASH		= 1036;
    MT_EMCMOT_SET_MIN_FERROR		= 1037;
    MT_EMCMOT_SET_MAX_FERROR		= 1038;
    MT_EMCMOT_SET_VEL		= 1039;
    MT_EMCMOT_SET_VEL_LIMIT		= 1040;
    MT_EMCMOT_SET_JOINT_VEL_LIMIT		= 1041;
    MT_EMCMOT_SET_JOINT_ACC_LIMIT		= 1042;
    MT_EMCMOT_SET_ACC		= 1043;
    MT_EMCMOT_SET_TERM_COND		= 1044;
    MT_EMCMOT_SET_NUM_AXES		= 1045;
    MT_EMCMOT_SET_WORLD_HOME		= 1046;
    MT_EMCMOT_SET_HOMING_PARAMS		= 1047;
    MT_EMCMOT_SET_DEBUG		= 1048;
    MT_EMCMOT_SET_DOUT		= 1049;
    MT_EMCMOT_SET_AOUT		= 1050;
    MT_EMCMOT_SET_SPINDLESYNC		= 1051;
    MT_EMCMOT_SPINDLE_ON		= 1052;
    MT_EMCMOT_SPINDLE_OFF		= 1053;
    MT_EMCMOT_SPINDLE_INCREASE		= 1054;
    MT_EMCMOT_SPINDLE_DECREASE		= 1055;
    MT_EMCMOT_SPINDLE_BRAKE_ENGAGE		= 1056;
    MT_EMCMOT_SPINDLE_BRAKE_RELEASE		= 1057;
    MT_EMCMOT_SET_MOTOR_OFFSET		= 1058;
    MT_EMCMOT_SET_JOINT_COMP		= 1059;
    MT_EMCMOT_SET_OFFSET		= 1060;
    MT_EMCMOT_COMMAND_OK		= 1061;
    MT_EMCMOT_COMMAND_UNKNOWN_COMMAND		= 1062;
    MT_EMCMOT_COMMAND_INVALID_COMMAND		= 1063;
    MT_EMCMOT_COMMAND_INVALID_PARAMS		= 1064;
    MT_EMCMOT_COMMAND_BAD_EXEC		= 1065;
    MT_EMCMOT_MOTION_DISABLED		= 1066;
    MT_EMCMOT_MOTION_FREE		= 1067;
    MT_EMCMOT_MOTION_TELEOP		= 1068;
    MT_EMCMOT_MOTION_COORD		= 1069;
    MT_EMCMOT_JOINT_FLAG		= 1070;
    MT_EMCMOT_MOTION_FLAG		= 1071;
    // --- snip ---

    // Miscellanous types

    MT_PRU_FIRMWARE          = 2048;

    // Mesanet firmware types: 3000 - 3999
    MT_MESA_5I20_FIRMWARE         = 3000;

    // a blob of unspecified content - for temporary use during development
    MT_BLOB           = 4000;

    // test message range: 5000-5100 - never used by core code
    MT_TEST1       = 5001;
    MT_TEST2       = 5002;
    MT_TEST3       = 5003;

    // NML messsage types are offset by 10000
    // reserved range 10000-13000
    //
    // example:
    //    EMC_OPERATOR_ERROR_TYPE has NMLTYPE 11
    // (see src/emc/nml_intf/emc.hh)
    // corresponding container type:
    //    MT_EMC_OPERATOR_ERROR		= 10011;
    // all the NML message types
    // just the first three for now as examples:

    // include the file protobuf/generated/emctypes.proto
    // in case an NML message types was added
    // first run make
    // then manually include protobuf/generated/emctypes.proto here


    // adjust this to be below lowest NML message type
    MT_EMC_NML_LOWER		= 10000;
    // adjust this to be above highest NML message type
    MT_EMC_NML_UPPER		= 13000;
    // neded for the  is_NML_container(msgtype) test in container.hh

    // --- snip ---
    MT_EMC_OPERATOR_ERROR		= 10011;
    MT_EMC_OPERATOR_TEXT		= 10012;
    MT_EMC_OPERATOR_DISPLAY		= 10013;
    MT_EMC_NULL		= 10021;
    MT_EMC_SET_DEBUG		= 10022;
    MT_EMC_SYSTEM_CMD		= 10030;
    MT_EMC_AXIS_SET_AXIS		= 10101;
    MT_EMC_AXIS_SET_UNITS		= 10102;
    MT_EMC_AXIS_SET_MIN_POSITION_LIMIT		= 10107;
    MT_EMC_AXIS_SET_MAX_POSITION_LIMIT		= 10108;

    MT_EMC_TOOL_START_CHANGE = 1110;
    MT_EMC_EXEC_PLUGIN_CALL = 1112;
    MT_EMC_IO_PLUGIN_CALL   =  1113;

    MT_EMC_AXIS_SET_FERROR	= 10111;
    MT_EMC_AXIS_SET_HOMING_PARAMS		= 10112;
    MT_EMC_AXIS_SET_MIN_FERROR		= 10115;
    MT_EMC_AXIS_SET_MAX_VELOCITY		= 10116;
    MT_EMC_AXIS_INIT		= 10118;
    MT_EMC_AXIS_HALT		= 10119;
    MT_EMC_AXIS_ABORT		= 10120;
    MT_EMC_AXIS_ENABLE		= 10121;
    MT_EMC_AXIS_DISABLE		= 10122;
    MT_EMC_AXIS_HOME		= 10123;
    MT_EMC_AXIS_UNHOME		= 10135;
    MT_EMC_AXIS_JOG		= 10124;
    MT_EMC_AXIS_INCR_JOG		= 10125;
    MT_EMC_AXIS_ABS_JOG		= 10126;
    MT_EMC_AXIS_ACTIVATE		= 10127;
    MT_EMC_AXIS_DEACTIVATE		= 10128;
    MT_EMC_AXIS_OVERRIDE_LIMITS		= 10129;
    MT_EMC_AXIS_LOAD_COMP		= 10131;
    MT_EMC_AXIS_SET_BACKLASH		= 10134;
    MT_EMC_AXIS_STAT		= 10199;
    MT_EMC_TRAJ_SET_AXES		= 10201;
    MT_EMC_TRAJ_SET_UNITS		= 10202;
    MT_EMC_TRAJ_SET_CYCLE_TIME		= 10203;
    MT_EMC_TRAJ_SET_MODE		= 10204;
    MT_EMC_TRAJ_SET_VELOCITY		= 10205;
    MT_EMC_TRAJ_SET_ACCELERATION		= 10206;
    MT_EMC_TRAJ_SET_MAX_VELOCITY		= 10207;
    MT_EMC_TRAJ_SET_MAX_ACCELERATION		= 10208;
    MT_EMC_TRAJ_SET_SCALE		= 10209;
    MT_EMC_TRAJ_SET_MOTION_ID		= 10210;
    MT_EMC_TRAJ_INIT		= 10211;
    MT_EMC_TRAJ_HALT		= 10212;
    MT_EMC_TRAJ_ENABLE		= 10213;
    MT_EMC_TRAJ_DISABLE		= 10214;
    MT_EMC_TRAJ_ABORT		= 10215;
    MT_EMC_TRAJ_PAUSE		= 10216;
    MT_EMC_TRAJ_STEP		= 10217;
    MT_EMC_TRAJ_RESUME		= 10218;
    MT_EMC_TRAJ_DELAY		= 10219;
    MT_EMC_TRAJ_LINEAR_MOVE		= 10220;
    MT_EMC_TRAJ_CIRCULAR_MOVE		= 10221;
    MT_EMC_TRAJ_SET_TERM_COND		= 10222;
    MT_EMC_TRAJ_SET_OFFSET		= 10223;
    MT_EMC_TRAJ_SET_G5X		= 10224;
    MT_EMC_TRAJ_SET_HOME		= 10225;
    MT_EMC_TRAJ_SET_ROTATION		= 10226;
    MT_EMC_TRAJ_SET_G92		= 10227;
    MT_EMC_TRAJ_CLEAR_PROBE_TRIPPED_FLAG		= 10228;
    MT_EMC_TRAJ_PROBE		= 10229;
    MT_EMC_TRAJ_SET_TELEOP_ENABLE		= 10230;
    MT_EMC_TRAJ_SET_TELEOP_VECTOR		= 10231;
    MT_EMC_TRAJ_SET_SPINDLESYNC		= 10232;
    MT_EMC_TRAJ_SET_SPINDLE_SCALE		= 10233;
    MT_EMC_TRAJ_SET_FO_ENABLE		= 10234;
    MT_EMC_TRAJ_SET_SO_ENABLE		= 10235;
    MT_EMC_TRAJ_SET_FH_ENABLE		= 10236;
    MT_EMC_TRAJ_RIGID_TAP		= 10237;
    MT_EMC_TRAJ_SET_RAPID_SCALE		= 10238;
    MT_EMC_TRAJ_STAT		= 10299;
    MT_EMC_MOTION_INIT		= 10301;
    MT_EMC_MOTION_HALT		= 10302;
    MT_EMC_MOTION_ABORT		= 10303;
    MT_EMC_MOTION_SET_AOUT		= 10304;
    MT_EMC_MOTION_SET_DOUT		= 10305;
    MT_EMC_MOTION_ADAPTIVE		= 10306;

    MT_EMC_SPINDLE_ORIENT               = 10317;
    MT_EMC_SPINDLE_WAIT_ORIENT_COMPLETE = 10318;


    MT_EMC_MOTION_STAT		= 10399;
    MT_EMC_TASK_INIT		= 10501;
    MT_EMC_TASK_HALT		= 10502;
    MT_EMC_TASK_ABORT		= 10503;
    MT_EMC_TASK_SET_MODE		= 10504;
    MT_EMC_TASK_SET_STATE		= 10505;
    MT_EMC_TASK_PLAN_OPEN		= 10506;
    MT_EMC_TASK_PLAN_RUN		= 10507;
    MT_EMC_TASK_PLAN_READ		= 10508;
    MT_EMC_TASK_PLAN_EXECUTE		= 10509;
    MT_EMC_TASK_PLAN_PAUSE		= 10510;
    MT_EMC_TASK_PLAN_STEP		= 10511;
    MT_EMC_TASK_PLAN_RESUME		= 10512;
    MT_EMC_TASK_PLAN_END		= 10513;
    MT_EMC_TASK_PLAN_CLOSE		= 10514;
    MT_EMC_TASK_PLAN_INIT		= 10515;
    MT_EMC_TASK_PLAN_SYNCH		= 10516;
    MT_EMC_TASK_PLAN_SET_OPTIONAL_STOP		= 10517;
    MT_EMC_TASK_PLAN_SET_BLOCK_DELETE		= 10518;
    MT_EMC_TASK_PLAN_OPTIONAL_STOP		= 10519;
    MT_EMC_TASK_PLAN_RESET		= 10520;
    MT_EMC_TASK_PLAN_REPLY	= 10530;
    MT_EMC_TASK_STAT		= 10599;
    MT_EMC_TOOL_INIT		= 11101;
    MT_EMC_TOOL_HALT		= 11102;
    MT_EMC_TOOL_ABORT		= 11103;
    MT_EMC_TOOL_PREPARE		= 11104;
    MT_EMC_TOOL_LOAD		= 11105;
    MT_EMC_TOOL_UNLOAD		= 11106;
    MT_EMC_TOOL_LOAD_TOOL_TABLE		= 11107;
    MT_EMC_TOOL_SET_OFFSET		= 11108;
    MT_EMC_TOOL_SET_NUMBER		= 11109;
    MT_EMC_TOOL_UPDATE_TOOL_TABLE = 11110;
    MT_EMC_TOOL_STAT		= 11199;
    MT_EMC_AUX_ESTOP_ON		= 11206;
    MT_EMC_AUX_ESTOP_OFF		= 11207;
    MT_EMC_AUX_ESTOP_RESET		= 11208;
    MT_EMC_AUX_INPUT_WAIT		= 11209;
    MT_EMC_AUX_STAT		= 11299;
    MT_EMC_SPINDLE_ON		= 11304;
    MT_EMC_SPINDLE_OFF		= 11305;
    MT_EMC_SPINDLE_INCREASE		= 11309;
    MT_EMC_SPINDLE_DECREASE		= 11310;
    MT_EMC_SPINDLE_CONSTANT		= 11311;
    MT_EMC_SPINDLE_BRAKE_RELEASE		= 11312;
    MT_EMC_SPINDLE_BRAKE_ENGAGE		= 11313;
    MT_EMC_SPINDLE_SPEED		= 11316;
    MT_EMC_SPINDLE_STAT		= 11399;
    MT_EMC_COOLANT_MIST_ON		= 11404;
    MT_EMC_COOLANT_MIST_OFF		= 11405;
    MT_EMC_COOLANT_FLOOD_ON		= 11406;
    MT_EMC_COOLANT_FLOOD_OFF		= 11407;
    MT_EMC_COOLANT_STAT		= 11499;
    MT_EMC_LUBE_ON		= 11504;
    MT_EMC_LUBE_OFF		= 11505;
    MT_EMC_LUBE_STAT		= 11599;
    MT_EMC_IO_INIT		= 11601;
    MT_EMC_IO_HALT		= 11602;
    MT_EMC_IO_ABORT		= 11603;
    MT_EMC_IO_SET_CYCLE_TIME		= 11604;
    MT_EMC_IO_STAT		= 11699;
    MT_EMC_INIT		= 11901;
    MT_EMC_HALT		= 11902;
    MT_EMC_ABORT		= 11903;
    MT_EMC_STAT		= 11999;
    // --- snip ---

    // EMC status
    MT_EMCSTAT_FULL_UPDATE = 12500;
    MT_EMCSTAT_INCREMENTAL_UPDATE = 12501;

    // EMC error
    MT_EMC_NML_ERROR = 12510;
    MT_EMC_NML_TEXT = 12511;
    MT_EMC_NML_DISPLAY = 12512;

    // EMC command
    MT_EMCCMD_EXECUTED = 12520;
    MT_EMCCMD_COMPLETED = 12521;

    // launcher pub-sub
    MT_LAUNCHER_FULL_UPDATE = 12600;
    MT_LAUNCHER_INCREMENTAL_UPDATE = 12601;
    MT_LAUNCHER_ERROR = 12602;
    // launcher command
    MT_LAUNCHER_START = 12610;
    MT_LAUNCHER_TERMINATE = 12611;
    MT_LAUNCHER_KILL = 12612;
    MT_LAUNCHER_WRITE_STDIN = 12613;
    MT_LAUNCHER_CALL = 12614;
    MT_LAUNCHER_SHUTDOWN = 12615;
    MT_LAUNCHER_SET = 12616;

    // remote file
    MT_FILE_GET     = 12700;
    MT_FILE_PUT     = 12701;
    MT_FILE_LS      = 12702;
    MT_FILE_MKDIR   = 12703;
    MT_FILE_DELETE  = 12704;
    MT_FILE_DATA    = 12705;
    MT_FILE_LISTING = 12706;
}

enum OriginIndex {
    ORIGIN_UNKNOWN = 0;
    ORIGIN_G54 = 1;
    ORIGIN_G55 = 2;
    ORIGIN_G56 = 3;
    ORIGIN_G57 = 4;
    ORIGIN_G58 = 5;
    ORIGIN_G59 = 6;
    ORIGIN_G59_1 = 7;
    ORIGIN_G59_2 = 8;
    ORIGIN_G59_3 = 9;
    ORIGIN_G54_1 = 10; /// extended origin
}


// add leading _ to avoid collision with macros in emc.hh
enum TermConditionType {
    _EMC_TRAJ_TERM_COND_STOP = 1;
    _EMC_TRAJ_TERM_COND_BLEND = 2;
}

enum CanonDirection {
    _CANON_STOPPED = 1;
    _CANON_CLOCKWISE = 2;
    _CANON_COUNTERCLOCKWISE = 3;
}

enum InputType {
    _ANALOG_INPUT = 0;
    _DIGITAL_INPUT = 1;
}

enum WaitType {
    IMMEDIATE = 0;
    RISE = 1;
    FALL = 2;
    BE_HIGH = 3;
    BE_LOW = 4;
}

// types for EMC_TASK interpState
enum InterpreterStateType {
    INTERP_IDLE        = 1;
    INTERP_RUNNING     = 2;
    INTERP_SYNC_WAIT   = 3;
    INTERP_PAUSED      = 4;
    INTERP_QUEUE_WAIT  = 5;
    INTERP_ABORT_WAIT  = 6;
    INTERP_STATE_UNSET = 99; // to ease change tracking
};
