UpgradeNotes.TXT 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. ---------------------------------------------------------------------------------
  2. Dynastream Innovations Inc.
  3. Cochrane, AB, CANADA
  4. Copyright © 1998-2012 Dynastream Innovations Inc.
  5. All rights reserved. This software may not be reproduced by
  6. any means without express written approval of Dynastream
  7. Innovations Inc.
  8. ---------------------------------------------------------------------------------
  9. Upgrade Notes for the ANT Managed Library 2.1
  10. ---------------------------------------------------------------------------------
  11. If updating an application to the ANT_Managed_Library (ANT_NET.dll) version 2 or higher,
  12. from version 1.*, there are a few considerations
  13. ---------------------------------------------------------------------------------
  14. General ANT Applications
  15. 1) The names of the delegates for the device and channel response events have been modified.
  16. Version 1.*
  17. device0.deviceResponse += new ANT_Device.DeviceResponseHandler(DeviceResponse);
  18. channel0.channelResponse += new ANT_Channel.ChannelResponseHandler(ChannelResponse);
  19. Version 2.*
  20. device0.deviceResponse += new ANT_Device.dDeviceResponseHandler(DeviceResponse);
  21. channel0.channelResponse += new dChannelResponseHandler(ChannelResponse);
  22. 2) ANT_ChannelID is no longer an inner class of ANT_Response
  23. Version 1.*
  24. ANT_Response.ANT_ChannelID
  25. Version 2.*
  26. ANT_ChannelID
  27. 3) Make sure to also update the ANT_Unmanaged_Wrapper (ANTWrappedLib.dll) to version 2.9.1 or higher.
  28. Please refer to the DEMO_NET project on the Windows Library Package for sample code.
  29. ---------------------------------------------------------------------------------
  30. Applications using ANT-FS
  31. New features:
  32. - Ease of integration with existing ANT managed applications
  33. - Compatibility with ANT-FS Broadcast
  34. - Other ANT channels can be used for custom purposes.
  35. Please refer to the DEMO_ANTFS project on the Windows Library Package for sample code.
  36. 1) The ANTFS_Host class has been deprecated. This class has been replaced with
  37. ANTFS_HostChannel. The main difference between the two is that the new ANTFS_HostChannel
  38. does not control the connection to the USB stick, and can be more easily incorporated into
  39. existing applications that are using an ANT_Device to manage the USB connection.
  40. This provides more flexibility, like using other channels or switching between
  41. broadcast mode and ANT-FS sessions.
  42. Version 1.*
  43. ANTFS_Host antfsHost = new ANTFS_Host();
  44. Version 2.*
  45. ANT_Device antDevice = new ANT_Device();
  46. ANTFS_HostChannel antfsHost = new ANTFS_HostChannel(antDevice.getChannel(0));
  47. Because of this, the Response.OpenPass has been removed.
  48. Similarly, the ANTFS_Client class has been deprecated in favour of ANTFS_ClientChannel.
  49. Version 1.*
  50. ANTFS_Client antfsClient = new ANTFS_Client();
  51. Version 2.*
  52. ANT_Device antDevice = new ANT_Device();
  53. ANTFS_ClientChannel antfsClient = new ANTFS_ClientChannel(antDevice.getChannel(0));
  54. 2) The delegate for the ANT-FS Host response events has been modified.
  55. Note that both the name of the delegate and its signature changed.
  56. Version 1.*
  57. antfsHost.OnResponse += new ANTFS_Host.ResponseHandler(HandleHostResponses);
  58. public void HandleHostResponses(object sender, ANTFS_EventArgs args)
  59. {
  60. switch (args.responseCurrent)
  61. {
  62. case Response.ConnectPass:
  63. // Handle responses...
  64. }
  65. }
  66. Version 2.*
  67. antfsHost.OnResponse += new Action<ANTFS_HostChannel.Response>(HandleHostResponses);
  68. public void HandleHostResponses(ANTFS_HostChannel.Response response)
  69. {
  70. switch(response)
  71. {
  72. case ANTFS_HostChannel.Response.ConnectPass:
  73. // Handle responses...
  74. }
  75. }
  76. Similary, for the ANT-FS Client
  77. Version 1.*
  78. antfsClient.OnResponse += new ANTFS_Client.ResponseHandler(HandleClientResponses);
  79. public void HandleClientResponses(object sender, ANTFS_EventArgs args)
  80. {
  81. switch (args.responseCurrent)
  82. {
  83. case Response.ConnectPass:
  84. // Handle responses...
  85. }
  86. }
  87. Version 2.*
  88. antfsClient.OnResponse += new Action<ANTFS_ClientChannel.Response>(HandleHostResponses);
  89. public void HandleClientResponses(ANTFS_ClientChannel.Response response)
  90. {
  91. switch(response)
  92. {
  93. case ANTFS_ClientChannel.Response.ConnectPass:
  94. // Handle responses...
  95. // Use getters to get relevant parameters
  96. }
  97. }
  98. 3) Asides from the naming convention, event arguments are no longer available in the new response
  99. handler. Use the relevant getters to retrieve any parameters related to a particular event.
  100. This change is in line with the functionality of the underlying C++ library.
  101. Please refer to DEMO_ANTFS for an example implementation.
  102. 4) To enable debugging, use ANT_Common.enableDebugLogs(). Make sure to enable debugging before creating a new ANT_Device and ANTFS_HostChannel or ANTFS_ClientChannel object for full debug information.
  103. Version 1.*
  104. antfsHost.SetDebugLogs(true);
  105. antfsClient.SetDebugLogs(true);
  106. Version 2.*
  107. ANT_Common.enableDebugLogs();
  108. !!! NOTE: To enable debugging in the ANT Receive thread, the ANT Managed Library must be built with the ANTFS_DEBUGGING preprocessor directive.
  109. The binary included in the Windows Library Package does not include this by default.
  110. 5) To set the network key, you must specify both the network number and network key. In the previous version, network 0 was always used by default.
  111. Version 1.*
  112. antfsHost.SetNetworkKey(networkKey);
  113. Version 2.*
  114. antfsHost.SetNetworkKey(networkNumber, networkKey);
  115. Similarly, for the ANT-FS client
  116. Version 1.*
  117. antfsHost.SetNetworkKey(networkKey);
  118. Version 2.*
  119. antfsClient.SetClientNetworkKey(networkNumber, networkKey);
  120. 6) Timeouts were removed from the ANT-FS Host (i.e. Response.Timeout), as their implementation did not play well with new architecture. Timeouts can be implemented at the application level, providing more flexibility on their intended behavior.
  121. 7) ANT_Managed_Library.ANTFS.State has been replaced with ANTFS_HostChannel.State (with only the events relevant to the host) and ANTFS_ClientChannel.State (with only the states relevant to the client).
  122. 8) Removed Default.SearchRadioFrequency and Default.TransportRadioFrequency. Replaced with more explicit RadioFrequency enum
  123. 9) On the ANT-FS Host, if specifying a disconnect type when using Disconnect(), it should be a byte, instead of the enum DisconnectType. This is to allow custom disconnect type values, as per Version 2.2. of the Spec.
  124. 10) On the ANT-FS Client, removed the ReturnBroadcast response. Instead, if the client was requested by a host to disconnect and go back to broadcast, the client will receive a DisconnectPass response and must use GetDisconnectParameters() to figure out the disconnnect type. This is to accomodate Spec 2.2 that allows application specific disconnect types.
  125. If the client requested to close the beacon while specifying to return to broadcast, it will just get a BeaconClosed event.
  126. The ANTFSClientDemo application provides an example usage of these different modes.