/*
This software is subject to the license described in the License.txt file
included with this software distribution. You may not use this file except
in compliance with this license.
Copyright (c) Dynastream Innovations Inc. 2016
All rights reserved.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ANT_Managed_Library.ANTFS
{
///
/// ANT-FS Request Parameters
/// These are the parameters received from the host
/// along with a download/upload/erase request
///
[StructLayout(LayoutKind.Sequential)]
public struct ANTFS_RequestParameters
{
///
/// File index of the requested download, upload or erase operation
///
public ushort FileIndex;
///
/// Requested offset. The client library handles offsets internally,
/// this is available for information purposes.
///
public uint Offset;
///
/// Maximum number of bytes the host can send/receive in a single block.
/// The client library handles this internally, this is available for
/// information purposes.
///
public uint BlockSize;
///
/// Maximum number of bytes that the host is requesting to upload.
/// This includes the offset plus the total remaining bytes.
/// This can be used to determine if there is enough space available
/// in the device to handle the upload.
///
public uint MaxSize;
///
/// CRC Seed for the download.
/// The client library handles this internally, this is available for
/// information purposes
///
public ushort CrcSeed;
///
/// Indicates whether this is an initial download request or an attempt
/// to resume a previous transfer.
/// Resuming within a single session is handled by the library, this is
/// available for information purposes.
///
[MarshalAs(UnmanagedType.Bool)]
public bool IsInitialRequest;
}
///
/// ANT-FS Disconnect Parameters
/// These are the parameters received from the host
/// along with the disconnect command
///
[StructLayout(LayoutKind.Sequential)]
public struct ANTFS_DisconnectParameters
{
///
/// Disconnect command type
///
public byte CommandType;
///
/// Requested amount in time (in 30 s increments) to become undiscoverable
///
public byte TimeDuration;
///
/// Requested application specific undiscoverable time
///
public byte ApplicationSpecificDuration;
}
}