Cordio Stack and Cordio Profiles  r2p3-02rel0
wdxc_main.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Wireless Data Exchange profile implementation.
6  *
7  * Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved.
8  * ARM Ltd. confidential and proprietary.
9  *
10  * IMPORTANT. Your use of this file is governed by a Software License Agreement
11  * ("Agreement") that must be accepted in order to download or otherwise receive a
12  * copy of this file. You may not use or copy this file for any purpose other than
13  * as described in the Agreement. If you do not agree to all of the terms of the
14  * Agreement do not use this file and delete all copies in your possession or control;
15  * if you do not have a copy of the Agreement, you must contact ARM Ltd. prior
16  * to any use, copying or further distribution of this software.
17  */
18 /*************************************************************************************************/
19 
20 #ifndef WDXC_MAIN_H
21 #define WDXC_MAIN_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*! \addtogroup WIRELESS_DATA_EXCHANGE_PROFILE
28  * \{ */
29 
30 /**************************************************************************************************
31  Data Types
32 **************************************************************************************************/
33 
34 /*! \brief WDXC Connection Control Block */
35 typedef struct
36 {
37  uint16_t *pHdlList; /*!< \brief Attrtibute Handles */
38 
39  /* Operation in progress Control */
40  uint16_t fileHdl; /*!< \brief File Handle */
41 
42  /* File Listing Control */
43  wsfEfsFileInfo_t *pFileList; /*!< \brief File Listing storage */
44  uint16_t maxFiles; /*!< \brief Size of pFileList in number of wsfEfsFileInfo_t objects */
45  uint16_t fileCount; /*!< \brief Number of files on peer device */
46  uint16_t fDlPos; /*!< \brief Position in the download of file information */
47 } wdxcConnCb_t;
48 
49 /*! \brief WDXC Control Block */
50 typedef struct
51 {
52  wdxcConnCb_t conn[DM_CONN_MAX]; /*!< \brief Connection control */
53  WdxcFtdCallback_t *pFtdCallback; /*!< \brief File Transfer Data Application Callback */
54  WdxcFtcCallback_t *pFtcCallback; /*!< \brief File Transfer Control Application Callback */
55 } wdxcCb_t;
56 
57 
58 /**************************************************************************************************
59  Function Declarations
60 **************************************************************************************************/
61 
62 /*************************************************************************************************/
63 /*!
64  * \brief Send a request to abort a wdx operation.
65  *
66  * \param connId Connection ID.
67  * \param fileHdl Handle of file to abort operation on peer device
68  *
69  * \return None.
70  */
71 /*************************************************************************************************/
72 void WdxcFtcSendAbort(dmConnId_t connId, uint16_t fileHdl);
73 
74 /*************************************************************************************************/
75 /*!
76  * \brief Send a request to erase a file.
77  *
78  * \param connId Connection ID.
79  * \param fileHdl Handle of file to erase on peer device
80  *
81  * \return None.
82  */
83 /*************************************************************************************************/
84 void WdxcFtcSendEraseFile(dmConnId_t connId, uint16_t fileHdl);
85 
86 /*************************************************************************************************/
87 /*!
88  * \brief Send a request to verify a file.
89  *
90  * \param connId Connection ID.
91  * \param fileHdl Handle of file to verify on peer device
92  *
93  * \return None.
94  */
95 /*************************************************************************************************/
96 void WdxcFtcSendVerifyFile(dmConnId_t connId, uint16_t fileHdl);
97 
98 /*************************************************************************************************/
99 /*!
100  * \brief Send a request to put a block of data into a file on the peer device
101  *
102  * \param connId Connection ID.
103  * \param fileHdl Handle of file on peer device
104  * \param offset The offset from the beginning of the file in bytes
105  * \param len The number of bytes to put
106  * \param fileSize The size of the file in bytes
107  * \param type reserved
108  *
109  * \return None.
110  */
111 /*************************************************************************************************/
112 void WdxcFtcSendPutReq(dmConnId_t connId, uint16_t fileHdl, uint32_t offset,
113  uint32_t len, uint32_t fileSize, uint8_t type);
114 
115 /*************************************************************************************************/
116 /*!
117  * \brief Send a request to perform a get a block of data from a file on the peer device
118  *
119  * \param connId Connection ID.
120  * \param fileHdl Handle of file to verify on peer device
121  * \param offset The offset from the beginning of the file in bytes
122  * \param len The number of bytes to get
123  * \param type reserved
124  *
125  * \return None.
126  */
127 /*************************************************************************************************/
128 void WdxcFtcSendGetReq(dmConnId_t connId, uint16_t fileHdl, uint32_t offset, uint32_t len, uint8_t type);
129 
130 /*! \} */ /* WIRELESS_DATA_EXCHANGE_PROFILE */
131 
132 #ifdef __cplusplus
133 };
134 #endif
135 
136 #endif /* WDXC_MAIN_H */
void WdxcFtcSendAbort(dmConnId_t connId, uint16_t fileHdl)
Send a request to abort a wdx operation.
void WdxcFtcSendVerifyFile(dmConnId_t connId, uint16_t fileHdl)
Send a request to verify a file.
uint16_t fDlPos
Position in the download of file information.
Definition: wdxc_main.h:46
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
void WdxcFtdCallback_t(dmConnId_t connId, uint16_t handle, uint16_t len, uint8_t *pData)
WDXC File Transfer Data callback.
Definition: wdxc_api.h:73
File Listing Information.
Definition: wsf_efs.h:135
uint16_t fileCount
Number of files on peer device.
Definition: wdxc_main.h:45
void WdxcFtcSendPutReq(dmConnId_t connId, uint16_t fileHdl, uint32_t offset, uint32_t len, uint32_t fileSize, uint8_t type)
Send a request to put a block of data into a file on the peer device.
void WdxcFtcSendGetReq(dmConnId_t connId, uint16_t fileHdl, uint32_t offset, uint32_t len, uint8_t type)
Send a request to perform a get a block of data from a file on the peer device.
uint16_t fileHdl
File Handle.
Definition: wdxc_main.h:40
uint16_t maxFiles
Size of pFileList in number of wsfEfsFileInfo_t objects.
Definition: wdxc_main.h:44
WDXC Control Block.
Definition: wdxc_main.h:50
unsigned long uint32_t
Unsigned 32-bit value.
Definition: wsf_types.h:71
uint16_t * pHdlList
Attrtibute Handles.
Definition: wdxc_main.h:37
void WdxcFtcSendEraseFile(dmConnId_t connId, uint16_t fileHdl)
Send a request to erase a file.
WdxcFtcCallback_t * pFtcCallback
File Transfer Control Application Callback.
Definition: wdxc_main.h:54
void WdxcFtcCallback_t(dmConnId_t connId, uint16_t handle, uint8_t op, uint8_t status)
WDXC File Transfer Control callback.
Definition: wdxc_api.h:87
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
#define DM_CONN_MAX
Maximum number of connections.
Definition: cfg_stack.h:74
WdxcFtdCallback_t * pFtdCallback
File Transfer Data Application Callback.
Definition: wdxc_main.h:53
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
WDXC Connection Control Block.
Definition: wdxc_main.h:35
wsfEfsFileInfo_t * pFileList
File Listing storage.
Definition: wdxc_main.h:43