// 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 CSFlexStatus {
  constructor(initObj={}) {
    if (initObj === null) {
      // initObj === null is a special case for deserialization where we don't initialize fields
      this.cs_flex_status = null;
    }
    else {
      if (initObj.hasOwnProperty('cs_flex_status')) {
        this.cs_flex_status = initObj.cs_flex_status
      }
      else {
        this.cs_flex_status = 0;
      }
    }
  }

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

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

  static getMessageSize(object) {
    return 4;
  }

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

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

  static messageDefinition() {
    // Returns full string definition for message
    return `
    int32 DOOR_OPEN = 0
    int32 DOOR_CLOSED = 1
    int32 RUNNING_JOB = 2
    int32 JOB_COMPLETE = 3
    int32 ERROR = -1
    
    int32 cs_flex_status
    
    `;
  }

  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 CSFlexStatus(null);
    if (msg.cs_flex_status !== undefined) {
      resolved.cs_flex_status = msg.cs_flex_status;
    }
    else {
      resolved.cs_flex_status = 0
    }

    return resolved;
    }
};

// Constants for message
CSFlexStatus.Constants = {
  DOOR_OPEN: 0,
  DOOR_CLOSED: 1,
  RUNNING_JOB: 2,
  JOB_COMPLETE: 3,
  ERROR: -1,
}

module.exports = CSFlexStatus;
