How to simulate full device on emulator? | developer.brewmp.com How to simulate full device on emulator? | developer.brewmp.com

Developer

How to simulate full device on emulator?

I know how to emulate no connection in the emulator, but how I go with emulating only that is left say "583 bytes" in the file system, an so on...?

I assume you want to fill up the phone's EFS space in simulator.
1. You can get the phones EFS space from the device properties
2. Copy files that are of size ( EFS space - 500KB ) to your applet folder.
3. Now your EFS space will be 500KB.
I am not sure it works for all. The BREW Version I tried is 3.1.5.
Hope this helps.
Thanks,
Karthik

I assume you want to fill up the phone's EFS space in simulator.
1. You can get the phones EFS space from the device properties
2. Copy files that are of size ( EFS space - 500KB ) to your applet folder.
3. Now your EFS space will be 500KB.
I am not sure it works for all. The BREW Version I tried is 3.1.5.
Hope this helps.
Thanks,
Karthik

However, aparently
[HTML]space = IFILEMGR_GetFreeSpace(filemgr, NULL);[/HTML]
always return a non zero value in "space" var in the emulator (havent check the value on the phone), the function that start failing is _Write that will write 0 bytes.
Thus the question is: IFILEMGR_GetFreeSpace is not returning the correct val in the emulator or what is happening?
EDIT
Also make the assumption that my sln is in:
* Desktop/project/name.sln
And the project uses some files in root Desktop/project/ and others inside Desktop/project/config and Desktop/project/tmp
then Desktop/project/ has lot of VS thingies apart from the project like the database for debug, etc. thus my problem actually is what do I need to fill?

However, aparently
[HTML]space = IFILEMGR_GetFreeSpace(filemgr, NULL);[/HTML]
always return a non zero value in "space" var in the emulator (havent check the value on the phone), the function that start failing is _Write that will write 0 bytes.
Thus the question is: IFILEMGR_GetFreeSpace is not returning the correct val in the emulator or what is happening?
EDIT
Also make the assumption that my sln is in:
* Desktop/project/name.sln
And the project uses some files in root Desktop/project/ and others inside Desktop/project/config and Desktop/project/tmp
then Desktop/project/ has lot of VS thingies apart from the project like the database for debug, etc. thus my problem actually is what do I need to fill?

If you know the number of files tyo be created, that is the creation is progresssive, then you dont need to set the file limit, but the number of files to be created (_OFM_CREATE), but the device configurator sets limits like 7 - xxxxxx.
Then you can't set in the device configurator a very thiny limit say: 0, 2, 6, thus in the creation of the app, you can create 7 files, then 7 files in the configuration device, will mean for your app 0 files, then 8 files 1 extra file, and so on.

If you know the number of files tyo be created, that is the creation is progresssive, then you dont need to set the file limit, but the number of files to be created (_OFM_CREATE), but the device configurator sets limits like 7 - xxxxxx.
Then you can't set in the device configurator a very thiny limit say: 0, 2, 6, thus in the creation of the app, you can create 7 files, then 7 files in the configuration device, will mean for your app 0 files, then 8 files 1 extra file, and so on.

mmmm, I think the max file allow in device configurator dont work...
Set in device configurator -> details -> file system a value like 150 & use the next function for test the creation of 170 files, you see, all the files are created!!!
[HTML]#define FS_LIMITS_PER_MODULE__CREATION 170
void EmptyFileCreationof7(IShell *sh){
IFileMgr *filem = NULL;
IFile *file = NULL;
int i;
ISHELL_CreateInstance(sh, AEECLSID_FILEMGR, (void **)&filem);
if(filem){
IFILEMGR_Remove(filem, "tmp/empty.txt");
for(i = 0; i < FS_LIMITS_PER_MODULE__CREATION; i++){
file = IFILEMGR_OpenFile(filem, "tmp/empty.txt", _OFM_CREATE);
if(file){
IFILE_Write(file, "w", 1);
RELEASEIF(file);
IFILEMGR_Remove(filem, "tmp/empty.txt");
DBGPRINTF("Creado %d", i);
}else{
DBGPRINTF("No creado %d", i);
}
}
}
IFILEMGR_Remove(filem, "tmp/empty.txt");
RELEASEIF(filem);
[/HTML]
Shame on me, definitelly... this is the spected behaviour???? or what Im missing?
EDIT:
Finally I get to Simply create my own function for check the creation of files and limit it...
#define MAX_CREATION_ALLOW_FILES 10
IFile *CreaYAbreArch(StructAppName *pMe, IFileMgr *fMgr, char *nombre){
IFile *file = NULL;
if(pMe->createdFiles < MAX_CREATION_ALLOW_FILES){
pMe->createdFiles++;
file = IFILEMGR_OpenFile(fMgr, nombre, _OFM_CREATE);
}
return file;

And it simply works, you get ride off all the Unpleasant "amucinance"(?) of this part of BREW emu.

mmmm, I think the max file allow in device configurator dont work...
Set in device configurator -> details -> file system a value like 150 & use the next function for test the creation of 170 files, you see, all the files are created!!!
[HTML]#define FS_LIMITS_PER_MODULE__CREATION 170
void EmptyFileCreationof7(IShell *sh){
IFileMgr *filem = NULL;
IFile *file = NULL;
int i;
ISHELL_CreateInstance(sh, AEECLSID_FILEMGR, (void **)&filem);
if(filem){
IFILEMGR_Remove(filem, "tmp/empty.txt");
for(i = 0; i < FS_LIMITS_PER_MODULE__CREATION; i++){
file = IFILEMGR_OpenFile(filem, "tmp/empty.txt", _OFM_CREATE);
if(file){
IFILE_Write(file, "w", 1);
RELEASEIF(file);
IFILEMGR_Remove(filem, "tmp/empty.txt");
DBGPRINTF("Creado %d", i);
}else{
DBGPRINTF("No creado %d", i);
}
}
}
IFILEMGR_Remove(filem, "tmp/empty.txt");
RELEASEIF(filem);
[/HTML]
Shame on me, definitelly... this is the spected behaviour???? or what Im missing?
EDIT:
Finally I get to Simply create my own function for check the creation of files and limit it...
#define MAX_CREATION_ALLOW_FILES 10
IFile *CreaYAbreArch(StructAppName *pMe, IFileMgr *fMgr, char *nombre){
IFile *file = NULL;
if(pMe->createdFiles < MAX_CREATION_ALLOW_FILES){
pMe->createdFiles++;
file = IFILEMGR_OpenFile(fMgr, nombre, _OFM_CREATE);
}
return file;

And it simply works, you get ride off all the Unpleasant "amucinance"(?) of this part of BREW emu.

its something like:
32767 xxxxxxxxx
change it to:
0 0
resave, and fire up the simulator /emulator /w that device pack.. you can run your app and see how it behaves.

its something like:
32767 xxxxxxxxx
change it to:
0 0
resave, and fire up the simulator /emulator /w that device pack.. you can run your app and see how it behaves.