/*
 * zFireSync.h
 * 
 * The Zen API 
 * Copyright (C) 2008-2010 by LMI Technologies Inc.
 * 
 * Licensed under The MIT License.
 * Redistributions of files must retain the above copyright notice.
 */
#ifndef LMITECH_ZFIRESYNC_H_INCLUDED
#define LMITECH_ZFIRESYNC_H_INCLUDED

#include <zNetwork.h>
#include <zResult.h>
#include <zApiBegin.h>

typedef enum zFireSyncChannel
{
    zFIRESYNC_CHANNEL_UPGRADE       = 0x0001,           // Server upgrade channel.
    zFIRESYNC_CHANNEL_MANAGEMENT    = 0x0002,           // Server management channel.
    zFIRESYNC_CHANNEL_CONTROL       = 0x0004,           // Server control channel.
    zFIRESYNC_CHANNEL_ALL           = 0x0007            // Any/all server command channels.
} zFireSyncChannel;                                     // FireSync command connection type.

typedef enum zDeviceType
{
    zDEVICE_TYPE_SENSOR             = 0x0001,           // Sensor device type.
    zDEVICE_TYPE_MASTER             = 0x0002,           // Master device type.
    zDEVICE_TYPE_STATION            = 0x0004            // Station device type.
} zDeviceType;                                          // FireSync device type.

typedef struct zAddressInfo
{   
    zBool useDhcp;                                      // FireSync Server uses DHCP?
    zIPAddress address;                                 // FireSync Server IP address setting.
    zIPAddress mask;                                    // FireSync Server IP mask setting.
    zIPAddress gateway;                                 // FireSync Server IP gateway setting.
    zIPAddress fireSync;                                // IP Address of server inside FireSync 90.x.x.x network (deprecated in FHP 2.0; set to zero).
} zAddressInfo;                                         // Network address settings for a FireSync server.

typedef struct zDeviceInfo                              
{
    z32u id;                                            // Device identifier (i.e. serial number).
    zText32 model;                                      // Model identifier string.
    zDeviceType type;                                   // Device type.
    zBool isServer;                                     // Device provides FireSync server interface?
} zDeviceInfo;                                          // FireSync device information.

typedef enum zFireSyncState
{
    zFIRESYNC_STATE_ERROR           = 1,                // System has detected errors that prevent it from running.
    zFIRESYNC_STATE_READY           = 2,                // System is ready to run.
    zFIRESYNC_STATE_RUNNING         = 3,                // System is ready to running.
    zFIRESYNC_STATE_STANDBY         = 4,                // System is paused.
    zFIRESYNC_STATE_BOOT_CONFLICT   = 5,                // System has detected errors that prevent it from running (deprecated in FHP 2.0+).
} zFireSyncState;                                       // Represents the state of a FireSync system. 

typedef zHandle zFireSync;                              // Represents a set of FireSync command connections.

ZAPI_EXPORT(zStatus) zFireSync_Discover(z32u** deviceIds, zAddressInfo** addresses, z32u* count); //
//
//  Description:
//      Locates unknown FireSync servers and reports their network address settings.
//  Arguments:
//      deviceIds - Receives sorted list of device identifiers of discovered servers.
//      addresses - Receives network address configurations of discovered servers.
//      count - Receives count of detected servers.
//  Remarks: 
//      This function uses UDP broadcast messages to locate FHP servers. The servers and the client
//      may be on different subnets.
//  Remarks: 
//      The function is supported in FHP 2.1+; 

ZAPI_EXPORT(zStatus) zFireSync_GetAddress(z32u deviceId, zAddressInfo* address); //
//
//  Description:
//      Locates a FireSync server by id (serial number) and reports its network address settings.
//  Arguments:
//      deviceId - Serial number of the server.
//      address - Receives current address configuration if the server was found. 
//  Remarks: 
//      This function uses UDP broadcast messages to locate FHP servers. The servers and client
//      may be on different subnets.

