// Auto-generated. Do not edit!

// (in-package chemspeed_flex_msgs.msg)


"use strict";

const _serializer = _ros_msg_utils.Serialize;
const _arraySerializer = _serializer.Array;
const _deserializer = _ros_msg_utils.Deserialize;
const _arrayDeserializer = _deserializer.Array;
const _finder = _ros_msg_utils.Find;
const _getByteLength = _ros_msg_utils.getByteLength;

//-----------------------------------------------------------

class CSFlexCommand {
  constructor(initObj={}) {
    if (initObj === null) {
      // initObj === null is a special case for deserialization where we don't initialize fields
      this.cs_flex_command = null;
    }
    else {
      if (initObj.hasOwnProperty('cs_flex_command')) {
        this.cs_flex_command = initObj.cs_flex_command
      }
      else {
        this.cs_flex_command = 0;
      }
    }
  }

  static serialize(obj, buffer, bufferOffset) {
    // Serializes a message object of type CSFlexCommand
    // Serialize message field [cs_flex_command]
    bufferOffset = _serializer.int32(obj.cs_flex_command, buffer, bufferOffset);
    return bufferOffset;
  }

  static deserialize(buffer, bufferOffset=[0]) {
    //deserializes a message object of type CSFlexCommand
    let len;
    let data = new CSFlexCommand(null);
    // Deserialize message field [cs_flex_command]
    data.cs_flex_command = _deserializer.int32(buffer, bufferOffset);
    return data;
  }

  static getMessageSize(object) {
    return 4;
  }

  static datatype() {
    // Returns string type for a message object
    return 'chemspeed_flex_msgs/CSFlexCommand';
  }

  static md5sum() {
    //Returns md5sum for a message object
    return 'eb8f79259cc9a1065fb86a952380edb9';
  }

  static messageDefinition() {
    // Returns full string definition for message
    return `
    int32 OPEN_DOOR = 0
    int32 CLOSE_DOOR = 1
    int32 RUN_APP = 2
    int32 TERMINATE = 4
    
    int32 cs_flex_command
    
    `;
  }

  static Resolve(msg) {
    // deep-construct a valid message object instance of whatever was passed in
    if (typeof msg !== 'object' || msg === null) {
      msg = {};
    }
    const resolved = new CSFlexCommand(null);
    if (msg.cs_flex_command !== undefined) {
      resolved.cs_flex_command = msg.cs_flex_command;
    }
    else {
      resolved.cs_flex_command = 0
    }

    return resolved;
    }
};

// Constants for message
CSFlexCommand.Constants = {
  OPEN_DOOR: 0,
  CLOSE_DOOR: 1,
  RUN_APP: 2,
  TERMINATE: 4,
}

module.exports = CSFlexCommand;
