Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I want to write data to a file.  How do I do it?

Is AEECLSID_FILEMGR deprecated or not?

Why can I read documentation about IFileSystem but not implement it?

 

AEECLSID_FILEMGR_313 says it is deprecated and I should use AEECLSID_FILEMGR but it is missing from the documentation:

https://developer.brewmp.com/reference/api/brew_mp_1.0.4/system/file_system

 

IFileSystem apparently is restricted to OEM developers.  Where is this documented?

I found out that the reference docs for Brew MP 1.xxx Pro add badges for functions (BL1, OEM, etc).  This is helpful but I just found it out in the last few minutes it would have helped to know that a few days ago.

 

Thanks,

Jamie

you can use IFileSystem2  with AEECLSID_FileSystem2 to open the file it returns a IFilePort1 pointer. Then u can read/write using IFilePort1
Privileges required
AEEPRIVID_FileSystemR - for read-only access
AEEPRIVID_FileSystemRW - for read/write access
 
 
________________________________________________
//FOR FILESYSTEM2
#include "AEEIFileSystem2.h"
#include "AEEIFilePort1.h"
#include "AEEFileSystem2.bid"
void c_OpenFile(c_Instal *pMe, const char*fileName)
{
  int nErr;
  IFileSystem2 *pFileSystem2;
  IFilePort1  *pFilePort1;
  int bufLen = 10;
  int written = 0;
 
  nErr = ISHELL_CreateInstance(pMe->applet.m_pIShell, AEECLSID_FileSystem2, (void**)pFileSystem2);
  if(nErr != SUCCESS) {
       DBGPRINTF("******FILESYSTEM2 %d", nErr);
       return;
  }
  nErr = IFileSystem2_Open(pFileSystem2, fileName, FS_CAP_WRONLY, &pFilePort1);
  if(nErr != SUCCESS) {
     DBGPRINTF("******FILE OPEN %d", nErr);
     return;
  }
  nErr = IFilePort1_Write(pFilePort1, (byte*)"write this to file", bufLen, &written);
  if(written == 10){
      DBGPRINTF("******ALL data written");
  }
  IFilePort1_Close(pFilePort1);
  IQI_RELEASEIF(pFilePort1);
  IQI_RELEASEIF(pFileSystem2);
}
 
 

you can use IFileSystem2  with AEECLSID_FileSystem2 to open the file it returns a IFilePort1 pointer. Then u can read/write using IFilePort1
Privileges required
AEEPRIVID_FileSystemR - for read-only access
AEEPRIVID_FileSystemRW - for read/write access
 
 
________________________________________________
//FOR FILESYSTEM2
#include "AEEIFileSystem2.h"
#include "AEEIFilePort1.h"
#include "AEEFileSystem2.bid"
void c_OpenFile(c_Instal *pMe, const char*fileName)
{
  int nErr;
  IFileSystem2 *pFileSystem2;
  IFilePort1  *pFilePort1;
  int bufLen = 10;
  int written = 0;
 
  nErr = ISHELL_CreateInstance(pMe->applet.m_pIShell, AEECLSID_FileSystem2, (void**)pFileSystem2);
  if(nErr != SUCCESS) {
       DBGPRINTF("******FILESYSTEM2 %d", nErr);
       return;
  }
  nErr = IFileSystem2_Open(pFileSystem2, fileName, FS_CAP_WRONLY, &pFilePort1);
  if(nErr != SUCCESS) {
     DBGPRINTF("******FILE OPEN %d", nErr);
     return;
  }
  nErr = IFilePort1_Write(pFilePort1, (byte*)"write this to file", bufLen, &written);
  if(written == 10){
      DBGPRINTF("******ALL data written");
  }
  IFilePort1_Close(pFilePort1);
  IQI_RELEASEIF(pFilePort1);
  IQI_RELEASEIF(pFileSystem2);
}
 
 

IFileSystem2 & IFilePort1 is not restricted to the OEM. you need to add the privilages required & use it.

IFileSystem2 & IFilePort1 is not restricted to the OEM. you need to add the privilages required & use it.

Thanks for the quick reply.
 
I found the files you included here:
Qualcomm/Brew MP SDK/Platforms/1.0.4.508/platform/
  system/inc/AEEIFileSystem2.h
  system/inc/AEEIFilePort1.h
  deprecated/inc/AEEFileSystem2.bid
 
The .bid file says to use AEECFileSystem2.h which defines AEECLSID_CFileSystem2 instead of AEECLSID_FileSystem2.  I'll give it a try now.
 
Thanks again,
Jamie

Thanks for the quick reply.
 
I found the files you included here:
Qualcomm/Brew MP SDK/Platforms/1.0.4.508/platform/
  system/inc/AEEIFileSystem2.h
  system/inc/AEEIFilePort1.h
  deprecated/inc/AEEFileSystem2.bid
 
The .bid file says to use AEECFileSystem2.h which defines AEECLSID_CFileSystem2 instead of AEECLSID_FileSystem2.  I'll give it a try now.
 
Thanks again,
Jamie