Hi!
In the ADL User Guide (ADL User Guide for Open AT Application Framework OS 6.51) I have found this sample code which doesn’t work for me. My application crashes and the modem restarts automatically as adl_fsEnterFS is called.
I am using Open AT Framework Firmware Package: 7.51.0.201205311751
Should I include any library, maybe? How should I do it?
Note. I had to comment adl_fsInit since it does not exist! It’s not even referenced in the documentation
void MyFunction ( void )
{
int ret = -1;
ADL_FS_FILE *file;
// init File System driver, to do only once
// adl_fsInit(); I HAD TO COMMENT THIS LINE THIS FUNCTION DOES NOT EXIST IN [b]adl_filesystem.h[/b]
// subscribe the current task to the File System service
// to do once per task using File System
ret = adl_fsEnterFS();
if ( ret )
{
TRACE (( 1, "MyFunction: adl_fsEnterFS error %d", ret ));
return ret;
}
// mount the first volume on the internal NOR Flash
ret = adl_fsMountDrive( 0, ADL_FS_INTERNAL_NOR, NULL );
TRACE (( 1, "MyFunction: adl_fsMountDrive error %d", ret ));
{
TRACE (( 1, "MyFunction: adl_fsEnterFS error %d", ret ));
return ret;
}
// set the first volume as current volume
adl_fsChDrive( 0 );
// open a file in read mode
file = adl_fsOpen("/dir/file.txt", "r");
if (file == NULL)
{
TRACE (( 1, "MyFunction: error while opening file " ));
return -1;
}
// close the file
adl_fsClose(file);
// release File System service from current task
adl_fsReleaseFS();
}
Thanks to anyone