ZAPI_EXPORT(zStatus) zFireSync_SetAddress(z32u deviceId, const zAddressInfo* address); //
//
//  Description:
//      Locates a FireSync server by id (serial number) and configures its network address settings.
//  Arguments:
//      deviceId - Serial number of the server.
//      address - New address configuration for the server. 
//  Remarks: 
//      This function uses UDP broadcast messages to locate FHP servers. The servers and client
//      may be on different subnets.

ZAPI_EXPORT(zStatus) zFireSync_Construct(zFireSync* fireSync); //
//
//  Description:
//      Constructs a zFireSync object. 
//  Arguments:
//      fireSync - Receives a handle to the constructed object. 
//  Remarks:
//      Constructing a zFireSync object does not automatically open server connections;
//      use zFireSync_Connect to establish connections.  The functions in this class do not 
//      protect against access from multiple threads.

ZAPI_EXPORT(zStatus) zFireSync_Destroy(zFireSync fireSync); //
//
//  Description:
//      Destroys a zFireSync object. 
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks: 
//      Destroying the zFireSync object will close any open control connections (Upgrade, 
//      Management, Control).

ZAPI_EXPORT(zStatus) zFireSync_Connect(zFireSync fireSync, zFireSyncChannel channels, zIPAddress server); //
//
//  Description:
//      Connects to a FireSync server on the Upgrade, Management, and/or Control channels.
//  Arguments:
//      fireSync - zFireSync object. 
//      channels - The channels to connect; use zFIRESYNC_CHANNEL_ALL to open all channels.
//      ipAddress - IP address of the FireSync server device.

ZAPI_EXPORT(zStatus) zFireSync_Disconnect(zFireSync fireSync, zFireSyncChannel channels); //
//
//  Description:
//      Closes one or more open control channels to a FireSync server. 
//  Arguments:
//      fireSync - zFireSync object. 
//      channels - The channels to close; use zFIRESYNC_CHANNEL_ALL to close all channels.

ZAPI_EXPORT(zBool) zFireSync_IsConnected(zFireSync fireSync, zFireSyncChannel channel); //
//
//  Description:
//      Determines whether a connection has been established on the specified channel. 
//  Arguments:
//      fireSync - zFireSync object. 
//      channel - The channel to check.

ZAPI_EXPORT(zStatus) zFireSync_LocalEndPoint(zFireSync fireSync, zFireSyncChannel channel, zIPEndPoint* endPoint); //
//
//  Description:
//      Gets the local end point to which the specified channel is bound.
//  Arguments:
//      fireSync - zFireSync object. 
//      channel - The channel whose local end point information should be returned. 
//      endPoint - Receives end-point information.

ZAPI_EXPORT(zStatus) zFireSync_RemoteEndPoint(zFireSync fireSync, zFireSyncChannel channel, zIPEndPoint* endPoint); //
//
//  Description:
//      Gets the remote end point to which the specified channel is connected.
//  Arguments:
//      fireSync - zFireSync object. 
//      channel - The channel whose remote end point information should be returned. 
//      endPoint - Receives end-point information.

ZAPI_EXPORT(zStatus) zFireSync_StartActiveHealth(zFireSync fireSync, zIPAddress receiver, z32u port); //
//
//  Description:
//      Commands FireSync server to begin sending health messages to specified receiver. 
//  Arguments:
//      fireSync - zFireSync object. 
//      receiver - IP address of health receiver.
//      port - Port at which the health receiver is listening.
//  Remarks:
//      This function uses the Management channel. 
//  Remarks: 
//      If this call is successful, FireSync server will open a connection to the specified port and begin 
//      transmitting health messages. A zReceiver object can be used to accept the incoming connection from FireSync 
//      server and to receive health messages.

ZAPI_EXPORT(zStatus) zFireSync_StopActiveHealth(zFireSync fireSync); //
//
//  Description:
//      Commands FireSync server to close the health connection, if currenly open.
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks:
//      This function uses the Management channel.

