ANTFS_RequestParameters.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. This software is subject to the license described in the License.txt file
  3. included with this software distribution. You may not use this file except
  4. in compliance with this license.
  5. Copyright (c) Dynastream Innovations Inc. 2016
  6. All rights reserved.
  7. */
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Runtime.InteropServices;
  13. namespace ANT_Managed_Library.ANTFS
  14. {
  15. /// <summary>
  16. /// ANT-FS Request Parameters
  17. /// These are the parameters received from the host
  18. /// along with a download/upload/erase request
  19. /// </summary>
  20. [StructLayout(LayoutKind.Sequential)]
  21. public struct ANTFS_RequestParameters
  22. {
  23. /// <summary>
  24. /// File index of the requested download, upload or erase operation
  25. /// </summary>
  26. public ushort FileIndex;
  27. /// <summary>
  28. /// Requested offset. The client library handles offsets internally,
  29. /// this is available for information purposes.
  30. /// </summary>
  31. public uint Offset;
  32. /// <summary>
  33. /// Maximum number of bytes the host can send/receive in a single block.
  34. /// The client library handles this internally, this is available for
  35. /// information purposes.
  36. /// </summary>
  37. public uint BlockSize;
  38. /// <summary>
  39. /// Maximum number of bytes that the host is requesting to upload.
  40. /// This includes the offset plus the total remaining bytes.
  41. /// This can be used to determine if there is enough space available
  42. /// in the device to handle the upload.
  43. /// </summary>
  44. public uint MaxSize;
  45. /// <summary>
  46. /// CRC Seed for the download.
  47. /// The client library handles this internally, this is available for
  48. /// information purposes
  49. /// </summary>
  50. public ushort CrcSeed;
  51. /// <summary>
  52. /// Indicates whether this is an initial download request or an attempt
  53. /// to resume a previous transfer.
  54. /// Resuming within a single session is handled by the library, this is
  55. /// available for information purposes.
  56. /// </summary>
  57. [MarshalAs(UnmanagedType.Bool)]
  58. public bool IsInitialRequest;
  59. }
  60. /// <summary>
  61. /// ANT-FS Disconnect Parameters
  62. /// These are the parameters received from the host
  63. /// along with the disconnect command
  64. /// </summary>
  65. [StructLayout(LayoutKind.Sequential)]
  66. public struct ANTFS_DisconnectParameters
  67. {
  68. /// <summary>
  69. /// Disconnect command type
  70. /// </summary>
  71. public byte CommandType;
  72. /// <summary>
  73. /// Requested amount in time (in 30 s increments) to become undiscoverable
  74. /// </summary>
  75. public byte TimeDuration;
  76. /// <summary>
  77. /// Requested application specific undiscoverable time
  78. /// </summary>
  79. public byte ApplicationSpecificDuration;
  80. }
  81. }