1 |
/**************************************************************************** |
2 |
/* F i l e D a t a |
3 |
/* |
4 |
/* Module : FileManager |
5 |
/* C.I. No. : |
6 |
/* $Revision: 1.3 $ |
7 |
/* $Date: 2003/10/29 17:41:48 $ |
8 |
/* Belonging to : |
9 |
/* : |
10 |
/* $RCSfile: FS_FileSystem_p.c,v $ |
11 |
/* Program Type : |
12 |
/* Sub-modules : |
13 |
/* |
14 |
/**************************************************************************** |
15 |
/* S W D e v e l o p m e n t E n v i r o n m e n t |
16 |
/* |
17 |
/* Host system : |
18 |
/* SW Compiler : |
19 |
/* $Author: sebastiani $ |
20 |
/* : |
21 |
/**************************************************************************** |
22 |
/* U p d a t i n g |
23 |
/* |
24 |
/* $Log: FS_FileSystem_p.c,v $ |
25 |
/* Revision 1.3 2003/10/29 17:41:48 sebastiani |
26 |
/* *** empty log message *** |
27 |
/* |
28 |
/* Revision 1.2 2003/09/10 13:38:13 laben |
29 |
/* New File System Model: |
30 |
/* jusy one file used like a circular buffer. |
31 |
/* |
32 |
/* Revision 1.1.1.1 2003/08/04 09:40:21 sebastiani |
33 |
/* Imported sources laben rel. 19.06.2003 integrated with pam2 |
34 |
/* |
35 |
/* Revision 1.3 2002/05/09 08:16:34 zulia |
36 |
/* * acceptance release |
37 |
/* |
38 |
/* |
39 |
/*****************************************************************************/ |
40 |
|
41 |
/*============================= Include File ================================*/ |
42 |
|
43 |
#include <src/FileManager/FileSystem/FS_FileSystem_p.h> |
44 |
#include <src/FileManager/FileSystem/FS_FileSystem_op.h> |
45 |
|
46 |
|
47 |
/*****************************************************************************/ |
48 |
|
49 |
/*======= F i l e S y s t e m P R O V I D E D I N T E R F A C E ======*/ |
50 |
|
51 |
/*****************************************************************************/ |
52 |
|
53 |
/*========================= E N T R Y P O I N T ==========================*/ |
54 |
|
55 |
/*****************************************************************************/ |
56 |
/* @Function: FS_piInitFileSystem */ |
57 |
/* @Purpose : */ |
58 |
/* Provided Interface to initialize the FileSystem */ |
59 |
/* */ |
60 |
/* @@ */ |
61 |
/* @Parameter Name @Mode @Description */ |
62 |
/* FS_EXITCODE OUT Return code */ |
63 |
/* @@ */ |
64 |
/*****************************************************************************/ |
65 |
|
66 |
FS_EXITCODE FS_piInitFileSystem(void) |
67 |
{ |
68 |
FS_EXITCODE status; |
69 |
|
70 |
status = FS_opInitFileSystem(); |
71 |
return (status); |
72 |
} |
73 |
|
74 |
/*****************************************************************************/ |
75 |
/* @Function: FS_piGetFileInfo */ |
76 |
/* @Purpose : */ |
77 |
/* Provided Interface to get the status of the selected file */ |
78 |
/* */ |
79 |
/* @@ */ |
80 |
/* @Parameter Name @Mode @Description */ |
81 |
/* FileId IN File ID */ |
82 |
/* *FileInfo OUT File status */ |
83 |
/* FS_EXITCODE OUT Return code */ |
84 |
/* @@ */ |
85 |
/*****************************************************************************/ |
86 |
|
87 |
FS_EXITCODE FS_piGetFileInfo(FS_FILEID FileId, FS_FILE_DESCR* FileInfo) |
88 |
{ |
89 |
FS_EXITCODE status; |
90 |
|
91 |
status = FS_opGetFileInfo(FileId, FileInfo); |
92 |
return (status); |
93 |
} |
94 |
|
95 |
|
96 |
/*****************************************************************************/ |
97 |
/* @Function: FS_piWriteFile */ |
98 |
/* @Purpose : */ |
99 |
/* Provided Interface to check if a file could be written. The status of the*/ |
100 |
/* selected file is not updated until the UpdateFile operation is called */ |
101 |
/* */ |
102 |
/* @@ */ |
103 |
/* @Parameter Name @Mode @Description */ |
104 |
/* FileId IN File ID */ |
105 |
/* WriteSize IN Size of the data to be saved (in samples) */ |
106 |
/* WriteAddr OUT Address where to store data in the file */ |
107 |
/* FS_EXITCODE OUT Return code */ |
108 |
/* @@ */ |
109 |
/*****************************************************************************/ |
110 |
|
111 |
FS_EXITCODE FS_piWriteFile(FS_FILEID FileId, UINT32 WriteSize, |
112 |
UINT32 *WriteAddr) |
113 |
{ |
114 |
FS_EXITCODE status; |
115 |
|
116 |
status = FS_opWriteFile(FileId, WriteSize, WriteAddr); |
117 |
return (status); |
118 |
} |
119 |
|
120 |
/*****************************************************************************/ |
121 |
/* @Function: FS_piUpdateFile */ |
122 |
/* @Purpose : */ |
123 |
/* Provided Interface to update file size after a store operation */ |
124 |
/* */ |
125 |
/* @@ */ |
126 |
/* @Parameter Name @Mode @Description */ |
127 |
/* FS_EXITCODE OUT Return code */ |
128 |
/* @@ */ |
129 |
/*****************************************************************************/ |
130 |
|
131 |
FS_EXITCODE FS_piUpdateFile(void) |
132 |
{ |
133 |
FS_EXITCODE status; |
134 |
|
135 |
status = FS_opUpdateFile(); |
136 |
return (status); |
137 |
} |
138 |
|
139 |
/*****************************************************************************/ |
140 |
/* @Function: FS_piMakeFileImage */ |
141 |
/* @Purpose : */ |
142 |
/* Provided Interface to build the sector chain for the download operation */ |
143 |
/* */ |
144 |
/* @@ */ |
145 |
/* @Parameter Name @Mode @Description */ |
146 |
/* StartSector IN First sector of the partition to add to the */ |
147 |
/* sector chain */ |
148 |
/* Size IN Size of the partition (in sample) */ |
149 |
/* New IN This flag is used to build a new chain or to */ |
150 |
/* append a partition to an existing chain */ |
151 |
/* nsect OUT Number of sectors added to the chain */ |
152 |
/* FS_EXITCODE OUT Return code */ |
153 |
/* @@ */ |
154 |
/*****************************************************************************/ |
155 |
|
156 |
FS_EXITCODE FS_piMakeFileImage(UINT32 StartSector, UINT32 Size, UINT32* nsect, |
157 |
BOOL New) |
158 |
{ |
159 |
FS_EXITCODE status; |
160 |
|
161 |
status = FS_opMakeFileImage(StartSector, Size, nsect, New); |
162 |
return (status); |
163 |
} |
164 |
|
165 |
/*****************************************************************************/ |
166 |
/* @Function: FS_piGetCurrentSector */ |
167 |
/* @Purpose : */ |
168 |
/* Provided Interface to retrive the current sector information to be used */ |
169 |
/* in a downlink sequence */ |
170 |
/* */ |
171 |
/* @@ */ |
172 |
/* @Parameter Name @Mode @Description */ |
173 |
/* *SectorInfo OUT Current sector information */ |
174 |
/* FS_EXITCODE OUT Return code */ |
175 |
/* @@ */ |
176 |
/*****************************************************************************/ |
177 |
|
178 |
FS_EXITCODE FS_piGetCurrentSector(FS_SECT_DESCR *SectorInfo) |
179 |
{ |
180 |
FS_EXITCODE status; |
181 |
|
182 |
status = FS_opGetCurrentSector(SectorInfo); |
183 |
return (status); |
184 |
} |
185 |
|
186 |
/*****************************************************************************/ |
187 |
/* @Function: FS_piGetNextSector */ |
188 |
/* @Purpose : */ |
189 |
/* Provided Interface to retrive the next sector information to be used */ |
190 |
/* in a downlink sequence */ |
191 |
/* */ |
192 |
/* @@ */ |
193 |
/* @Parameter Name @Mode @Description */ |
194 |
/* *SectorInfo OUT Next sector information */ |
195 |
/* FS_EXITCODE OUT Return code */ |
196 |
/* @@ */ |
197 |
/*****************************************************************************/ |
198 |
|
199 |
FS_EXITCODE FS_piGetNextSector(FS_SECT_DESCR *SectorInfo) |
200 |
{ |
201 |
FS_EXITCODE status; |
202 |
|
203 |
status = FS_opGetNextSector(SectorInfo); |
204 |
return (status); |
205 |
} |
206 |
|
207 |
/*****************************************************************************/ |
208 |
/* @Function: FS_piResetFile */ |
209 |
/* @Purpose : */ |
210 |
/* Provided Interface to reset the status of a file. By now it means that */ |
211 |
/* the size is set to 0 */ |
212 |
/* in a downlink sequence */ |
213 |
/* */ |
214 |
/* @@ */ |
215 |
/* @Parameter Name @Mode @Description */ |
216 |
/* *SectorInfo OUT Next sector information */ |
217 |
/* FS_EXITCODE OUT Return code */ |
218 |
/* @@ */ |
219 |
/*****************************************************************************/ |
220 |
|
221 |
FS_EXITCODE FS_piResetFile(FS_FILEID FileId) |
222 |
{ |
223 |
FS_EXITCODE status; |
224 |
|
225 |
status = FS_opResetFile(FileId); |
226 |
return (status); |
227 |
} |
228 |
|
229 |
FS_EXITCODE FS_piUpdateSectorPointer(){ |
230 |
|
231 |
FS_EXITCODE status; |
232 |
status = FS_opUpdateSectorPointer(); |
233 |
return (status); |
234 |
} |
235 |
|
236 |
void FS_piLogInfo() { |
237 |
FS_opLogInfo(); |
238 |
} |