ZAPI_EXPORT(zStatus) zFireSync_PassiveHealthEndPoint(zFireSync fireSync, zIPEndPoint* endPoint); //
//
//  Description:
//      Returns the IP end point for passive health connections.
//  Remarks:
//      This function uses the Management channel. 
//  Arguments:
//      fireSync - zFireSync object. 
//      endPoint - End point to which passive health connections can be established. 

ZAPI_EXPORT(zStatus) zFireSync_StartActiveEvents(zFireSync fireSync, zIPAddress receiver, z32u port); //
//
//  Description:
//      Commands FireSync server to begin sending event messages to specified receiver. 
//  Arguments:
//      fireSync - zFireSync object. 
//      receiver - IP address of event receiver.
//      port - Port at which the event receiver is listening.
//  Remarks:
//      This function uses the Control channel. 
//  Remarks: 
//      If this call is successful, FireSync server will open a connection to the specified port and begin 
//      transmitting event messages. A zReceiver object can be used to accept the incoming connection from FireSync 
//      server and to receive event messages.

ZAPI_EXPORT(zStatus) zFireSync_StopActiveEvents(zFireSync fireSync); //
//
//  Description:
//      Commands FireSync server to close the event connection, if currenly open.
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks:
//      This function uses the Control channel.

ZAPI_EXPORT(zStatus) zFireSync_PassiveEventEndPoint(zFireSync fireSync, zIPEndPoint* endPoint); //
//
//  Description:
//      Returns the IP end point for passive event connections.
//  Remarks:
//      This function uses the Control channel. 
//  Arguments:
//      fireSync - zFireSync object. 
//      endPoint - End point to which passive event connections can be established. 

ZAPI_EXPORT(zStatus) zFireSync_EnableActiveData(zFireSync fireSync, zIPAddress receiver, z32u port, z32u dataChannel); //
//
//  Description:
//      Enables a FireSync server active data channel and associates the data channel with the specified destination. 
//  Arguments:
//      fireSync - zFireSync object. 
//      receiver - IP address of data receiver.
//      port - Port at which the data receiver is listening.
//      dataChannel - FireSync server data channel ID (0-63). 
//  Remarks:
//      This function uses the Control channel and can be called only when the system is stopped. 
//  Remarks:
//      When the zFireSync_Start function is called, the server will open an active data channel to the specified receiver.  
//      A zReceiver object can be used to accept the incoming connection from FireSync server and to receive 
//      data messages.   

ZAPI_EXPORT(zStatus) zFireSync_EnablePassiveData(zFireSync fireSync, z32u dataChannel, zIPEndPoint* sender); //
//
//  Description:
//      Enables a FireSync server passive data channel and provides the end-point to which a receiver can connect.
//  Arguments:
//      fireSync - zFireSync object. 
//      dataChannel - FireSync server data channel ID (0-63). 
//      sender - IP end point of the passive sender. 
//  Remarks:
//      This function uses the Control channel and can be called only when the system is stopped. 
//  Remarks:
//      A zReceiver object can be used to connect to the FireSync server at the sender address, and to receive 
//      data messages. When the zFireSync_Start function is called, the server will send data messages to 
//      any connected passive receivers.  

ZAPI_EXPORT(zStatus) zFireSync_DisableData(zFireSync fireSync, z32u dataChannel); //
//
//  Description:
//      Disables an active or passive FireSync server data channel. 
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks:
//      This function uses the Control channel and can be called only when the system is stopped. 

ZAPI_EXPORT(z32u) zFireSync_FileCount(zFireSync fireSync); //
//
//  Description:
//      Reports the number of files available from the FireSync server.
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks:
//      This function uses the Control channel. 
//  Remarks: 
//      The function is supported in FHP version 2.1+; 

