//========================================================================
// Skyline Robotics robot control protocol definitions
//
// AUTHOR:  Gabor Nagy
// DATE:    2015-Oct-01 04:42:09
//
// Copyright (C) 1996-2026 By Gabor Nagy. All rights reserved.
//========================================================================
#ifndef SR_Protocol_h
#define SR_Protocol_h


// Bit 0 indicates that it's a response
//
enum
{
	SrCONNECT             = 0x02,
	SrCONNECT_RESPONSE    = 0x03,
	SrALIVECHECK          = 0x04,
	SrALIVECHECK_RESPONSE = 0x05,
	SrMOTORS_SET          = 0x06,
	SrMOTORS_SET_RESPONSE = 0x07,
	SrMOTORS_GET          = 0x08,
	SrMOTORS_GET_RESPONSE = 0x09
};

// SrMOTORS_SET / SrMOTORS_GET field flags
#define SrMOTOR_POSITION_MIN       0x0001
#define SrMOTOR_POSITION_MAX       0x0002
#define SrMOTOR_POSITION_CURRENT   0x0004  // Go to this position
#define SrMOTOR_POSITION_TARGET    0x0008  // Set this as the current position (for calibration)
#define SrMOTOR_ACCELERATION       0x0010
#define SrMOTOR_DECELERATION       0x0020
#define SrMOTOR_SPEED_MAX          0x0040
#define SrMOTOR_POWER_HOLDING      0x0080
#define SrMOTOR_POWER_MAX          0x0100

#define Sr_SocketType  EnUDP
//#define Sr_SocketType  EnTCPIP

#endif // SR_Protocol_h
