RTEMS  5.0.0
Macros | Typedefs | Enumerations
media.h File Reference

Media API. More...

#include <sys/types.h>
#include <rtems.h>

Go to the source code of this file.

Macros

#define RTEMS_MEDIA_MOUNT_BASE   "/media"
 
#define RTEMS_MEDIA_DELIMITER   '-'
 

Typedefs

typedef rtems_status_code(* rtems_media_listener) (rtems_media_event event, rtems_media_state state, const char *src, const char *dest, void *listener_arg)
 Event listener. More...
 
typedef rtems_status_code(* rtems_media_worker) (rtems_media_state state, const char *src, char **dest, void *worker_arg)
 Do the work corresponding to an event. More...
 

Enumerations

enum  rtems_media_event {
  RTEMS_MEDIA_EVENT_DISK_ATTACH, RTEMS_MEDIA_EVENT_DISK_DETACH, RTEMS_MEDIA_EVENT_MOUNT, RTEMS_MEDIA_EVENT_UNMOUNT,
  RTEMS_MEDIA_EVENT_PARTITION_INQUIRY, RTEMS_MEDIA_EVENT_PARTITION_ATTACH, RTEMS_MEDIA_EVENT_PARTITION_DETACH, RTEMS_MEDIA_EVENT_ERROR
}
 
enum  rtems_media_state {
  RTEMS_MEDIA_STATE_INQUIRY, RTEMS_MEDIA_STATE_READY, RTEMS_MEDIA_STATE_ABORTED, RTEMS_MEDIA_STATE_SUCCESS,
  RTEMS_MEDIA_STATE_FAILED, RTEMS_MEDIA_ERROR_DISK_UNKNOWN, RTEMS_MEDIA_ERROR_DISK_EXISTS, RTEMS_MEDIA_ERROR_DISK_OR_PARTITION_UNKNOWN,
  RTEMS_MEDIA_ERROR_DISK_OR_PARTITION_EXISTS, RTEMS_MEDIA_ERROR_PARTITION_UNKNOWN, RTEMS_MEDIA_ERROR_PARTITION_ORPHAN, RTEMS_MEDIA_ERROR_PARTITION_DETACH_WITH_MOUNT,
  RTEMS_MEDIA_ERROR_PARTITION_WITH_UNKNOWN_DISK, RTEMS_MEDIA_ERROR_MOUNT_POINT_UNKNOWN, RTEMS_MEDIA_ERROR_MOUNT_POINT_EXISTS, RTEMS_MEDIA_ERROR_MOUNT_POINT_ORPHAN
}
 

Functions

Base
RTEMS_INLINE_ROUTINE rtems_status_code rtems_media_initialize (void)
 Initializes the media manager. More...
 
rtems_status_code rtems_media_listener_add (rtems_media_listener listener, void *listener_arg)
 Adds the listener with argument listener_arg. More...
 
rtems_status_code rtems_media_listener_remove (rtems_media_listener listener, void *listener_arg)
 Removes the listener with argument listener_arg. More...
 
rtems_status_code rtems_media_post_event (rtems_media_event event, const char *src, char **dest, rtems_media_worker worker, void *worker_arg)
 Posts the event with source src. More...
 
Server
rtems_status_code rtems_media_server_initialize (rtems_task_priority priority, size_t stack_size, rtems_mode modes, rtems_attribute attributes)
 Initializes the media manager and media server. More...
 
rtems_status_code rtems_media_server_post_event (rtems_media_event event, const char *src, rtems_media_worker worker, void *worker_arg)
 Sends an event message to the media server. More...
 
Path Construction
char * rtems_media_create_path (const char *prefix, const char *name, rtems_device_major_number major)
 Creates a new path as "prefix/name-major". More...
 
char * rtems_media_replace_prefix (const char *new_prefix, const char *path)
 Replaces the prefix of the path with new_prefix. More...
 
char * rtems_media_append_minor (const char *path, rtems_device_minor_number minor)
 Appends the minor number to the path resulting in "path-minor". More...
 
Support
rtems_status_code rtems_media_get_device_identifier (const char *device_path, dev_t *device_identifier)
 Returns the device identifier for the device located at device_path in device_identifier. More...
 
const char * rtems_media_event_description (rtems_media_event event)
 
const char * rtems_media_state_description (rtems_media_state state)
 

Detailed Description

Media API.