ZAPI_EXPORT(zStatus) zFireSync_FileNameAt(zFireSync fireSync, z32u index, zChar* name, z32u capacity); //
//
//  Description:
//      Gets the name of the file at the specified index. 
//  Arguments:
//      fireSync - zFireSync object. 
//      index - index of the file.
//      name - Receives the name of the file.
//      capacity - Maximum capacity of the name buffer, including null terminator.
//  Remarks:
//      Call the zFireSync_FileCount to get an up-to-date count of available files, then call this 
//      function to access the list of file names.
//  Remarks:
//      This function uses the Control channel. 
//  Remarks: 
//      The function is supported in FHP version 2.1+; 

ZAPI_EXPORT(zStatus) zFireSync_WriteFile(zFireSync fireSync, const zChar* fileName, const zByte* data, zUIntPtr size, zBool commit); //
//
//  Description:
//      Saves the given file on FireSync server.  
//  Arguments:
//      fireSync - zFireSync object. 
//      fileName - Name of the file to save.
//      data - Contents of the file. 
//      size - Size of the file, in bytes. 
//      commit - If true, the file will be committed to non-volatile storage. 
//  Remarks:
//      This function uses the Control channel.  If a file with the same name already exists, the file will 
//      be overwritten.
//  Remarks: 
//      If the commit parameter is false, then the file may or may not be committed to storage.  Files that are
//      not committed to storage will be lost when the server is re-powered.  The commit parameter is typically
//      set to false when writing temporary files to the server; this can reduce flash/disk wear when used with 
//      server devices that support volatile files. 

ZAPI_EXPORT(zStatus) zFireSync_ReadFile(zFireSync fireSync, const zChar* fileName, zByte** data, zUIntPtr* size); //
//
//  Description:
//      Reads the specified file from FireSync server.  
//  Arguments:
//      fireSync - zFireSync object. 
//      fileName - Name of the file to read.
//      data - Receives contents of the file (see notes).
//      size - Receives size of the file, in bytes. 
//  Remarks:
//      This function uses the Control channel. Memory allocated and returned by this function 
//      should be freed using the zFree function.

ZAPI_EXPORT(zStatus) zFireSync_CopyFile(zFireSync fireSync, const zChar* source, const zChar* destination); //
//
//  Description:
//      Copies the specified file within a FireSync server. 
//  Arguments:
//      fireSync - zFireSync object. 
//      source - Source name of the file to be copied.
//      destination - Desination name of the file to be copied.
//  Remarks:
//      This function uses the Control channel.  If a file with the same name already exists, the file will 
//      be overwritten.
//  Remarks: 
//      The function is supported in FHP version 2.1+; 

ZAPI_EXPORT(zStatus) zFireSync_DeleteFile(zFireSync fireSync, const zChar* fileName); //
//
//  Description:
//      Deletes the specified file from FireSync server.  
//  Arguments:
//      fireSync - zFireSync object. 
//      fileName - Name of the file to delete.
//  Remarks:
//      This function uses the Control channel. 

ZAPI_EXPORT(zStatus) zFireSync_SetMode(zFireSync fireSync, const zChar* mode); //
//
//  Description:
//      Sets the current mode of the system. 
//  Arguments:
//      fireSync - zFireSync object. 
//      mode - Name of the desired mode.
//  Remarks:
//      This function uses the Control channel. Modes are product-specific; see the 
//      user's guide for your FireSync product to learn about available modes.

ZAPI_EXPORT(zStatus) zFireSync_GetMode(zFireSync fireSync, zChar* mode, z32u capacity); //
//
//  Description:
//      Gets the current mode of the system. 
//  Arguments:
//      fireSync - zFireSync object. 
//      mode - Name of the current mode.
//      capacity - Maximum number of characters (including null terminator). 
//  Remarks:
//      This function uses the Control channel. Modes are product-specific; see the 
//      user's guide for your FireSync product to learn about available modes.

