//
//  _   _         ______    _ _ _   _             _ _ _
// | \ | |       |  ____|  | (_) | (_)           | | | |
// |  \| | ___   | |__   __| |_| |_ _ _ __   __ _| | | |
// | . ` |/ _ \  |  __| / _` | | __| | '_ \ / _` | | | |
// | |\  | (_) | | |___| (_| | | |_| | | | | (_| |_|_|_|
// |_| \_|\___/  |______\__,_|_|\__|_|_| |_|\__, (_|_|_)
//                                           __/ |
//                                          |___/
// 
// This file is auto-generated. Do not edit manually
// 
// Copyright 2013 Automatak LLC
// 
// Automatak LLC (www.automatak.com) licenses this file
// to you under the the Apache License Version 2.0 (the "License"):
// 
// http://www.apache.org/licenses/LICENSE-2.0.html
//

#ifndef OPENDNP3_FUNCTIONCODE_H
#define OPENDNP3_FUNCTIONCODE_H

#include <cstdint>

namespace opendnp3 {

/**
  Application layer function code enumeration
*/
enum class FunctionCode : uint8_t
{
  /// Master sends this to an outstation to confirm the receipt of an Application Layer fragment
  CONFIRM = 0x0,
  /// Outstation shall return the data specified by the objects in the request
  READ = 0x1,
  /// Outstation shall store the data specified by the objects in the request
  WRITE = 0x2,
  /// Outstation shall select (or arm) the output points specified by the objects in the request in preparation for a subsequent operate command
  SELECT = 0x3,
  /// Outstation shall activate the output points selected (or armed) by a previous select function code command
  OPERATE = 0x4,
  /// Outstation shall immediately actuate the output points specified by the objects in the request
  DIRECT_OPERATE = 0x5,
  /// Same as DIRECT_OPERATE but outstation shall not send a response
  DIRECT_OPERATE_NR = 0x6,
  /// Outstation shall copy the point data values specified by the objects in the request to a separate freeze buffer
  IMMED_FREEZE = 0x7,
  /// Same as IMMED_FREEZE but outstation shall not send a response
  IMMED_FREEZE_NR = 0x8,
  /// Outstation shall copy the point data values specified by the objects in the request into a separate freeze buffer and then clear the values
  FREEZE_CLEAR = 0x9,
  /// Same as FREEZE_CLEAR but outstation shall not send a response
  FREEZE_CLEAR_NR = 0xA,
  /// Outstation shall copy the point data values specified by the objects in the request to a separate freeze buffer at the time and/or time intervals specified in a special time data information object
  FREEZE_AT_TIME = 0xB,
  /// Same as FREEZE_AT_TIME but outstation shall not send a response
  FREEZE_AT_TIME_NR = 0xC,
  /// Outstation shall perform a complete reset of all hardware and software in the device
  COLD_RESTART = 0xD,
  /// Outstation shall reset only portions of the device
  WARM_RESTART = 0xE,
  /// Obsolete-Do not use for new designs
  INITIALIZE_DATA = 0xF,
  /// Outstation shall place the applications specified by the objects in the request into the ready to run state
  INITIALIZE_APPLICATION = 0x10,
  /// Outstation shall start running the applications specified by the objects in the request
  START_APPLICATION = 0x11,
  /// Outstation shall stop running the applications specified by the objects in the request
  STOP_APPLICATION = 0x12,
  /// This code is deprecated-Do not use for new designs
  SAVE_CONFIGURATION = 0x13,
  /// Enables outstation to initiate unsolicited responses from points specified by the objects in the request
  ENABLE_UNSOLICITED = 0x14,
  /// Prevents outstation from initiating unsolicited responses from points specified by the objects in the request
  DISABLE_UNSOLICITED = 0x15,
  /// Outstation shall assign the events generated by the points specified by the objects in the request to one of the classes
  ASSIGN_CLASS = 0x16,
  /// Outstation shall report the time it takes to process and initiate the transmission of its response
  DELAY_MEASURE = 0x17,
  /// Outstation shall save the time when the last octet of this message is received
  RECORD_CURRENT_TIME = 0x18,
  /// Outstation shall open a file
  OPEN_FILE = 0x19,
  /// Outstation shall close a file
  CLOSE_FILE = 0x1A,
  /// Outstation shall delete a file
  DELETE_FILE = 0x1B,
  /// Outstation shall retrieve information about a file
  GET_FILE_INFO = 0x1C,
  /// Outstation shall return a file authentication key
  AUTHENTICATE_FILE = 0x1D,
  /// Outstation shall abort a file transfer operation
  ABORT_FILE = 0x1E,
  /// The master uses this function code when sending authentication requests to the outstation
  AUTH_REQUEST = 0x20,
  /// The master uses this function code when sending authentication requests to the outstation that do no require acknowledgement
  AUTH_REQUEST_NO_ACK = 0x21,
  /// Master shall interpret this fragment as an Application Layer response to an ApplicationLayer request
  RESPONSE = 0x81,
  /// Master shall interpret this fragment as an unsolicited response that was not prompted by an explicit request
  UNSOLICITED_RESPONSE = 0x82,
  /// The outstation uses this function code to issue authentication messages to the master
  AUTH_RESPONSE = 0x83,
  /// Unknown function code. Used internally in opendnp3 to indicate the code didn't match anything known
  UNKNOWN = 0xFF
};

uint8_t FunctionCodeToType(FunctionCode arg);
FunctionCode FunctionCodeFromType(uint8_t arg);
char const* FunctionCodeToString(FunctionCode arg);

}

#endif
