antfs_host_channel.hpp 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  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 in compliance
  4. with this license.
  5. Copyright (c) Dynastream Innovations Inc. 2013
  6. All rights reserved.
  7. */
  8. #if !defined(ANTFS_HOST_CHANNEL_HPP)
  9. #define ANTFS_HOST_CHANNEL
  10. #include "types.h"
  11. #include "dsi_thread.h"
  12. #include "dsi_timer.hpp"
  13. #include "dsi_framer_ant.hpp"
  14. #include "dsi_debug.hpp"
  15. #include "dsi_response_queue.hpp"
  16. #include "dsi_ant_message_processor.hpp"
  17. #include "antfsmessage.h"
  18. #include "antfs_host_interface.hpp"
  19. //////////////////////////////////////////////////////////////////////////////////
  20. // Public Definitions
  21. //////////////////////////////////////////////////////////////////////////////////
  22. #define DIRECT_TRANSFER_SIZE ((MAX_USHORT + 1) * 8)
  23. #define MAX_IGNORE_LIST_SIZE 2048
  24. UCHAR const aucTransportFrequencyList[16] = {3 ,7 ,15,20,25,29,34,40,45,49,54,60,65,70,75,80};
  25. #define TRANSPORT_FREQUENCY_LIST_SIZE ((UCHAR)sizeof(aucTransportFrequencyList))
  26. #define SEARCH_DEVICE_LIST_MAX_SIZE 512
  27. typedef struct
  28. {
  29. USHORT usHandle;
  30. ANTFS_DEVICE_PARAMETERS sDeviceParameters;
  31. ANTFS_DEVICE_PARAMETERS sDeviceSearchMask;
  32. } DEVICE_PARAMETERS_ITEM;
  33. typedef struct
  34. {
  35. USHORT usID;
  36. USHORT usManufacturerID;
  37. USHORT usDeviceType;
  38. USHORT usTimeout;
  39. } IGNORE_LIST_ITEM;
  40. /////////////////////////////////////////////////////////////////
  41. // This class implements the ANT-FS Host specification.
  42. // It is intended to be used together with another class that manages
  43. // the connection to an ANT USB stick (e.g. DSIANTDevice or
  44. // .NET ANT_Device).
  45. /////////////////////////////////////////////////////////////////
  46. class ANTFSHostChannel : public ANTFSHostInterface, public DSIANTMessageProcessor
  47. {
  48. private:
  49. //////////////////////////////////////////////////////////////////////////////////
  50. // Private Definitions
  51. //////////////////////////////////////////////////////////////////////////////////
  52. enum ENUM_ANTFS_REQUEST
  53. {
  54. ANTFS_REQUEST_NONE = 0,
  55. ANTFS_REQUEST_INIT, // Init()
  56. ANTFS_REQUEST_SESSION_REQ, // RequestSession()
  57. ANTFS_REQUEST_SEARCH, // SearchForDevice()
  58. ANTFS_REQUEST_ID, // Request ID
  59. ANTFS_REQUEST_PING, // Ping
  60. ANTFS_REQUEST_PAIR, // Pair
  61. ANTFS_REQUEST_PROCEED, // ProceedToTransport
  62. ANTFS_REQUEST_AUTHENTICATE, // Authenticate()
  63. ANTFS_REQUEST_CONNECT, // Connect
  64. ANTFS_REQUEST_DISCONNECT, // Disconnect()
  65. ANTFS_REQUEST_CHANGE_LINK, // ChangeTransportChannelParameters()
  66. ANTFS_REQUEST_DOWNLOAD, // Download()
  67. ANTFS_REQUEST_UPLOAD, // Upload()
  68. ANTFS_REQUEST_MANUAL_TRANSFER, // ManualTransfer()
  69. ANTFS_REQUEST_ERASE, // EraseData()
  70. ANTFS_REQUEST_CONNECTION_LOST, // Internal, keep these at the end of the list order is important
  71. ANTFS_REQUEST_HANDLE_SERIAL_ERROR, // Internal
  72. ANTFS_REQUEST_SERIAL_ERROR_HANDLED // Internal
  73. };
  74. enum RETURN_STATUS
  75. {
  76. RETURN_FAIL = 0,
  77. RETURN_PASS,
  78. RETURN_STOP,
  79. RETURN_REJECT,
  80. RETURN_NA,
  81. RETURN_SERIAL_ERROR
  82. };
  83. //////////////////////////////////////////////////////////////////////////////////
  84. // Private Variables
  85. //////////////////////////////////////////////////////////////////////////////////
  86. DSIResponseQueue<ANTFS_HOST_RESPONSE> clResponseQueue;
  87. volatile BOOL bIgnoreListRunning;
  88. volatile BOOL bForceFullInit;
  89. BOOL bInitFailed;
  90. BOOL bPingEnabled;
  91. BOOL bForceUploadOffset;
  92. BOOL bRequestPageEnabled;
  93. UCHAR aucResponseBuf[MESG_MAX_SIZE_VALUE];
  94. UCHAR aucRxBuf[MESG_MAX_SIZE_VALUE];
  95. UCHAR aucTxBuf[MESG_MAX_SIZE_VALUE];
  96. UCHAR aucRemoteFriendlyName[FRIENDLY_NAME_MAX_LENGTH];
  97. UCHAR ucRemoteFriendlyNameLength;
  98. UCHAR ucAuthType;
  99. UCHAR aucTxPassword[TX_PASSWORD_MAX_LENGTH];
  100. volatile UCHAR ucTxPasswordLength;
  101. volatile UCHAR ucPasswordLength;
  102. UCHAR *pucUploadData;
  103. UCHAR *pucResponseBuffer;
  104. UCHAR *pucResponseBufferSize;
  105. ULONG ulAuthResponseTimeout;
  106. ULONG ulHostSerialNumber;
  107. ULONG ulFoundBeaconHostID;
  108. UCHAR ucChannelStatus;
  109. UCHAR ucRejectCode;
  110. UCHAR ucDisconnectType;
  111. UCHAR ucUndiscoverableTimeDuration;
  112. UCHAR ucUndiscoverableAppSpecificDuration;
  113. ANTFS_DEVICE_PARAMETERS stFoundDeviceParameters;
  114. volatile USHORT usFoundBeaconPeriod;
  115. volatile USHORT usFoundANTFSDeviceID;
  116. volatile USHORT usFoundANTFSManufacturerID;
  117. volatile USHORT usFoundANTFSDeviceType;
  118. volatile UCHAR ucFoundANTDeviceType;
  119. volatile UCHAR ucFoundANTTransmitType;
  120. volatile BOOL bFoundDeviceHasData;
  121. volatile BOOL bFoundDeviceUploadEnabled;
  122. volatile BOOL bFoundDeviceInPairingMode;
  123. volatile UCHAR ucFoundDeviceAuthenticationType;
  124. volatile UCHAR ucFoundDeviceState;
  125. volatile BOOL bFoundDevice;
  126. volatile BOOL bFoundDeviceIsValid;
  127. volatile BOOL bNewRxEvent;
  128. // Download Data
  129. UCHAR *pucTransferBuffer;
  130. UCHAR *pucTransferBufferDynamic;
  131. UCHAR aucTransferBufferFixed[MAX_USHORT + 16];
  132. UCHAR aucSendDirectBuffer[8 + DIRECT_TRANSFER_SIZE];
  133. volatile ULONG ulTransferArrayIndex;
  134. volatile ULONG ulPacketCount;
  135. volatile ULONG ulUploadIndexProgress;
  136. volatile BOOL bTxError;
  137. volatile BOOL bRxError;
  138. volatile BOOL bReceivedBurst;
  139. volatile BOOL bReceivedResponse;
  140. volatile ULONG ulTransferTotalBytesRemaining;
  141. volatile ULONG ulTransferBytesInBlock;
  142. volatile BOOL bTransfer;
  143. ULONG ulHostBlockSize;
  144. DSI_THREAD_ID hANTFSThread; // Handle for the ANTFS thread.
  145. DSI_MUTEX stMutexResponseQueue; // Mutex used with the response queue
  146. DSI_MUTEX stMutexCriticalSection; // Mutex used with the wait condition
  147. DSI_MUTEX stMutexIgnoreListAccess; // Mutex used with the ignore list
  148. DSI_CONDITION_VAR stCondANTFSThreadExit; // Event to signal the ANTFS thread has ended.
  149. DSI_CONDITION_VAR stCondRequest; // Event to signal there is a new request
  150. DSI_CONDITION_VAR stCondRxEvent; // Event to signal there is a new Rx message or failure
  151. DSI_CONDITION_VAR stCondWaitForResponse; // Event to signal there is a new response to the application
  152. volatile USHORT usSerialWatchdog;
  153. volatile BOOL bKillThread;
  154. volatile BOOL bANTFSThreadRunning;
  155. volatile BOOL bCancel; // Internal cancel parameter to use if not configured
  156. volatile BOOL *pbCancel;
  157. DSIFramerANT *pclANT;
  158. // ANT Channel parameters
  159. UCHAR ucNetworkNumber;
  160. //UCHAR ucChannelNumber;
  161. USHORT usRadioChannelID;
  162. UCHAR ucTheDeviceType;
  163. UCHAR ucTheTransmissionType;
  164. USHORT usTheMessagePeriod;
  165. UCHAR aucTheNetworkkey[8];
  166. UCHAR ucTheProxThreshold;
  167. volatile USHORT usSearchManufacturerID;
  168. volatile USHORT usSearchDeviceType;
  169. volatile USHORT usBlackoutTime;
  170. volatile UCHAR ucTransportLayerRadioFrequency;
  171. UCHAR ucSearchRadioFrequency;
  172. USHORT usTransferDataFileIndex;
  173. volatile ULONG ulTransferDataOffset;
  174. volatile ULONG ulTransferByteSize;
  175. volatile ULONG ulTransferBufferSize;
  176. volatile BOOL bLargeData;
  177. // Ignore List variables
  178. volatile USHORT usListIndex;
  179. IGNORE_LIST_ITEM astIgnoreList[MAX_IGNORE_LIST_SIZE];
  180. BOOL bTimerThreadInitDone;
  181. DSITimer *pclQueueTimer;
  182. volatile UCHAR ucLinkResponseRetries;
  183. UCHAR ucStrikes;
  184. volatile UCHAR ucTransportBeaconTicks;
  185. UCHAR ucTransportChannelPeriodSelection;
  186. UCHAR ucTransportFrequencySelection;
  187. UCHAR ucTransportFrequencyStaleCount;
  188. UCHAR ucCurrentTransportFreqElement;
  189. UCHAR aucFrequencyTable[TRANSPORT_FREQUENCY_LIST_SIZE];
  190. DEVICE_PARAMETERS_ITEM asDeviceParametersList[SEARCH_DEVICE_LIST_MAX_SIZE];
  191. USHORT usDeviceListSize;
  192. volatile ANTFS_HOST_STATE eANTFSState;
  193. volatile ENUM_ANTFS_REQUEST eANTFSRequest;
  194. //////////////////////////////////////////////////////////////////////////////////
  195. // Private Function Prototypes
  196. //////////////////////////////////////////////////////////////////////////////////
  197. BOOL ReportDownloadProgress(void);
  198. BOOL ReInitDevice(void);
  199. void ResetHostState(void);
  200. RETURN_STATUS AttemptSearch(void);
  201. RETURN_STATUS AttemptConnect(void);
  202. RETURN_STATUS AttemptRequestSession(void);
  203. RETURN_STATUS AttemptSwitchFrequency(void);
  204. RETURN_STATUS AttemptDisconnect(void);
  205. void Ping(void);
  206. RETURN_STATUS AttemptDownload(void);
  207. RETURN_STATUS UploadLoop(void);
  208. RETURN_STATUS AttemptUpload(void);
  209. RETURN_STATUS AttemptManualTransfer(void);
  210. RETURN_STATUS Receive(void);
  211. RETURN_STATUS AttemptErase(void);
  212. RETURN_STATUS AttemptAuthenticate(void);
  213. // ANT Callback Functions
  214. BOOL FilterANTMessages(ANT_MESSAGE* pstMessage_, UCHAR ucANTChannel_);
  215. BOOL ANTProtocolEventProcess(UCHAR ucChannel_, UCHAR ucMessageCode_);
  216. BOOL ANTChannelEventProcess(UCHAR ucChannel_, UCHAR ucMessageCode_);
  217. void QueueTimerCallback(void);
  218. static DSI_THREAD_RETURN QueueTimerStart(void *pvParameter_);
  219. void HandleSerialError(void);
  220. void IncFreqStaleCount(UCHAR ucInc);
  221. void PopulateTransportFreqTable(void);
  222. UCHAR CheckForNewTransportFreq(void);
  223. void ANTFSThread(void);
  224. static DSI_THREAD_RETURN ANTFSThreadStart(void *pvParameter_);
  225. BOOL IsDeviceMatched(ANTFS_DEVICE_PARAMETERS *psDeviceParameters_, BOOL bPartialID_);
  226. void AddResponse(ANTFS_HOST_RESPONSE eResponse_);
  227. public:
  228. //////////////////////////////////////////////////////////////////////////////////
  229. // Public Function Prototypes
  230. //////////////////////////////////////////////////////////////////////////////////
  231. ANTFSHostChannel();
  232. ~ANTFSHostChannel();
  233. BOOL Init(DSIFramerANT* pclANT_, UCHAR ucChannel_);
  234. /////////////////////////////////////////////////////////////////
  235. // Begins to initialize the ANTFSHostChannel object.
  236. // Returns TRUE if successful. Otherwise, it returns FALSE.
  237. // Parameters:
  238. // *pclANT_: Pointer to a DSIFramerANT object.
  239. // ucChannel_: Channel number to use for the ANT-FS host
  240. // Operation:
  241. // This function is used from a class managing the connection
  242. // to ANT (e.g. DSIANTDevice or .NET ANT_Device), to
  243. // initialize the ANTFSHostChannel object. It is not possible
  244. // to change the channel number once ANT-FS is running.
  245. // The function returns immediately, and the ANTFSHostChannel object
  246. // will send a response of ANTFS_HOST_RESPONSE_INIT_PASS.
  247. // IT IS NOT NECESSARY TO CALL THIS FUNCTION DIRECTLY FROM USER APPLICATIONS.
  248. /////////////////////////////////////////////////////////////////
  249. void Close(void);
  250. /////////////////////////////////////////////////////////////////
  251. // Stops any pending actions, closes all threads and cleans
  252. // up any dynamic memory being used by the library.
  253. // Operation:
  254. // This function is used from a class managing the connection
  255. // to ANT (e.g. DSIANTDevice or .NET ANT_Device), to
  256. // clean up any resources in use by the ANT-FS host.
  257. // IT IS NOT NECESSARY TO CALL THIS FUNCTION DIRECTLY FROM USER APPLICATIONS.
  258. /////////////////////////////////////////////////////////////////
  259. void ProcessMessage(ANT_MESSAGE* pstMessage_, USHORT usMesgSize_);
  260. /////////////////////////////////////////////////////////////////
  261. // Processes incoming ANT messages as per the ANT-FS Technology
  262. // Specification
  263. // Parameters:
  264. // pstMessage_: Pointer to an ANT message structure
  265. // usMesgSize_: ANT message size
  266. // Operation:
  267. // This function is used from a class managing the connection
  268. // to ANT (e.g. DSIANTDevice or .NET ANT_Device).
  269. // IT IS NOT NECESSARY TO CALL THIS FUNCTION DIRECTLY FROM USER APPLICATIONS.
  270. /////////////////////////////////////////////////////////////////
  271. void ProcessDeviceNotification(ANT_DEVICE_NOTIFICATION eCode_, void* pvParameter_);
  272. /////////////////////////////////////////////////////////////////
  273. // Processes device level notifications
  274. // Parameters:
  275. // eCode_: Device notification event code
  276. // pvParameter_: Pointer to struct defining specific parameters related
  277. // to the event code
  278. // Operation:
  279. // This function si used from a class managing the connection
  280. // to ANT (e.g. DSIANTDevice or .NET ANT_Device).
  281. // IT IS NOT NECESSARY TO CALL THIS FUNCTION DIRECTLY FROM USER APPLICATIONS.
  282. /////////////////////////////////////////////////////////////////
  283. void Cancel(void);
  284. /////////////////////////////////////////////////////////////////
  285. // Cancels any pending actions and returns the library to the
  286. // appropriate ANTFS layer if possible. ie if the library was
  287. // executing a download command in the transport layer, the
  288. // library would be returned to ANTFS_HOST_STATE_TRANSPORT after
  289. // execution of this function.
  290. /////////////////////////////////////////////////////////////////
  291. void SetChannelID(UCHAR ucDeviceType_, UCHAR ucTransmissionType_);
  292. /////////////////////////////////////////////////////////////////
  293. // Configures the ANT channel ID for the ANT-FS Host channel
  294. // Parameters:
  295. // ucDeviceType_: ANT Channel Device Type
  296. // ucTransmissionType_: ANT Channel Transmission Type
  297. // Operation:
  298. // Changes to the channel ID are only applied after calling
  299. // SearchForDevice.
  300. /////////////////////////////////////////////////////////////////
  301. void SetChannelPeriod(USHORT usChannelPeriod_);
  302. /////////////////////////////////////////////////////////////////
  303. // Configures the ANT channel period for the ANT-FS Host channel
  304. // Parameters:
  305. // usChannelPeriod_: Channel period to use while in link state
  306. // Operation:
  307. // Changes to the channel ID are only applied after calling
  308. // SearchForDevice. If using ANT-FS broadcast, this is the
  309. // channel period the host will return to when using the
  310. // Disconnect command with the Return To Broadcast option.
  311. // To change the channel period while an ANT-FS session is open,
  312. // use SwitchFrequency().
  313. /////////////////////////////////////////////////////////////////
  314. // TODO: Does this function make sense here, or should it just assign the network number?
  315. // The ANTFSHost wrapper class could continue to provide this one for backwards compatibility
  316. void SetNetworkKey(UCHAR ucNetwork_, UCHAR ucNetworkkey[]);
  317. /////////////////////////////////////////////////////////////////
  318. // Configures the ANT network key for the ANT-FS channel
  319. // Parameters:
  320. // ucNetwork_: Network number (0 - 2)
  321. // ucNetworkkey: Array containing the 8 byte network key
  322. // Operation:
  323. // Changes to the network key are only applied after calling
  324. // SearchForDevice.
  325. /////////////////////////////////////////////////////////////////
  326. void SetProximitySearch(UCHAR ucSearchThreshold_);
  327. /////////////////////////////////////////////////////////////////
  328. // Sets the value for the proximity bin setting for searching.
  329. // Note: If applying this value fails when attempting to start search,
  330. // it is ignored to maintain compatibility with devices that
  331. // do not support this feature. This means that a real failure can occur
  332. // on a device that actually does support it, and it will be missed. The
  333. // debug log will show if this command fails.
  334. // Parameters:
  335. // ucSearchThreshold_: Desired proximity bin from 0-10 (If value is
  336. // set higher then 10, it is automatically capped at 10)
  337. // Operation:
  338. // Changes to the proximity search bin are only applied after calling
  339. // SearchForDevice.
  340. /////////////////////////////////////////////////////////////////
  341. void SetSerialNumber(ULONG ulSerialNumber_);
  342. /////////////////////////////////////////////////////////////////
  343. // Configures the host serial number.
  344. // Parameters:
  345. // ulSerialNumber_: 4-byte host serial number
  346. /////////////////////////////////////////////////////////////////
  347. BOOL EnablePing(BOOL bEnable_);
  348. /////////////////////////////////////////////////////////////////
  349. // Enables ping message to be sent to the remote device periodically.
  350. // This can be used to keep the remote device from timing out during
  351. // operations that wait for user input (i.e. pairing)
  352. // Parameters:
  353. // bEnable_: Periodic ping enable.
  354. // Returns TRUE if successful. Otherwise, it returns FALSE.
  355. /////////////////////////////////////////////////////////////////
  356. BOOL GetEnabled(void);
  357. /////////////////////////////////////////////////////////////////
  358. // Returns the current status of ANT-FS message processing
  359. // Returns TRUE if ANT-FS is enabled. Otherwise, it returns FALSE.
  360. // Operation:
  361. // This function is used from a class managing the connection
  362. // to ANT (e.g. DSIANTDevice or .NET ANT_Device).
  363. // IT IS NOT NECESSARY TO CALL THIS FUNCTION DIRECTLY FROM USER APPLICATIONS.
  364. /////////////////////////////////////////////////////////////////
  365. ANTFS_HOST_STATE GetStatus(void);
  366. /////////////////////////////////////////////////////////////////
  367. // Returns the current library status.
  368. /////////////////////////////////////////////////////////////////
  369. BOOL GetFoundDeviceParameters(ANTFS_DEVICE_PARAMETERS *pstDeviceParameters_, UCHAR *aucFriendlyName_, UCHAR *pucBufferSize_);
  370. /////////////////////////////////////////////////////////////////
  371. // Copies the parameters of the most recently found device to the
  372. // supplied parameter.
  373. // Parameters:
  374. // *ptsDeviceParameters_: A pointer to a structure that will
  375. // receive a copy of the device parameters.
  376. // *aucFriendlyName_: A pointer to a buffer where the remote
  377. // device friendly name will be copied.
  378. // *pucBufferSize_: Pointer to a UCHAR variable that should contain the
  379. // maximum size of the buffer pointed to by aucFriendlyName_.
  380. // After the function returns, the UCHAR variable
  381. // will be set to reflect the size of friendly name string
  382. // that has been copied to aucFriendlyName_.
  383. // Returns TRUE if successful. Otherwise, it returns FALSE.
  384. /////////////////////////////////////////////////////////////////
  385. BOOL GetFoundDeviceChannelID(USHORT *pusDeviceNumber_ = (USHORT *)NULL, UCHAR *pucDeviceType_ = (UCHAR *)NULL, UCHAR *pucTransmitType_ = (UCHAR *)NULL);
  386. /////////////////////////////////////////////////////////////////
  387. // Copies the ANT channel ID of the most recently found device to
  388. // the supplied parameters.
  389. // Parameters:
  390. // *pusDeviceNumber_: A pointer to a USHORT variable that will
  391. // receive the ANT device number of the device.
  392. // *pucDeviceType_: A pointer to a UCHAR variable that will
  393. // hold the device type of the found device.
  394. // *pucTransmitType_: Pointer to a UCHAR variable that will
  395. // receive the transmission type of the found
  396. // device
  397. // Returns TRUE if successful. Otherwise, it returns FALSE.
  398. /////////////////////////////////////////////////////////////////
  399. BOOL GetUploadStatus(ULONG *pulByteProgress_, ULONG *pulTotalLength_);
  400. /////////////////////////////////////////////////////////////////
  401. // Gets the transfer progress of a pending or a complete
  402. // upload.
  403. // Parameters:
  404. // *pulByteProgress_: Pointer to a ULONG that will receive
  405. // the current byte progress of a pending or
  406. // complete upload.
  407. // *pulTotalLength_: Pointer to a ULONG that will receive the
  408. // total length of the file being uploaded.
  409. // Returns TRUE if successful. Otherwise, it returns FALSE.
  410. // Operation:
  411. // A data upload occurs when information is requested to be sent to
  412. // a remote device. This function may be called at any point
  413. // during an upload as a progress indicator. After the upload
  414. // is complete, this information is valid until another request
  415. // for a data transfer is made.
  416. /////////////////////////////////////////////////////////////////
  417. BOOL GetDownloadStatus(ULONG *pulByteProgress_, ULONG *pulTotalLength_);
  418. /////////////////////////////////////////////////////////////////
  419. // Gets the transfer progress of a pending or a complete
  420. // download.
  421. // Parameters:
  422. // *pulByteProgress_: Pointer to a ULONG that will receive
  423. // the current byte progress of a pending or
  424. // complete download.
  425. // *pulTotalLength_: Pointer to a ULONG that will receive the
  426. // total expected length of the download.
  427. // Returns TRUE if successful. Otherwise, it returns FALSE.
  428. // Operation:
  429. // A data download occurs when information is requested from a
  430. // remote device. This function may be called at any point
  431. // during a download as a progress indicator. After the transfer
  432. // is complete, this information is valid until another request
  433. // for a data transfer is made.
  434. /////////////////////////////////////////////////////////////////
  435. BOOL GetTransferData(ULONG *pulDataSize_ , void *pvData_ = NULL);
  436. /////////////////////////////////////////////////////////////////
  437. // Gets the received data from a transfer (download/manual transfer).
  438. //
  439. // Parameters:
  440. // *ulDataSize_ : Pointer to a ULONG that will receive
  441. // the size of the data available in bytes.
  442. // *pvData_ : Pointer to a buffer where the received data
  443. // will be copied. NULL can be passed to this
  444. // parameter so that the size can be retried
  445. // without copying any data. The application
  446. // can then call this function again to after it
  447. // has allocated a buffer of sufficient size to
  448. // handle the data.
  449. // Returns TRUE if successful. Otherwise, it returns FALSE.
  450. /////////////////////////////////////////////////////////////////
  451. UCHAR GetVersion(UCHAR *pucVersionString_, UCHAR ucBufferSize_);
  452. /////////////////////////////////////////////////////////////////
  453. // Copies at most ucBufferSize_ characters from the version
  454. // string into the supplied pucVersionString_ buffer.
  455. // Parameters:
  456. // *pucVersionString_ Pointer to a buffer of characters into
  457. // which to receive the version string.
  458. // ucBufferSize_ The maximum number of characters to
  459. // copy into *pucVersionString_.
  460. // Returns the number of characters copied to *pucVersionString_.
  461. // Operation:
  462. // If the version string has fewer than ucBufferSize_
  463. // characters, the *pucVersionString_ will be padded with a
  464. // '\n'.
  465. /////////////////////////////////////////////////////////////////
  466. ANTFS_RETURN RequestSession(UCHAR ucBroadcastRadioFrequency_ = ANTFS_RF_FREQ, UCHAR ucConnectRadioFrequency_ = ANTFS_DEFAULT_TRANSPORT_FREQ);
  467. /////////////////////////////////////////////////////////////////
  468. // Requests an ANT-FS session from currently connected broadcast
  469. // device
  470. // Parameters:
  471. // ucBroadcastRadioFrequency_: This specifies the frequency on
  472. // which the broadcast device is transmitting.
  473. // This frequency is calculated as
  474. // (ucBroadcastRadioFrequency_ * 1 MHz +
  475. // 2400 MHz). MAX_UCHAR (0xFF) is reserved.
  476. // ucConnectRadioFrequency_: This specifies the frequency
  477. // on which the connection communication
  478. // will occur. This frequency is calculated
  479. // as (ucConnectRadioFrequency_ * 1 MHz +
  480. // 2400 MHz). If ucConnectRadioFrequency_
  481. // is set to ANTFS_AUTO_FREQUENCY_SELECTION
  482. // (0xFF), then the library will use an
  483. // adaptive frequency-hopping scheme.
  484. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  485. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  486. // ANTFS_RETURN_BUSY if the library is busy with another request.
  487. // Operation:
  488. // Once this function is called successfully, the application
  489. // must wait for the response from the ANTFSHost object.
  490. // Possible responses are:
  491. // ANTFS_HOST_RESPONSE_CONNECT_PASS
  492. // ANTFS_HOST_RESPONSE_REQUEST_SESSION_FAIL,
  493. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  494. // To return to broadcast state, use the Disconnect() function.
  495. /////////////////////////////////////////////////////////////////
  496. ANTFS_RETURN SearchForDevice(UCHAR ucSearchRadioFrequency_ = ANTFS_RF_FREQ, UCHAR ucConnectRadioFrequency_ = ANTFS_DEFAULT_TRANSPORT_FREQ, USHORT usRadioChannelID_ = 0, BOOL bUseRequestPage_ = FALSE);
  497. /////////////////////////////////////////////////////////////////
  498. // Begins a search for ANTFS remote devices.
  499. // Parameters:
  500. // ucSearchRadioFrequency_: This specifies the frequency on
  501. // which to search for devices. This
  502. // frequency is calculated as
  503. // (ucSearchRadioFrequency_ * 1 MHz +
  504. // 2400 MHz). MAX_UCHAR (0xFF) is reserved.
  505. // ucConnectRadioFrequency_: This specifies the frequency
  506. // on which the connection communication
  507. // will occur. This frequency is calculated
  508. // as (ucConnectRadioFrequency_ * 1 MHz +
  509. // 2400 MHz). If ucConnectRadioFrequency_
  510. // is set to ANTFS_AUTO_FREQUENCY_SELECTION
  511. // (0xFF), then the library will use an
  512. // adaptive frequency-hopping scheme.
  513. // usRadioChannelID_: This specifies the channel ID for the
  514. // the ANT channel search. Set to zero to
  515. // wildcard.
  516. // bUseRequestPage_: Specifies whether the search will include
  517. // ANT-FS broadcast devices, using a request
  518. // page to begin an ANT-FS session
  519. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  520. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  521. // ANTFS_RETURN_BUSY if the library is busy with another request.
  522. // Operation:
  523. // Once this function is called successfully, the application
  524. // must wait for the response from the ANTFSHost object.
  525. // Possible responses are:
  526. // ANTFS_HOST_RESPONSE_CONNECT_PASS
  527. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  528. // The library will continue to search for devices until a device
  529. // is found, the Cancel() function is called, an error occurs, or
  530. // the library is closed.
  531. /////////////////////////////////////////////////////////////////
  532. ANTFS_RETURN Authenticate(UCHAR ucAuthenticationType_, UCHAR *pucAuthenticationString_, UCHAR ucLength_, UCHAR *aucResponseBuffer_, UCHAR *pucResponseBufferSize_, ULONG ulResponseTimeout_);
  533. /////////////////////////////////////////////////////////////////
  534. // Request to establish an authenticated session with the connected
  535. // remote device.
  536. // Parameters:
  537. // ucAuthenticationType_: The type of authentication to
  538. // execute on the remote device.
  539. // *pucAuthenticationString_: A string that may be used in
  540. // conjunction with the particular
  541. // authentication type in use (e.g. a
  542. // password or a friendly name.
  543. // ucLength_: The length of the authentication string,
  544. // including any '\n' terminator. This
  545. // parameter may be set to zero if an
  546. // authentication string is not required.
  547. // *pucResponseBuffer_: Pointer to the buffer where additional
  548. // data from the response will be saved. This will
  549. // include data such as passwords and friendly names.
  550. // This memory must be allocated by the application.
  551. // *pucResponseBufferSize_: Pointer to UCHAR varible that contains the
  552. // size of the buffer pointed to by pucResponseBuffer_.
  553. // After the response has be recived, the UCHAR variable
  554. // will be set to reflect the size of the new data received
  555. // in pucResponseBuffer_.
  556. // ulResponseTimeout_: Number of miliseconds to wait for a response after
  557. // the authenticate command is sent.
  558. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  559. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  560. // ANTFS_RETURN_BUSY if the library is busy with another request.
  561. // Operation:
  562. // Once the request is posted, the application must wait for the
  563. // response from the ANTFSHost object. Possible responses are:
  564. // ANTFS_HOST_RESPONSE_AUTHENTICATE_NA
  565. // ANTFS_HOST_RESPONSE_AUTHENTICATE_PASS
  566. // ANTFS_HOST_RESPONSE_AUTHENTICATE_REJECT
  567. // ANTFS_HOST_RESPONSE_AUTHENTICATE_FAIL
  568. // ANTFS_HOST_RESPONSE_CONNECTION_LOST
  569. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  570. // Upon receiving the ANTFS_HOST_RESPONSE_AUTHENTICATE_PASS, an
  571. // authentication string provided by the remoted device may be
  572. // available in the response buffer. This depends on the
  573. // authentication type used. The transport
  574. // layer connection is also only established after receiving
  575. // ANTFS_HOST_RESPONSE_AUTHENTICATE_PASS .
  576. /////////////////////////////////////////////////////////////////
  577. ANTFS_RETURN Download(USHORT usFileIndex_, ULONG ulDataOffset_, ULONG ulMaxDataLength_, ULONG ulMaxBlockSize_ = 0);
  578. /////////////////////////////////////////////////////////////////
  579. // Request a download of a file from the authenticated device.
  580. // Parameters:
  581. // usFileIndex_: The file number to be downloaded. Some
  582. // file numbers are reserved for special
  583. // purposes, such as the device directory
  584. // (0). Consult the ANT_FS specification
  585. // and any docs for specific device types.
  586. // ulDataOffset_: The byte offset from where to begin
  587. // transferring the data.
  588. // ulMaxDataLength_: ULONG varible that contains the maximum
  589. // number of bytes to download. Set to 0 if
  590. // if the host does not wish to limit the
  591. // size of the download.
  592. // ulMaxBlockSize_: Maximum number of bytes that the host
  593. // wishes to download in a single block.
  594. // Set to zero to disable.
  595. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  596. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  597. // ANTFS_RETURN_BUSY if the library is busy with another request.
  598. // Operation:
  599. // Once the request is posted, the application must wait for the
  600. // response from the ANTFSHost object. Possible responses are:
  601. // ANTFS_HOST_RESPONSE_DOWNLOAD_PASS
  602. // ANTFS_HOST_RESPONSE_DOWNLOAD_REJECT
  603. // ANTFS_HOST_RESPONSE_DOWNLOAD_FAIL
  604. // ANTFS_HOST_RESPONSE_CONNECTION_LOST
  605. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  606. // Upon receiving ANTFS_HOST_RESPONSE_DOWNLOAD_PASS the downloaed data
  607. // will be available in the transfer buffer. See GetTransferData().
  608. /////////////////////////////////////////////////////////////////
  609. ANTFS_RETURN Upload(USHORT usFileIndex_, ULONG ulDataOffset_, ULONG ulDataLength_, void *pvData_, BOOL bForceOffset_ = TRUE, ULONG ulMaxBlockSize_ = 0);
  610. /////////////////////////////////////////////////////////////////
  611. // Request an upload of a file to the authenticated device.
  612. // Parameters:
  613. // usFileIndex_: The file number to be uploaded. Some
  614. // file numbers are reserved for special
  615. // purposes, such as the device directory
  616. // (0). Consult the ANT_FS specification
  617. // and any docs for specific device types.
  618. // ulDataOffset_: The byte offset from where to begin
  619. // transferring the data.
  620. // ulDataLength_: The byte length of data to be uploaded
  621. // to the remote device.
  622. // Return value:
  623. // *pvData_: Pointer to the location where the data
  624. // to be uploaded is stored.
  625. // bForceOffset_: Set to TRUE (default) to enforce the
  626. // provided byte data offset. Set to FALSE
  627. // to continue a transfer, indicating that
  628. // the host will continue the upload at the
  629. // last data offset specified by the client
  630. // in the Upload Response.
  631. // ulMaxBlockSize_: Maximum block size that the host can send
  632. // in a single block of data. Set to zero
  633. // to disable
  634. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  635. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  636. // ANTFS_RETURN_BUSY if the library is busy with another request.
  637. // Operation:
  638. // Once the request is posted, the application must wait for the
  639. // response from the ANTFSHost object. Possible responses are:
  640. // ANTFS_HOST_RESPONSE_UPLOAD_PASS
  641. // ANTFS_HOST_RESPONSE_UPLOAD_REJECT
  642. // ANTFS_HOST_RESPONSE_UPLOAD_FAIL
  643. // ANTFS_HOST_RESPONSE_CONNECTION_LOST
  644. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  645. /////////////////////////////////////////////////////////////////
  646. ANTFS_RETURN ManualTransfer(USHORT usFileIndex_, ULONG ulDataOffset_, ULONG ulDataLength_, void *pvData_);
  647. /////////////////////////////////////////////////////////////////
  648. // Send data directly to the device without requesting first.
  649. // This is especially useful for communicating small pieces of
  650. // data to the device. Another use is the implementation of a
  651. // higher-level communication protocol. Care must be taken to
  652. // ensure the device can handle the amount of data being sent
  653. // using this method.
  654. // usFileIndex_: The file number to be uploaded. Some
  655. // file numbers are reserved for special
  656. // purposes, such as the device directory
  657. // (0). Consult the ANT_FS specification
  658. // and any docs for specific device types.
  659. // ulDataOffset_: The byte offset from where to begin
  660. // transferring the data. Note that this
  661. // value will always get rounded up to the
  662. // next higher multiple of 8. Under normal
  663. // use, this parameter should always be set
  664. // to zero, and the only time it would be
  665. // non-zero is for retrying ManualTransfer()
  666. // from a known offset.
  667. // ulDataLength_: The byte length of data to be sent to
  668. // the remote device.
  669. // *pvData_: The Pointer to a buffer where the
  670. // data to be sent is stored.
  671. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  672. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  673. // ANTFS_RETURN_BUSY if the library is busy with another request.
  674. // Operation:
  675. // Once the request is posted, the application must wait for the
  676. // response from the ANTFSHost object. Possible responses are:
  677. // ANTFS_HOST_RESPONSE_MANUAL_TRANSFER_PASS
  678. // ANTFS_HOST_RESPONSE_MANUAL_TRANSFER_TRANSMIT_FAIL
  679. // ANTFS_HOST_RESPONSE_MANUAL_TRANSFER_RESPONSE_FAIL
  680. // ANTFS_HOST_RESPONSE_CONNECTION_LOST
  681. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  682. // Upon receiving ANTFS_HOST_RESPONSE_MANUAL_TRANSFER_PASS the downloaed data
  683. // will be available in the transfer buffer. See GetTransferData().
  684. /////////////////////////////////////////////////////////////////
  685. ANTFS_RETURN EraseData(USHORT usFileIndex_);
  686. /////////////////////////////////////////////////////////////////
  687. // Request the erasure of a file on the authenticated remote
  688. // device.
  689. // Parameters:
  690. // usFileIndex_: The file number of the file to be erased.
  691. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  692. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  693. // ANTFS_RETURN_BUSY if the library is busy with another request.
  694. // Operation:
  695. // Once the request is posted, the application must wait for the
  696. // response from the ANTFSHost object. Possible responses are:
  697. // ANTFS_HOST_RESPONSE_ERASE_PASS
  698. // ANTFS_HOST_RESPONSE_ERASE_FAIL
  699. // ANTFS_HOST_RESPONSE_CONNECTION_LOST
  700. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  701. /////////////////////////////////////////////////////////////////
  702. ANTFS_RETURN Disconnect(USHORT usBlackoutTime_, UCHAR ucDisconnectType_ = 0, UCHAR ucTimeDuration_ = 0, UCHAR ucAppSpecificDuration_ = 0);
  703. /////////////////////////////////////////////////////////////////
  704. // Disconnect from a remote device. Optionally put that device
  705. // on a blackout list for a period of time. The application can
  706. // also request the remote device to become undiscoverable for a
  707. // specified time/application specific duration.
  708. // Parameters:
  709. // usBlackoutTime_: The number of seconds the device ID
  710. // should remain on the blackout list. If
  711. // set to zero (0), then the device will
  712. // not be put on the blackout list. If set
  713. // to MAX_USHORT (0xFFFF), the device will
  714. // remain on the blackout list until
  715. // explicitly removed, or until the blackout
  716. // list is reset.
  717. // ucDisconnectType_: Specifies whether the client should
  718. // return to LINK state (default) or broadcast mode.
  719. // Values from 128 - 255 can be used to specify
  720. // application specific disconnect behavior.
  721. // ucTimeDuration_: Time, in 30 seconds increments, the client
  722. // device will remain undiscoverable after
  723. // disconnect has been requested. Set to 0 to
  724. // disable.
  725. // ucAppSpecificDuration_: Application specific duration the client
  726. // shall remain undiscoverable after disconnection.
  727. // This field is left to the developer, or defined
  728. // in an ANT+ Device Profile. Set to 0 to disable.
  729. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  730. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  731. // ANTFS_RETURN_BUSY if the library is busy with another request.
  732. // Operation:
  733. // Once the request is posted, the application must wait for the
  734. // response from the ANTFSHost object. Possible responses are:
  735. // ANTFS_HOST_RESPONSE_DISCONNECT_PASS
  736. // ANTFS_HOST_RESPONSE_CONNECTION_LOST
  737. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  738. // The remote device will not show up in any search results for
  739. // the duration specified in usBlackoutTime_. This allows the
  740. // host to more easily find other devices in crowded
  741. // environments. The host can also request the remote device to
  742. // become undiscoverable, to more easily find other devices, however
  743. // not all client devices might implement this feature. Not all
  744. // client devices support a broadcast mode.
  745. // If no disconnect type is specified, the default behavior will be to
  746. // return to the LINK state, and the host will close the
  747. // channel after disconnecting. If the disconnect type is set to 1,
  748. // the host will return to broadcast mode, and will keep its channel
  749. // open.
  750. /////////////////////////////////////////////////////////////////
  751. // TODO: Need to define a response for this?
  752. ANTFS_RETURN SwitchFrequency(UCHAR ucRadioFrequency_, UCHAR ucChannelPeriod_ = BEACON_PERIOD_KEEP);
  753. /////////////////////////////////////////////////////////////////
  754. // Request the connected remote device to switch to the specified
  755. // radio frequency and channel period
  756. // Parameters:
  757. // ucRadioFrequency_: This specifies the frequency
  758. // on which the connection communication
  759. // will occur. This frequency is calculated
  760. // as (ucRadioFrequency_ * 1 MHz + 2400 MHz).
  761. // ucBeaconPeriod_: This specifies the beacon period on which
  762. // the communication will continue. Use
  763. // BEACON_PERIOD_KEEP to only change the radio
  764. // frequency.
  765. // Returns ANTFS_RETURN_PASS if successful. Otherwise, it returns
  766. // ANTFS_RETURN_FAIL if the library is in the wrong state, or
  767. // ANTFS_RETURN_BUSY if the library is busy with another request.
  768. // Operation:
  769. // This function can only be used in transport state, to change
  770. // the channel parameters.
  771. // Once this function is called successfully, the application
  772. // must wait for the response from the ANTFSHost object.
  773. // Possible responses are:
  774. // ANTFS_HOST_RESPONSE_CONNECTION_LOST
  775. // ANTFS_HOST_RESPONSE_SERIAL_FAIL
  776. /////////////////////////////////////////////////////////////////
  777. USHORT AddSearchDevice(ANTFS_DEVICE_PARAMETERS *pstDeviceSearchMask_, ANTFS_DEVICE_PARAMETERS *pstDeviceParameters_);
  778. /////////////////////////////////////////////////////////////////
  779. // Adds a set of parameters for which to search to the internal
  780. // search device list.
  781. // Parameters:
  782. // *pstDeviceSearchMask_: A pointer to an
  783. // ANTFS_DEVICE_PARAMETERS structure. Set a
  784. // member to zero (0) to wildcard search for
  785. // it. Otherwise, set the bits that you want
  786. // to be matched to 1 in each member. Members
  787. // that are integer values will be treated the
  788. // same as bit fields for the purposes for the mask.
  789. // *pstDeviceParameters_: A pointer to an
  790. // ANTFS_DEVICE_PARAMETERS structure. Set
  791. // the member to the desired search value.
  792. // A member in this structure is ignored if
  793. // the associated member in the
  794. // *pstDeviceSearchMask_ parameter is set
  795. // to zero (0) for wildcard.
  796. // Returns a handle the the search device entry. If the return
  797. // value is NULL, the function failed adding the device entry.
  798. // This means that the device list is already full.
  799. // Operation:
  800. // Note that the default search masks should normally be applied
  801. // to the ucStatusByte1 and ucStatusByte2 members of the
  802. // *pstDeviceSearchMask_ parameter. Eg;
  803. // pstMyDeviceSearchMask->ucStatusByte1 =
  804. // ANTFS_STATUS1_DEFAULT_SEARCH_MASK & ucMyStatus1Criteria;
  805. // Setting bits outside the masks, especially reserved bits, may
  806. // lead to undesired behaviour.
  807. /////////////////////////////////////////////////////////////////
  808. void RemoveSearchDevice(USHORT usHandle_);
  809. /////////////////////////////////////////////////////////////////
  810. // Removes a device entry from the internal search list.
  811. // Parameters:
  812. // usHandle_: Handle to the device entry to be removed
  813. // from the list.
  814. /////////////////////////////////////////////////////////////////
  815. void ClearSearchDeviceList(void);
  816. /////////////////////////////////////////////////////////////////
  817. // Clears the internal search device list.
  818. /////////////////////////////////////////////////////////////////
  819. BOOL Blackout(ULONG ulDeviceID_, USHORT usManufacturerID_, USHORT usDeviceType_, USHORT usBlackoutTime_);
  820. /////////////////////////////////////////////////////////////////
  821. // Put the device on a blackout list for a period of time.
  822. // Parameters:
  823. // ulDeviceID_: The device ID of a specific device.
  824. // usManufacturerID_: The specific manufacturer ID.
  825. // usDeviceType_: The specific device type.
  826. // usBlackoutTime_: The number of seconds the device ID
  827. // should remain on the blackout list. If
  828. // set to zero (0), then the device will
  829. // not be put on the blackout list. If set
  830. // to MAX_USHORT (0xFFFF), the device will
  831. // remain on the blackout list until
  832. // explicitly removed, or until the blackout
  833. // list is reset.
  834. // Returns TRUE if successful. Otherwise, it returns FALSE.
  835. // A wildcard parameter (0) is not allowed in any of the device
  836. // ID parameters and will result in returning FALSE.
  837. // Operation:
  838. // The remote device will not show up in any search results for
  839. // the duration specified in usBlackoutTime_. This allows the
  840. // host to more easily find other devices in crowded
  841. // environments.
  842. /////////////////////////////////////////////////////////////////
  843. BOOL RemoveBlackout(ULONG ulDeviceID_, USHORT usManufacturerID_, USHORT usDeviceType_);
  844. /////////////////////////////////////////////////////////////////
  845. // Remove the device from the blackout list.
  846. // Parameters:
  847. // ulDeviceID_: The device ID of a specific device.
  848. // usManufacturerID_: The specific manufacturer ID.
  849. // usDeviceType_: The specific device type.
  850. // Returns TRUE if successful. Returns FALSE if the device is
  851. // not found in the blackout list. A wildcard parameter (0) is
  852. // not allowed in any of the device ID parameters and will result
  853. // in returning FALSE.
  854. /////////////////////////////////////////////////////////////////
  855. void ClearBlackoutList(void);
  856. /////////////////////////////////////////////////////////////////
  857. // Clears the blackout list.
  858. /////////////////////////////////////////////////////////////////
  859. ANTFS_HOST_RESPONSE WaitForResponse(ULONG ulMilliseconds_);
  860. /////////////////////////////////////////////////////////////////
  861. // Wait for a response from the ANTFS host library
  862. // Parameters:
  863. // ulMilliseconds_: Set this value to the minimum time to
  864. // wait before returning. If the value is
  865. // 0, the function will return immediately.
  866. // If the value is DSI_THREAD_INFINITE, the
  867. // function will not time out.
  868. // If one or more responses are pending before the timeout
  869. // expires the function will return the first response that
  870. // occured. If no response is pending at the time the timeout
  871. // expires, ANTFS_HOST_RESPONSE_NONE is returned.
  872. /////////////////////////////////////////////////////////////////
  873. };
  874. #endif // ANTFS_HOST_CHANNEL