ZAPI_EXPORT(zStatus) zFireSync_SetParameter(zFireSync fireSync, const zChar* mode, const zChar* parameter, z64s value); //
//
//  Description:
//      Sets the value of a dynamic parameter associated with the specified mode. 
//  Arguments:
//      fireSync - zFireSync object. 
//      mode - Name of the mode, or zNULL for the current mode.
//      parameter - Name of the parameter.
//      value - Value of the parameter.
//  Remarks:
//      This function uses the Control channel. Parameters are product-specific; see the 
//      user's guide for your FireSync product to learn about available parameters.

ZAPI_EXPORT(zStatus) zFireSync_GetParameter(zFireSync fireSync, const zChar* mode, const zChar* parameter, z64s* value); //
//
//  Description:
//      Gets the value of a dynamic parameter associated with the specified mode. 
//  Arguments:
//      fireSync - zFireSync object. 
//      mode - Name of the mode, or zNULL for the current mode.
//      parameter - Name of the parameter.
//      value - Receives current value of the parameter.
//  Remarks:
//      This function uses the Control channel. Parameters are product-specific; see the 
//      user's guide for your FireSync product to learn about available parameters.

ZAPI_EXPORT(zStatus) zFireSync_Start(zFireSync fireSync, z64u startTime); //
//
//  Description:
//      Commands FireSync server to start the system.
//  Arguments:
//      fireSync - zFireSync object. 
//      startTime - Time at which the system should start (set to zero to start immediately). 
//  Remarks:
//      This function uses the Control channel. When the system is started, FireSync server
//      will open data connections and then begin execution of FireSync network devices. 

ZAPI_EXPORT(zStatus) zFireSync_ScheduleStart(const zFireSync* connections, z32u count, z64s startTime, z64s startEncoder); //
//
//  Description:
//      Commands one or more FireSync servers to start at the specified time or position.
//  Arguments:
//      connections - Array of zFireSync objects. 
//      count - Count of elements in the connections array.
//      startTime - Time at which the systems should start. 
//      startEncoder - Encoder value at which the systems should start (requires FHP 2.1+). 
//  Remarks:
//      This function uses FireSync control channels. When the systems are started, each 
//      FireSync server will open data connections and begin execution of FireSync network devices. 

ZAPI_EXPORT(zStatus) zFireSync_Stop(zFireSync fireSync); //
//
//  Description:
//      Commands FireSync server to stop the system.
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks:
//      This function uses the Control channel. When the system is stopped, FireSync server
//      will cease execution of FireSync network devices and close data connections.

ZAPI_EXPORT(zStatus) zFireSync_Pause(zFireSync fireSync); //
//
//  Description:
//      Commands FireSync server to pause system execution.
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks:
//      This function uses the Control channel. When the system is paused, FireSync server
//      will temporarily disable lights (e.g. lasers) and data processing/transmission.

ZAPI_EXPORT(zStatus) zFireSync_Resume(zFireSync fireSync); //
//
//  Description:
//      Commands FireSync server to resume system execution.
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks:
//      This function uses the Control channel. When the system is resumed, FireSync server
//      will re-enable lights (e.g. lasers) and data processing/transmission.

ZAPI_EXPORT(zStatus) zFireSync_GetClientVersion(zVersion* version); //
//
//  Description:
//      Gets the latest version of FireSync Host Protocol that is supported by this library.
//  Arguments:
//      version - Protocol version. 

ZAPI_EXPORT(zStatus) zFireSync_GetServerVersion(zFireSync fireSync, zFireSyncChannel channel, zVersion* version); //
//
//  Description:
//      Gets the version of FireSync Host Protocol implemented by a FireSync server control channel.
//  Arguments:
//      fireSync - zFireSync object. 
//      channel - Server channel to query for protocol version information (Upgrade, Management, or Control). 
//      version - Protocol version. 

