#include <ctype.h>
#include "conf_explorer.h"
#include "navigation.h"
#include "file.h"
#include <LIB_CTRLACCESS>
Macros | |
#define | SIZE_OF_SPLIT_COPY ((1*1024*1024L)/512L) |
Functions | |
void | nav_checkdisk_disable (void) |
This function disables the disk check before each actions on disk. More... | |
void | nav_checkdisk_enable (void) |
This function enables the disk check before each actions on disk. More... | |
bool | nav_copy (uint8_t u8_idnav) |
This function copies the navigator information to another navigator. More... | |
bool | nav_dir_cd (void) |
This function enters in the selected directory in file list. More... | |
bool | nav_dir_gotoparent (void) |
This function goes to the parent directory. More... | |
bool | nav_dir_is_root (void) |
This function check the current directory. More... | |
bool | nav_dir_name (FS_STRING sz_path, uint8_t u8_size_max) |
This function returns the directory name corresponding at the file list. More... | |
bool | nav_dir_root (void) |
This function initializes the file list on the root directory. More... | |
uint8_t | nav_drive_get (void) |
This function returns the selected drive number. More... | |
uint8_t | nav_drive_getname (void) |
This function returns the selected drive letter. More... | |
uint8_t | nav_drive_nb (void) |
This function returns the number of devices available. More... | |
bool | nav_drive_set (uint8_t u8_number) |
This function selects a drive in navigator but don't mount the disk partition. More... | |
void | nav_exit (void) |
This function flush ALL navigations before exit of file system core. More... | |
uint8_t | nav_file_attributget (void) |
This function returns the Attribute of selected file. More... | |
bool | nav_file_checkext (const FS_STRING sz_filterext) |
This function checks the extension of selected file. More... | |
bool | nav_file_dateget (FS_STRING sz_date, bool type_date) |
This function returns the date of selected file. More... | |
bool | nav_file_getname (FS_STRING sz_name, uint8_t u8_size_max) |
This function returns the name of selected file. More... | |
bool | nav_file_isdir (void) |
This function returns the type of selected file. More... | |
bool | nav_file_isreadonly (void) |
This function checks the write protection of disk and the Attribute "read only" of selected file. More... | |
uint32_t | nav_file_lgt (void) |
This function returns the size of selected file (unit byte) More... | |
uint16_t | nav_file_lgtsector (void) |
This function returns the size of selected file (unit sector) More... | |
bool | nav_file_name (FS_STRING sz_name, uint8_t u8_size_max, bool b_mode, bool b_match_case) |
This function returns the name of selected file or checks the string with the name of selected file. More... | |
bool | nav_filelist_bol (void) |
This function checks the beginning of file list. More... | |
bool | nav_filelist_eol (void) |
This function checks the end of file list. More... | |
bool | nav_filelist_exist (bool b_type) |
This function checks the presence of files or directories in file list. More... | |
bool | nav_filelist_fileisnotopen (void) |
This function checks if no file is open. More... | |
bool | nav_filelist_findname (const FS_STRING sz_name, bool b_match_case) |
This function searches a file name in file list. More... | |
bool | nav_filelist_first (bool b_type) |
This function goes to at the first file or directory in file list. More... | |
uint16_t | nav_filelist_get (void) |
This function returns the position of selected file in file list. More... | |
bool | nav_filelist_goto (uint16_t u16_newpos) |
This function goes at a position in file list. More... | |
bool | nav_filelist_last (bool b_type) |
This function goes to at the last file or directory in file list. More... | |
uint16_t | nav_filelist_nb (bool b_type) |
This function computes the number of files or directories in file list. More... | |
bool | nav_filelist_reset (void) |
This function resets the selection pointer, so "no file selected" in file list. More... | |
bool | nav_filelist_set (uint16_t u16_nb, bool b_direction) |
This function moves the selection pointer in file list. More... | |
bool | nav_filelist_single_disable (void) |
To display in File List the directories AND files. More... | |
bool | nav_filelist_single_enable (bool b_type) |
To display in File List only the files OR directories. More... | |
bool | nav_filelist_validpos (void) |
This function checks if a file is selected. More... | |
uint8_t | nav_get (void) |
This function returns the navigation identifier used. More... | |
bool | nav_getcwd (FS_STRING sz_path, uint8_t u8_size_path, bool b_view_file_select) |
This function returns the full path of the selection. More... | |
Fs_index | nav_getindex (void) |
This function returns a small index on the selected file. More... | |
bool | nav_gotoindex (const Fs_index _MEM_TYPE_SLOW_ *index) |
This function selects a file in the navigator via a file index. More... | |
uint8_t | nav_partition_cluster_size (void) |
This function returns the partition cluster size. More... | |
uint32_t | nav_partition_freespace (void) |
This function returns the partition free space. More... | |
uint8_t | nav_partition_freespace_percent (void) |
This function returns the partition space free in percent. More... | |
bool | nav_partition_label (bool b_action, FS_STRING sz_label) |
This function reads or writes the label of selected partition. More... | |
bool | nav_partition_mount (void) |
This function mounts the selected partition. More... | |
uint8_t | nav_partition_nb (void) |
This function returns the number of partitions present on drive. More... | |
bool | nav_partition_serialnumber (bool b_action, uint8_t _MEM_TYPE_SLOW_ *a_u8_sn) |
This function reads or writes the serial number on the selected partition. More... | |
bool | nav_partition_set (uint8_t partition_number) |
This function selects a partition on drive. More... | |
uint32_t | nav_partition_space (void) |
This function returns partition total space. More... | |
uint8_t | nav_partition_type (void) |
This function gives the partition type. More... | |
void | nav_reset (void) |
This function resets ALL navigations to init file system core. More... | |
bool | nav_select (uint8_t u8_idnav) |
This function selects the navigation to use. More... | |
bool | nav_setcwd (FS_STRING sz_path, bool b_match_case, bool b_create) |
This function selects a disk position via a path. More... | |
void | nav_string_ascii (void) |
This function selects the ASCII mode for all routines with FS_STRING parameter. More... | |
void | nav_string_length_disable (void) |
This function deselects the LENGTH string mode for all routines with FS_STRING parameter. More... | |
void | nav_string_length_enable (void) |
This function selects the LENGTH string mode for all routines with FS_STRING parameter. More... | |
void | nav_string_unicode (void) |
This function selects the UNICODE mode for all routines with FS_STRING parameter. More... | |
#define SIZE_OF_SPLIT_COPY ((1*1024*1024L)/512L) |
void nav_checkdisk_disable | ( | void | ) |
This function disables the disk check before each actions on disk.
//! By default, between each read/write access a check disk (test unit ready) is sent at device. //! This check can reduce the speed access on specific disk. //!
References g_b_no_check_disk.
Referenced by reader_txt_get_line(), and wav_file_get_data().
void nav_checkdisk_enable | ( | void | ) |
This function enables the disk check before each actions on disk.
//! By default, between each read/write access a check disk (test unit ready) is sent at device. //! This check can reduce the speed access on specific disk. //!
References g_b_no_check_disk.
Referenced by reader_txt_get_line(), and wav_file_get_data().
bool nav_copy | ( | uint8_t | u8_idnav | ) |
This function copies the navigator information to another navigator.
@param u8_idnav navigator identifier where the main navigator will be copied @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! Use this routine to select quickly the same file in another navigator //!
References fat_copy_nav.
Referenced by ai_usb_ms_specific_audio_nav_playlist_play_link(), ai_usb_ms_support_info_image(), pl_main_open(), and pl_main_readline().
bool nav_dir_cd | ( | void | ) |
This function enters in the selected directory in file list.
@return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! After this routine the file list changes and contains the files and directories of the new directory. //! By default no file is selected. //!
References fat_check_mount_select_noopen(), fat_entry_is_dir(), fs_g_nav, fs_g_nav_entry, fs_g_nav_fast, nav_filelist_reset(), Fs_management::u16_entry_pos_sel_dir, Fs_management_fast::u16_entry_pos_sel_file, Fs_management_entry::u32_cluster, and Fs_management::u32_cluster_sel_dir.
Referenced by ai_usb_ms_nav_dir_cd(), nav_filterflat_cd(), nav_filterflat_next(), nav_filterflat_previous(), nav_filterlist_cd(), nav_flat_cd(), nav_flat_next(), nav_flat_previous(), nav_setcwd(), navauto_mov_explorer_is_dir(), navauto_mov_explorer_select_limit_dir_cur_folder(), and ushell_cmd_sync().
bool nav_dir_gotoparent | ( | void | ) |
This function goes to the parent directory.
@return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! After, the file list changes and contains the files and directories of the new directory. //! By default, the file selected in file list is the previous (children) directory. //!
References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fat_check_mount_noopen(), fat_get_entry_info(), fat_read_dir(), FS_DIR, FS_ERR_FS, FS_ERR_IS_ROOT, FS_FIND_NEXT, fs_g_nav, fs_g_nav_entry, fs_g_nav_fast, fs_g_status, nav_filelist_reset(), nav_filelist_set(), Fs_management_fast::u16_entry_pos_sel_file, Fs_management_entry::u32_cluster, and Fs_management::u32_cluster_sel_dir.
Referenced by nav_dir_name(), nav_filterflat_gotoparent(), nav_filterflat_reset(), nav_flat_gotoparent(), nav_flat_next(), nav_flat_previous(), nav_flat_reset(), nav_getcwd(), nav_setcwd(), navauto_mov_explorer_updir(), navauto_open(), ushell_cmd_gotoparent(), and ushell_cmd_sync().
bool nav_dir_is_root | ( | void | ) |
This function check the current directory.
References fat_check_mount_noopen(), fs_g_nav, and Fs_management::u32_cluster_sel_dir.
This function returns the directory name corresponding at the file list.
sz_path | string to store the name (ASCII or UNICODE ) |
u8_size_max | string size (unit ASCII or UNICODE ) |
References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fat_check_mount_noopen(), FS_FILE, fs_g_nav, fs_g_nav_entry, fs_g_nav_fast, FS_NAME_GET, g_b_string_length, Is_unicode, nav_dir_gotoparent(), nav_drive_getname(), nav_file_name(), status, Fs_management::u16_entry_pos_sel_dir, Fs_management_fast::u16_entry_pos_sel_file, Fs_management_entry::u32_cluster, Fs_management::u32_cluster_sel_dir, Fs_management_entry::u32_size, and Fs_management_entry::u8_attr.
Referenced by ai_usb_ms_nav_dir_name(), ai_usb_ms_specific_audio_nav_get_folder_name(), main(), and ushell_cmd_ls().
bool nav_dir_root | ( | void | ) |
This function initializes the file list on the root directory.
References nav_partition_mount().
Referenced by ai_usb_ms_nav_dir_root(), ai_usb_ms_nav_getplayfile(), nav_filterlist_root(), nav_flat_root(), nav_partition_label(), nav_setcwd(), and navauto_mov_explorer_reset().
uint8_t nav_drive_get | ( | void | ) |
This function returns the selected drive number.
References fs_g_nav, Fs_management::u8_lun, and Fs_management::u8_partition.
Referenced by ai_usb_ms_nav_drive_get(), main(), navauto_mov_ok_loop(), ushell_cmd_ls(), ushell_cmd_perform(), and ushell_cmd_space().
uint8_t nav_drive_getname | ( | void | ) |
This function returns the selected drive letter.
References fs_g_nav, Fs_management::u8_lun, and Fs_management::u8_partition.
Referenced by nav_dir_name(), and nav_getcwd().
uint8_t nav_drive_nb | ( | void | ) |
This function returns the number of devices available.
@return number of devices, 0 = NO DEVICE AVAILABLED
//! This value may be dynamic because it depends of memory drivers (e.g. Mass Storage disk on USB host mode) //!
References get_nb_lun().
Referenced by ai_usb_ms_nav_drive_nb(), main(), navauto_mov_ok_loop(), ushell_cmd_free_space(), ushell_cmd_mount(), and ushell_cmd_nb_drive().
bool nav_drive_set | ( | uint8_t | u8_number | ) |
This function selects a drive in navigator but don't mount the disk partition.
u8_number | device number (0 to nav_drive_nb()-1 ) |
References fat_check_noopen(), FS_ERR_END_OF_DRIVE, fs_g_nav, fs_g_nav_fast, fs_g_status, FS_TYPE_FAT_UNM, get_nb_lun(), Fs_management::u8_lun, Fs_management::u8_partition, and Fs_management_fast::u8_type_fat.
Referenced by ai_sd_mmc_nav_drive_set(), ai_usb_ms_nav_drive_set(), main(), nav_filterlist_gotoindex(), nav_gotoindex(), nav_setcwd(), navauto_mov_explorer_reset(), navauto_mov_ok_loop(), ushell_cmd_format(), ushell_cmd_free_space(), ushell_cmd_mount(), ushell_cmd_perform_alloc(), and ushell_task().
void nav_exit | ( | void | ) |
This function flush ALL navigations before exit of file system core.
//! Call this at the program exit or before a USB Device session //!
References fat_cache_flush(), file_close(), FS_NB_NAVIGATOR, and nav_select().
Referenced by ushell_task().
uint8_t nav_file_attributget | ( | void | ) |
This function returns the Attribute of selected file.
References fs_g_nav_entry, and Fs_management_entry::u8_attr.
This function checks the extension of selected file.
sz_filterext | extension filter (ASCII format, e.g.: "txt" or "txt,d*,wk" ) |
References fat_check_mount_select(), fat_entry_checkext(), and fat_read_dir().
Referenced by ai_usb_ms_audio_context_restore(), ai_usb_ms_audio_ctrl_resume(), ai_usb_ms_audio_nav_file_info_type(), ai_usb_ms_audio_nav_playfile(), ai_usb_ms_mp3_support_is_audio_file(), ai_usb_ms_mp3_support_is_metadata_compatible_file(), ai_usb_ms_nav_file_info_type(), ai_usb_ms_specific_nav_get_next_playlist_pos(), ai_usb_ms_wav_support_is_audio_file(), nav_filterlist_nb_ex(), nav_filterlist_next(), nav_filterlist_previous(), navauto_mov_explorer_is_file(), navauto_mov_explorer_select_limit_file_cur_folder(), navauto_open(), pl_main_open(), and ushell_cmd_ls().
This function returns the date of selected file.
type_date | FS_DATE_LAST_WRITE, to get the date of last write access FS_DATE_CREATION, to get the date of file creation |
sz_date | ASCCI string (>17B) to store the information about date "YYYYMMDDHHMMSSMS" = year, month, day, hour, minute, second, millisecond |
References fat_check_mount_select(), fat_get_date(), and fat_read_dir().
This function returns the name of selected file.
sz_name | string to store the name file (ASCII or UNICODE ) |
u8_size_max | string size (unit ASCII or UNICODE ) |
References FS_NAME_GET, and nav_file_name().
Referenced by ai_usb_ms_audio_nav_getname(), and ai_usb_ms_nav_file_name().
bool nav_file_isdir | ( | void | ) |
This function returns the type of selected file.
References fat_entry_is_dir().
Referenced by ai_usb_ms_nav_file_isdir(), ai_usb_ms_specific_nav_get_next_playlist_pos(), main(), nav_filterflat_next(), nav_filterflat_previous(), nav_filterlist_nb_ex(), nav_filterlist_next(), nav_filterlist_previous(), nav_flat_next(), nav_flat_previous(), navauto_mov_explorer_is_dir(), navauto_mov_explorer_is_file(), navauto_mov_explorer_rec(), ushell_cmd_ls(), and ushell_cmd_sync().
bool nav_file_isreadonly | ( | void | ) |
This function checks the write protection of disk and the Attribute "read only" of selected file.
References fat_check_mount_select(), FS_ATTR_READ_ONLY, fs_g_nav, fs_g_nav_entry, mem_wr_protect(), Fs_management_entry::u8_attr, and Fs_management::u8_lun.
Referenced by pl_main_open().
uint32_t nav_file_lgt | ( | void | ) |
This function returns the size of selected file (unit byte)
References fs_g_nav_entry, and Fs_management_entry::u32_size.
Referenced by fsaccess_file_get_size(), main(), and ushell_cmd_ls().
uint16_t nav_file_lgtsector | ( | void | ) |
This function returns the size of selected file (unit sector)
References FS_512B_SHIFT_BIT, fs_g_nav_entry, and Fs_management_entry::u32_size.
Referenced by main().
This function returns the name of selected file or checks the string with the name of selected file.
b_mode | action mode: FS_NAME_GET to get the name of selected file FS_NAME_CHECK to check the name of selected file |
sz_name | if FS_NAME_GET then string to store the file name (ASCII or UNICODE ) if FS_NAME_CHECK then string to match with file name (ASCII or UNICODE), it must be terminated by NULL or '*' value |
b_match_case | false, ignore the case (only used in "FS_NAME_CHECK" action) |
u8_size_max | string size (unit ASCII or UNICODE ), only used in "FS_NAME_GET" action |
References _MEM_TYPE_SLOW_, fat_check_mount_select(), fat_entry_longname(), fat_entry_shortname(), fat_read_dir(), FS_ERR_ENTRY_BAD, fs_g_nav_fast, fs_g_status, FS_NAME_GET, FS_NO_LAST_LFN_ENTRY, FS_SIZE_LFN_ENTRY, g_b_string_length, Is_unicode, and Fs_management_fast::u16_entry_pos_sel_file.
Referenced by main(), nav_dir_name(), nav_file_getname(), nav_filelist_findname(), nav_filterflat_findname(), nav_filterlist_findname(), nav_flat_findname(), nav_getcwd(), pl_main_close(), ushell_cmd_copy(), ushell_cmd_ls(), and ushell_cmd_sync().
bool nav_filelist_bol | ( | void | ) |
This function checks the beginning of file list.
References FS_FIND_NEXT, FS_FIND_PREV, and nav_filelist_set().
bool nav_filelist_eol | ( | void | ) |
This function checks the end of file list.
References Fs_management::b_mode_nav, FS_DIR, FS_FIND_NEXT, FS_FIND_PREV, fs_g_nav, fs_g_nav_fast, FS_NO_SEL, nav_filelist_set(), Fs_management_fast::u16_entry_pos_sel_file, and Fs_management::u16_pos_sel_file.
This function checks the presence of files or directories in file list.
b_type | FS_DIR to check the directory presence FS_FILE to check the file presence |
References FS_FIND_NEXT, fs_g_nav, FS_NO_SEL, nav_filelist_first(), nav_filelist_reset(), nav_filelist_set(), status, and Fs_management::u16_pos_sel_file.
bool nav_filelist_fileisnotopen | ( | void | ) |
This function checks if no file is open.
References fat_check_noopen().
Referenced by nav_flat_fileisnotopen().
This function searches a file name in file list.
@param sz_name name to search (UNICODE or ASCII) <br> It must be terminate by NULL or '*' value @param b_match_case false to ignore the case @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! This function starts a search at the next position of the current in file list //!
References FS_FIND_NEXT, FS_NAME_CHECK, nav_file_name(), and nav_filelist_set().
Referenced by nav_setcwd().
This function goes to at the first file or directory in file list.
b_type | FS_DIR to go at the first directory FS_FILE to go at the first file |
References Fs_management::b_mode_nav, FS_ERR_NO_FIND, FS_FIND_NEXT, fs_g_nav, fs_g_status, nav_filelist_reset(), and nav_filelist_set().
Referenced by main(), nav_filelist_exist(), nav_filelist_last(), navauto_mov_explorer_select_limit_dir_cur_folder(), and navauto_mov_explorer_select_limit_file_cur_folder().
uint16_t nav_filelist_get | ( | void | ) |
This function returns the position of selected file in file list.
References fs_g_nav, and Fs_management::u16_pos_sel_file.
Referenced by ai_usb_ms_audio_ctrl_resume(), nav_filelist_goto(), nav_filterlist_next(), nav_filterlist_previous(), nav_flat_get(), nav_flat_next(), and nav_flat_previous().
bool nav_filelist_goto | ( | uint16_t | u16_newpos | ) |
This function goes at a position in file list.
u16_newpos | new position to select (0 is the first position) |
References FS_FIND_NEXT, FS_FIND_PREV, FS_NO_SEL, nav_filelist_get(), nav_filelist_reset(), and nav_filelist_set().
Referenced by nav_filterlist_next(), and nav_filterlist_previous().
This function goes to at the last file or directory in file list.
b_type | FS_DIR to go at the last directory FS_FILE to go at the last file |
References FS_ERR_NO_FIND, FS_FIND_NEXT, fs_g_status, nav_filelist_first(), nav_filelist_nb(), and nav_filelist_set().
Referenced by navauto_mov_explorer_select_limit_dir_cur_folder(), and navauto_mov_explorer_select_limit_file_cur_folder().
uint16_t nav_filelist_nb | ( | bool | b_type | ) |
This function computes the number of files or directories in file list.
b_type | FS_DIR to compute the number of directories FS_FILE to compute the number of files |
References Fs_management::b_mode_nav, FS_FILE, FS_FIND_NEXT, fs_g_nav, FS_NO_SEL, nav_filelist_reset(), nav_filelist_set(), and Fs_management::u16_pos_sel_file.
Referenced by main(), nav_filelist_last(), and navauto_mov_explorer().
bool nav_filelist_reset | ( | void | ) |
This function resets the selection pointer, so "no file selected" in file list.
References fat_check_mount_noopen(), and fat_clear_entry_info_and_ptr().
Referenced by main(), nav_dir_cd(), nav_dir_gotoparent(), nav_filelist_exist(), nav_filelist_first(), nav_filelist_goto(), nav_filelist_nb(), nav_filelist_single_disable(), nav_filelist_single_enable(), nav_filterlist_reset(), nav_flat_gotoparent(), nav_flat_reset(), nav_gotoindex(), nav_setcwd(), navauto_mov_explorer_limit(), navauto_open(), pl_main_open(), pl_main_readline(), pl_nav_setpos(), ushell_cmd_ls(), and ushell_cmd_sync().
This function moves the selection pointer in file list.
@param u16_nb numbers of file to jump before stopping action <br> 0, stop at the first file found <br> 1, stop at the second file found <br> @param b_direction search direction <br> FS_FIND_NEXT, move to next file or directory FS_FIND_PREV, move to previous file or directory @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! Note: if no file is selected then nav_filelist_set( 0 , FS_NEXT ) goes to the first entry of the file list. //!
References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fat_check_mount_noopen(), fat_entry_check(), fat_get_entry_info(), fat_read_dir(), FS_DIR, FS_END_FIND, FS_ERR_ENTRY_EMPTY, FS_ERR_FS, FS_ERR_NO_FIND, FS_ERR_OUT_LIST, FS_FILE, FS_FIND_NEXT, fs_g_nav, fs_g_nav_fast, fs_g_status, FS_NO_SEL, Fs_management_fast::u16_entry_pos_sel_file, and Fs_management::u16_pos_sel_file.
Referenced by main(), nav_dir_gotoparent(), nav_filelist_bol(), nav_filelist_eol(), nav_filelist_exist(), nav_filelist_findname(), nav_filelist_first(), nav_filelist_goto(), nav_filelist_last(), nav_filelist_nb(), nav_filterlist_nb_ex(), nav_filterlist_next(), nav_filterlist_previous(), nav_flat_next(), nav_flat_previous(), nav_gotoindex(), navauto_mov_explorer_is_dir(), navauto_mov_explorer_is_file(), navauto_mov_explorer_select_limit_file_cur_folder(), navauto_open(), ushell_cmd_ls(), and ushell_cmd_sync().
bool nav_filelist_single_disable | ( | void | ) |
To display in File List the directories AND files.
References Fs_management::b_mode_nav_single, fs_g_nav, and nav_filelist_reset().
Referenced by nav_filterlist_nb_ex().
To display in File List only the files OR directories.
b_type | FS_DIR to display only directories presence FS_FILE to display only files presence |
References Fs_management::b_mode_nav, Fs_management::b_mode_nav_single, fs_g_nav, and nav_filelist_reset().
Referenced by nav_filterlist_nb_ex().
bool nav_filelist_validpos | ( | void | ) |
This function checks if a file is selected.
References fat_check_mount_select_noopen().
Referenced by nav_flat_validpos(), navauto_mov_explorer_rec(), navauto_mov_playlist(), navauto_open(), and pl_sel_isvalid().
uint8_t nav_get | ( | void | ) |
This function returns the navigation identifier used.
Referenced by ai_usb_ms_specific_restore_navigator_ex(), ai_usb_ms_specific_save_navigator(), ai_usb_ms_specific_save_navigator_ex(), ai_usb_ms_support_info_image(), pl_main_close(), pl_main_open(), pl_main_save(), pl_nav_readentry(), pl_nav_setpos(), pl_rem_dead(), pl_rem_sel(), and pl_rem_sel_all().
This function returns the full path of the selection.
sz_path | string to store the path (ASCII or UNICODE ) |
u8_size_path | string size (unit ASCII or UNICODE ) |
b_view_file_select | true, to include in path the selected file name |
References _MEM_TYPE_SLOW_, fat_check_mount_noopen(), fat_check_select(), FS_ERR_BUFFER_FULL, FS_ERR_IS_ROOT, fs_g_status, FS_NAME_GET, g_b_string_length, index, Is_unicode, nav_dir_gotoparent(), nav_drive_getname(), nav_file_name(), nav_getindex(), nav_gotoindex(), and status.
Fs_index nav_getindex | ( | void | ) |
This function returns a small index on the selected file.
@return It is a small index structure with information on selected file (disk, partition, dir, file/dir selected)
//! This routine is interesting to save a file position in small variable. //! This pointer allow to reinit a navigator quickly with nav_gotoindex() routine. //!
References fs_g_nav, fs_g_nav_fast, index, Fs_index::u16_entry_pos_sel_file, Fs_management_fast::u16_entry_pos_sel_file, Fs_index::u32_cluster_sel_dir, Fs_management::u32_cluster_sel_dir, Fs_index::u8_lun, Fs_management::u8_lun, Fs_index::u8_partition, and Fs_management::u8_partition.
Referenced by ai_usb_ms_audio_context_save(), ai_usb_ms_audio_ctrl_resume(), ai_usb_ms_audio_nav_file_info_duration(), ai_usb_ms_audio_nav_file_info_track(), ai_usb_ms_audio_nav_file_info_version(), ai_usb_ms_audio_nav_file_info_year(), ai_usb_ms_audio_nav_playfile(), ai_usb_ms_nav_getplayfile(), ai_usb_ms_song_read_info(), ai_usb_ms_specific_audio_nav_playlist_play_link(), ai_usb_ms_specific_nav_getplaylistfile(), main(), nav_filterflat_gotoparent(), nav_flat_gotoparent(), nav_getcwd(), nav_partition_label(), nav_setcwd(), navauto_open(), pl_main_close(), pl_main_save(), ushell_cmd_copy(), ushell_cmd_free_space(), ushell_cmd_mount(), ushell_cmd_perform(), ushell_cmd_rm(), ushell_cmd_sync(), and ushell_task().
bool nav_gotoindex | ( | const Fs_index _MEM_TYPE_SLOW_ * | index | ) |
This function selects a file in the navigator via a file index.
@param index structure with information about file to select (disk, partition, dir, file/dir selected ) @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! This routine allow to reinit a navigator quickly via a file index (disk, partition, dir, file/dir selected ) //! To get a file index, you shall used the routine nav_getindex(). //!
References FS_FIND_NEXT, fs_g_nav, fs_g_nav_fast, nav_drive_set(), nav_filelist_reset(), nav_filelist_set(), nav_partition_mount(), nav_partition_set(), Fs_management_fast::u16_entry_pos_sel_file, and Fs_management::u32_cluster_sel_dir.
Referenced by ai_usb_ms_audio_context_restore(), ai_usb_ms_audio_ctrl_resume(), ai_usb_ms_audio_nav_file_info_duration(), ai_usb_ms_audio_nav_file_info_track(), ai_usb_ms_audio_nav_file_info_version(), ai_usb_ms_audio_nav_file_info_year(), ai_usb_ms_audio_nav_playfile(), ai_usb_ms_song_read_info(), main(), nav_filterflat_gotoparent(), nav_flat_gotoparent(), nav_getcwd(), nav_partition_label(), nav_setcwd(), navauto_open(), pl_main_close(), pl_main_save(), pl_rem_dead(), ushell_cmd_copy(), ushell_cmd_free_space(), ushell_cmd_mount(), ushell_cmd_perform(), ushell_cmd_rm(), ushell_cmd_sync(), and ushell_task().
uint8_t nav_partition_cluster_size | ( | void | ) |
This function returns the partition cluster size.
References fs_g_nav, and Fs_management::u8_BPB_SecPerClus.
uint32_t nav_partition_freespace | ( | void | ) |
This function returns the partition free space.
@return number of free sectors @return 0 in case of error or full partition
//! You shall mounted the partition before call this routine //!
References fat_check_device(), fat_getfreespace(), fs_g_nav_fast, FS_TYPE_FAT_UNM, and Fs_management_fast::u8_type_fat.
Referenced by ai_usb_ms_nav_drive_free_space(), main(), and ushell_cmd_free_space().
uint8_t nav_partition_freespace_percent | ( | void | ) |
This function returns the partition space free in percent.
@return percent of free space (0% to 100%) @return 0% in case of error or full partition
//! To speed up the compute, the result have an error delta of 1% //!
References fat_check_device(), fat_getfreespace_percent(), fs_g_nav_fast, FS_TYPE_FAT_UNM, and Fs_management_fast::u8_type_fat.
Referenced by ushell_cmd_free_space().
This function reads or writes the label of selected partition.
b_action | to select the action FS_LABEL_READ to read label FS_LABEL_WRITE to write label |
sz_label | pointer on a ASCII string (11 chars + NULL terminator =12 bytes) if FS_LABEL_READ, then the string is used to store label if FS_LABEL_WRITE, then the string is used to give the new label |
References _MEM_TYPE_SLOW_, fat_entry_label(), fat_read_dir(), FS_ERR_ENTRY_EMPTY, fs_g_nav_fast, fs_g_status, FS_LABEL_READ, FS_LABEL_WRITE, index, nav_dir_root(), nav_getindex(), nav_gotoindex(), NULL, status, and Fs_management_fast::u16_entry_pos_sel_file.
bool nav_partition_mount | ( | void | ) |
This function mounts the selected partition.
@return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! If the FS_MULTI_PARTITION option is disabled //! then the mount routine selects the first partition supported by file system. <br> //! After mount, the file list contains files and directories of ROOT directory //!
References fat_check_noopen(), fat_clear_entry_info_and_ptr(), fat_mount(), fs_g_nav, fs_g_nav_fast, FS_TYPE_FAT_UNM, Fs_management::u32_cluster_sel_dir, and Fs_management_fast::u8_type_fat.
Referenced by ai_usb_ms_nav_drive_mount(), main(), nav_dir_root(), nav_filterlist_gotoindex(), nav_filterlist_mount(), nav_flat_mount(), nav_gotoindex(), nav_partition_type(), nav_setcwd(), navauto_mov_ok_loop(), ushell_cmd_free_space(), ushell_cmd_mount(), and ushell_cmd_perform_alloc().
uint8_t nav_partition_nb | ( | void | ) |
This function returns the number of partitions present on drive.
bool nav_partition_serialnumber | ( | bool | b_action, |
uint8_t _MEM_TYPE_SLOW_ * | a_u8_sn | ||
) |
This function reads or writes the serial number on the selected partition.
b_action | to select the action FS_SN_READ to read serial number FS_SN_WRITE to write serial number |
a_u8_sn | pointer on an array (4 bytes) if FS_SN_READ, then the array is used to store the serial number if FS_SN_WRITE, then the array is used to give the new serial number |
References fat_check_mount(), and fat_serialnumber().
bool nav_partition_set | ( | uint8_t | partition_number | ) |
This function selects a partition on drive.
partition_number | partition number (0 to 3) |
References fat_check_noopen(), fs_g_nav, fs_g_nav_fast, FS_TYPE_FAT_UNM, Fs_management::u8_partition, and Fs_management_fast::u8_type_fat.
Referenced by nav_filterlist_gotoindex(), and nav_gotoindex().
uint32_t nav_partition_space | ( | void | ) |
This function returns partition total space.
@return number of sectors @return 0, in case of error
//! You shall mounted the partition before call this routine //!
References fat_check_device(), fs_g_nav, fs_g_nav_fast, FS_TYPE_FAT_UNM, Fs_management::u32_CountofCluster, Fs_management::u8_BPB_SecPerClus, and Fs_management_fast::u8_type_fat.
Referenced by ai_usb_ms_nav_drive_total_space(), main(), ushell_cmd_free_space(), and ushell_cmd_space().
uint8_t nav_partition_type | ( | void | ) |
This function gives the partition type.
References fat_check_device(), fs_g_nav_fast, FS_TYPE_FAT_UNM, nav_partition_mount(), and Fs_management_fast::u8_type_fat.
Referenced by main(), and ushell_cmd_ls().
void nav_reset | ( | void | ) |
This function resets ALL navigations to init file system core.
//! Call this at the program startup or before a new session (e.g. USB Device exit) //!
References Fs_management::b_mode_nav_single, fat_cache_clusterlist_reset(), fat_cache_reset(), Fat_file_close, fs_g_nav, fs_g_nav_fast, FS_NB_NAVIGATOR, FS_TYPE_FAT_UNM, g_b_no_check_disk, g_b_string_length, g_b_unicode, i, nav_select(), Fs_management::u8_lun, Fs_management::u8_partition, and Fs_management_fast::u8_type_fat.
Referenced by ai_usb_ms_init_drive(), b_fsaccess_init(), main(), and ushell_task().
bool nav_select | ( | uint8_t | u8_idnav | ) |
This function selects the navigation to use.
u8_idnav | navigator identifier to select (0 to FS_NB_NAVIGATOR-1) |
References fat_invert_nav, FS_ERR_BAD_NAV, fs_g_status, and FS_NB_NAVIGATOR.
Referenced by ai_usb_ms_audio_context_restore(), ai_usb_ms_audio_context_save(), ai_usb_ms_audio_ctrl_resume(), ai_usb_ms_audio_ctrl_status(), ai_usb_ms_audio_nav_eof_occur(), ai_usb_ms_audio_nav_expmode_get(), ai_usb_ms_audio_nav_expmode_set(), ai_usb_ms_audio_nav_file_info_duration(), ai_usb_ms_audio_nav_file_info_image(), ai_usb_ms_audio_nav_file_info_track(), ai_usb_ms_audio_nav_file_info_type(), ai_usb_ms_audio_nav_file_info_version(), ai_usb_ms_audio_nav_file_info_year(), ai_usb_ms_audio_nav_getname(), ai_usb_ms_audio_nav_getpos(), ai_usb_ms_audio_nav_mov(), ai_usb_ms_audio_nav_nb(), ai_usb_ms_audio_nav_playfile(), ai_usb_ms_audio_nav_setpos(), ai_usb_ms_audio_nav_shuffle_get(), ai_usb_ms_audio_nav_shuffle_set(), ai_usb_ms_init_drive(), ai_usb_ms_nav_dir_cd(), ai_usb_ms_nav_dir_gotoparent(), ai_usb_ms_nav_dir_name(), ai_usb_ms_nav_dir_nb(), ai_usb_ms_nav_dir_root(), ai_usb_ms_nav_drive_free_space(), ai_usb_ms_nav_drive_get(), ai_usb_ms_nav_drive_mount(), ai_usb_ms_nav_drive_nb(), ai_usb_ms_nav_drive_total_space(), ai_usb_ms_nav_file_goto(), ai_usb_ms_nav_file_info_album(), ai_usb_ms_nav_file_info_artist(), ai_usb_ms_nav_file_info_duration(), ai_usb_ms_nav_file_info_genre(), ai_usb_ms_nav_file_info_image(), ai_usb_ms_nav_file_info_title(), ai_usb_ms_nav_file_info_track(), ai_usb_ms_nav_file_info_type(), ai_usb_ms_nav_file_info_version(), ai_usb_ms_nav_file_info_year(), ai_usb_ms_nav_file_isdir(), ai_usb_ms_nav_file_name(), ai_usb_ms_nav_file_nb(), ai_usb_ms_nav_file_next(), ai_usb_ms_nav_file_pos(), ai_usb_ms_nav_file_previous(), ai_usb_ms_nav_getplayfile(), ai_usb_ms_nav_playlist_nb(), ai_usb_ms_song_read_info(), ai_usb_ms_specific_audio_nav_get_folder_name(), ai_usb_ms_specific_audio_nav_playlist_play_link(), ai_usb_ms_specific_nav_get_next_playlist_pos(), ai_usb_ms_specific_nav_getplaylistfile(), ai_usb_ms_specific_restore_navigator_ex(), ai_usb_ms_specific_save_navigator_ex(), ai_usb_ms_support_info_image(), close(), fsaccess_file_get_size(), fsaccess_IsDirPresent(), nav_exit(), nav_reset(), open(), pl_main_close(), pl_main_open(), pl_main_readline(), pl_main_save(), pl_nav_readentry(), pl_nav_setpos(), pl_rem_dead(), pl_rem_sel(), pl_rem_sel_all(), play_wav(), read(), ushell_cmd_perform(), ushell_cmd_sync(), ushell_task(), wav_file_get_data(), and write().
This function selects a disk position via a path.
@param sz_path path string (ASCII or UNICODE ) @param b_match_case false to ignore the case @param b_create true, if path does not exist then create it <br> false, no create path <br> @return false in case of error, see global value "fs_g_status" for more detail @return true otherwise
//! The syntax "./../../file_name" is supported. //! With syntax "./dir_parent/directory_name" the file list corresponding at "dir_parent" and "directory_name" is selected. //! With syntax "./dir_parent/directory_name/" the file list corresponding at "directory_name" and no file is selected. //!
References _MEM_TYPE_SLOW_, fat_check_noopen(), fat_entry_is_dir(), index, Is_unicode, nav_dir_cd(), nav_dir_gotoparent(), nav_dir_make(), nav_dir_root(), nav_drive_set(), nav_file_create(), nav_filelist_findname(), nav_filelist_reset(), nav_getindex(), nav_gotoindex(), and nav_partition_mount().
Referenced by fsaccess_IsDirPresent(), main(), open(), pl_main_readline(), ushell_cmd_append_file(), ushell_cmd_cat(), ushell_cmd_cd(), ushell_cmd_copy(), ushell_cmd_rename(), ushell_cmd_rm(), and ushell_cmd_sync().
void nav_string_ascii | ( | void | ) |
This function selects the ASCII mode for all routines with FS_STRING parameter.
//! If you have enabled the FS_ASCII AND FS_UNICODE define //! then FS_STRING parameter can be a ASCII or UNICODE string. //!
References g_b_unicode.
void nav_string_length_disable | ( | void | ) |
This function deselects the LENGTH string mode for all routines with FS_STRING parameter.
//! In LENGTH string mode when you call a routine with FS_STRING parameter //! only the size (16bits, unit ASCII or UNICODE) is returned in the first 16bits of string array. //!
References g_b_string_length.
Referenced by ai_usb_ms_read_string(), pl_main_close(), reader_id3_duration(), reader_id3_track(), and reader_id3_year().
void nav_string_length_enable | ( | void | ) |
This function selects the LENGTH string mode for all routines with FS_STRING parameter.
//! In LENGTH string mode when you call a routine with FS_STRING parameter //! only the size (16bits, unit ASCII or UNICODE) is returned in the first 16bits of string array. //!
References g_b_string_length.
Referenced by ai_usb_ms_read_string(), and pl_main_close().
void nav_string_unicode | ( | void | ) |
This function selects the UNICODE mode for all routines with FS_STRING parameter.
//! If you have enabled the FS_ASCII AND FS_UNICODE define //! then FS_STRING parameter can be a ASCII or UNICODE string. //!