MBNG_FILE_L
Detailed Description
Label File access functions
NOTE: before accessing the SD Card, the upper level function should synchronize with the SD Card semaphore! MUTEX_SDCARD_TAKE; // to take the semaphore MUTEX_SDCARD_GIVE; // to release the semaphore
Define Documentation
#define BIN_FILE_FORMAT_NUMBER 0 |
#define DEBUG_VERBOSE_LEVEL 1 |
Include files for optional debugging messages via DEBUG_MSG (defined in mios32_config.h)
#define MBNG_FILES_PATH "/" |
Function Documentation
s32 generateNglFileMD5 |
( |
char * |
filepath, |
|
|
u8 |
md5_checksum[16] | |
|
) |
| | |
creates the MD5 checksum over the .NGL file
- Returns:
- < 0 on errors
s32 MBNG_FILE_L_Debug |
( |
void |
|
) |
|
sends label data to debug terminal
- Returns:
- < 0 on errors
const char* MBNG_FILE_L_GetLabel |
( |
char * |
label, |
|
|
u16 |
value | |
|
) |
| | |
- Returns:
- the content of a label for a given value SDCARD mutex handled automatically if SD Card really has to be accessed
s32 MBNG_FILE_L_Init |
( |
u32 |
mode |
) |
|
s32 MBNG_FILE_L_Load |
( |
char * |
filename |
) |
|
Loads patch file Called from MBNG_FILE_CheckSDCard() when the SD card has been connected
- Returns:
- < 0 on errors
s32 MBNG_FILE_L_Read |
( |
char * |
filename |
) |
|
s32 MBNG_FILE_L_Unload |
( |
void |
|
) |
|
Unloads label file Called from MBNG_FILE_CheckSDCard() when the SD card has been disconnected
- Returns:
- < 0 on errors
s32 MBNG_FILE_L_Valid |
( |
void |
|
) |
|
- Returns:
- 1 if current label file valid
-
0 if current label file not valid
s32 MBNG_FILE_L_Write |
( |
char * |
filename |
) |
|
writes data into label file
- Returns:
- < 0 on errors (error codes are documented in seq_file.h)
s32 parseBinFile |
( |
char * |
filepath |
) |
|
parse the .BIN file for labels < 0 on errors
s32 readBinFileMD5 |
( |
char * |
filepath, |
|
|
u8 |
md5_checksum[16] | |
|
) |
| | |
read the .BIN file and checks if it is valid md5_checksum_binfile[16] contains the expected MD5 checksum of the .NGL file if valid
- Returns:
- < 0 on errors
Variable Documentation
reads the label file content (again)
- Returns:
- < 0 on errors (error codes are documented in mbng_file.h)