ZAPI_EXPORT(zStatus) zFireSync_Ping(zFireSync fireSync, zFireSyncChannel channel, z64u timeout); //
//
//  Description:
//      Checks that FireSync server is responsive, and optionally enables server ping monitoring.
//  Arguments:
//      fireSync - zFireSync object. 
//      channel - Server channel to ping. 
//      timeout - Ping-monitoring timeout, in microseconds, or zero to disable ping monitoring. 
//  Remarks:
//      This function sends a command to FireSync server to verify that it is still responsive, and 
//      optionally enables ping monitoring.  When ping monitoring is enabled, FireSync server will close 
//      connections if a new ping is not received within the specified timeout interval. Ping monitoring
//      is not supported on the Upgrade channel.

ZAPI_EXPORT(zStatus) zFireSync_GetTime(zFireSync fireSync, z64u* systemTime); //
//
//  Description:
//      Gets the elapsed time since power was applied to the server.
//  Arguments:
//      fireSync - zFireSync object. 
//      systemTime - Receives the current server time, in microseconds. 
//  Remarks:
//      This function uses the Control channel.

ZAPI_EXPORT(zStatus) zFireSync_GetEncoder(zFireSync fireSync, z64s* ticks); //
//
//  Description:
//      Gets the current encoder value.
//  Arguments:
//      fireSync - zFireSync object. 
//      ticks - Receives the current encoder value, in ticks. 
//  Remarks:
//      This function uses the Control channel.

ZAPI_EXPORT(zStatus) zFireSync_ResetEncoder(zFireSync fireSync); //
//
//  Description:
//      Resets the current encoder value to 0.
//  Arguments:
//      fireSync - zFireSync object. 
//  Remarks:
//      This function uses the Control channel.

ZAPI_EXPORT(zStatus) zFireSync_GetStartDelay(zFireSync fireSync, z64u* startDelay); //
//
//  Description:
//      Gets the maximum time (in microseconds) required to process a Start command.
//  Arguments:
//      fireSync - zFireSync object. 
//      startDelay - Receives the start delay, in microseconds. 
//  Remarks:
//      This function uses the Control channel.
//  Remarks: 
//      This command is not supported by FHP 2.0+ servers (startDelay will be set to zero). 

ZAPI_EXPORT(zStatus) zFireSync_Enumerate(zFireSync fireSync, z32u* deviceIds, z32u* count, z32u capacity); //
//
//  Description:
//      Retrieves a list of serial numbers describing the sensor, master, and station devices in the network.
//  Arguments:
//      fireSync - zFireSync object. 
//      deviceIds - Receives serial numbers.
//      count - Receives the count of devices.
//      capacity - Maximum count of serial numbers that may be written into the deviceIds array.
//  Remarks:
//      This function uses the Control channel.
//  Remarks: 
//      FireSync 1.x servers do not include FireSync masters in the enumerated device list.

ZAPI_EXPORT(zStatus) zFireSync_GetDeviceInfo(zFireSync fireSync, z32u deviceId, zDeviceInfo* info); //
//
//  Description:
//      Accesses information about a particular device in the FireSync network (sensor, master, station).
//  Arguments:
//      fireSync - zFireSync object. 
//      deviceId - Serial number of the device.
//      info - Receives information about the device.
//  Remarks:
//      This function uses the Control channel.

ZAPI_EXPORT(zStatus) zFireSync_BeginUpgrade(zFireSync fireSync, const zByte* data, zUIntPtr size); //
//
//  Description:
//      Initiates a firmware upgrade for devices in the FireSync network.
//  Arguments:
//      fireSync - zFireSync object. 
//      data - Contents of the upgrade package file (provided by LMI Technologies).
//      size - Size of the upgrade package file, in bytes.
//  Remarks:
//      This function uses the Upgrade channel. This function does not wait for the upgrade 
//      process to complete - use the zFireSync_GetUpgradeStatus function to determine the current
//      state of the uprade process.

ZAPI_EXPORT(zStatus) zFireSync_GetUpgradeStatus(zFireSync fireSync, zBool* complete, zBool* succeeded, z32s* progress); //
//
//  Description:
//      Reports the current status of a FireSync firmware upgrade process.
//  Arguments:
//      fireSync - zFireSync object. 
//      complete - Is the upgrade processed completed?
//      succeeded - If completed, did the upgrade completed successfully?
//.     progress - If not completed, reports upgrade progress (percentage).
//  Remarks:
//      This function uses the Upgrade channel.

ZAPI_EXPORT(zStatus) zFireSync_GetUpgradeLog(zFireSync fireSync, zByte** data, zUIntPtr* size); //
//
//  Description:
//      In the event of an upgrade failure, this function can be used to retrieve a server log file.
//  Arguments:
//      fireSync - zFireSync object. 
//      data - Receives the upgrade log file (see note).
//      size - Receives the size of the upgrade log file, in bytes.
//  Remarks:
//      This function uses the Upgrade channel. Memory allocated and returned by this function 
//      should be freed using the zFree function.

ZAPI_EXPORT(zStatus) zFireSync_Backup(zFireSync fireSync, zByte** data, zUIntPtr* size); //
//
//  Description:
//      Creates a backup of FireSync server files that can later be restored.
//  Arguments:
//      fireSync - zFireSync object. 
//      data - Receives the backup (see note).
//      size - Receives the size of the backup file, in bytes.
//  Remarks:
//      This function uses the Control channel. Memory allocated and returned by this function 
//      should be freed using the zFree function.

ZAPI_EXPORT(zStatus) zFireSync_Restore(zFireSync fireSync, const zByte* data, zUIntPtr size); //
//
//  Description:
//      Restores a backup of FireSync server files.
//  Arguments:
//      fireSync - zFireSync object. 
//      data - Contents of the backup file.
//      size - Size of the backup file, in bytes.
//  Remarks:
//      This function uses the Control channel.

ZAPI_EXPORT(zStatus) zFireSync_GetHealthLog(zFireSync fireSync, zByte** data, zUIntPtr* size); //
//
//  Description:
//      Gets the health log from a FireSync server. 
//  Arguments:
//      fireSync - zFireSync object. 
//      data - Receives the health log.
//      size - Receives the size of the health log, in bytes.
//  Remarks:
//      This function uses the Management channel. The health log uses a private format and 
//      might be requested for advanced troubleshooting. 

ZAPI_EXPORT(zStatus) zFireSync_GetProcessLog(zFireSync fireSync, zByte** data, zUIntPtr* size); //
//
//  Description:
//      Gets the process log from a FireSync server. 
//  Arguments:
//      fireSync - zFireSync object. 
//      data - Receives the process log.
//      size - Receives the size of the process log, in bytes.
//  Remarks:
//      This function uses the Management channel. The process log uses a private format and 
//      might be requested for advanced troubleshooting. 

ZAPI_EXPORT(zStatus) zFireSync_BeginCommand(zFireSync fireSync, zFireSyncChannel channel, z64s commandId, zSerializer* writer); //
//
//  Description:
//      Begins formatting a custom command. 
//  Arguments:
//      fireSync - zFireSync object. 
//      channel - Server channel to send command (Control, Management, or Upgrade). 
//      commandId - Identifier for the custom command. 
//      writer - Receives a serializer that can be used to write the body of the command message. 
//  Remarks:
//      This function will format the message header; use the returned serializer to write the message body. After 
//      formatting the message body, call zFireSync_SendCommand to transmit the message.

ZAPI_EXPORT(zStatus) zFireSync_SendCommand(zFireSync fireSync, zFireSyncChannel channel, z64u timeout, zSerializer* reader); //
//
//  Description:
//      Sends a custom command and receives the response.
//  Arguments:
//      fireSync - zFireSync object. 
//      channel - Server channel to send command (Control, Management, or Upgrade). 
//      timeout - Timeout for the command response, in microseconds. 
//      reader - Receives a serializer that can be used to read the body of the response message. 
//  Remarks:
//      This function will read the message header; use the returned serializer to read the message body. The serializer
//      object will be valid until the next zFireSync method is called. 

#include <zApiEnd.h>

#endif          /* #ifndef LMITECH_ZFIRESYNC_H_INCLUDED */
