![]() |
Ultibo API
C/C++ API for Ultibo Core
|
#include "ultibo/globaltypes.h"#include "ultibo/globalconst.h"#include "ultibo/system.h"#include "ultibo/devices.h"Go to the source code of this file.
Data Structures | |
| struct | _STORAGE_DEVICE |
Typedefs | |
| typedef struct _STORAGE_DEVICE | STORAGE_DEVICE |
| typedef uint32_t STDCALL(* | storage_enumerate_cb) (STORAGE_DEVICE *storage, void *data) |
| typedef uint32_t STDCALL(* | storage_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
| typedef uint32_t STDCALL(* | storage_device_read_proc) (STORAGE_DEVICE *storage, int64_t start, int64_t count, void *buffer) |
| typedef uint32_t STDCALL(* | storage_device_write_proc) (STORAGE_DEVICE *storage, int64_t start, int64_t count, void *buffer) |
| typedef uint32_t STDCALL(* | storage_device_erase_proc) (STORAGE_DEVICE *storage, int64_t start, int64_t count) |
| typedef uint32_t STDCALL(* | storage_device_control_proc) (STORAGE_DEVICE *storage, int request, size_t argument1, size_t *argument2) |
Functions | |
| uint32_t STDCALL | storage_device_read (STORAGE_DEVICE *storage, int64_t start, int64_t count, void *buffer) |
| uint32_t STDCALL | storage_device_write (STORAGE_DEVICE *storage, int64_t start, int64_t count, void *buffer) |
| uint32_t STDCALL | storage_device_erase (STORAGE_DEVICE *storage, int64_t start, int64_t count) |
| uint32_t STDCALL | storage_device_control (STORAGE_DEVICE *storage, int request, size_t argument1, size_t *argument2) |
| uint32_t STDCALL | storage_device_set_state (STORAGE_DEVICE *storage, uint32_t state) |
| Set the state of the specified storage and send a notification. | |
| uint32_t STDCALL | storage_device_start_status (STORAGE_DEVICE *storage, uint32_t interval) |
| Start status monitoring on the specified storage for insert/eject notifications. | |
| uint32_t STDCALL | storage_device_stop_status (STORAGE_DEVICE *storage) |
| Stop status monitoring on the specified storage for insert/eject notifications. | |
| STORAGE_DEVICE *STDCALL | storage_device_create (void) |
| Create a new Storage entry. | |
| STORAGE_DEVICE *STDCALL | storage_device_create_ex (uint32_t size) |
| Create a new Storage entry. | |
| uint32_t STDCALL | storage_device_destroy (STORAGE_DEVICE *storage) |
| Destroy an existing Storage entry. | |
| uint32_t STDCALL | storage_device_register (STORAGE_DEVICE *storage) |
| Register a new Storage in the Storage table. | |
| uint32_t STDCALL | storage_device_deregister (STORAGE_DEVICE *storage) |
| Deregister a Storage from the Storage table. | |
| STORAGE_DEVICE *STDCALL | storage_device_find (uint32_t storageid) |
| STORAGE_DEVICE *STDCALL | storage_device_find_by_device (DEVICE *device) |
| Find a Storage device by the matching DeviceData property. | |
| STORAGE_DEVICE *STDCALL | storage_device_find_by_name (const char *name) |
| STORAGE_DEVICE *STDCALL | storage_device_find_by_description (const char *description) |
| uint32_t STDCALL | storage_device_enumerate (storage_enumerate_cb callback, void *data) |
| uint32_t STDCALL | storage_device_notification (STORAGE_DEVICE *storage, storage_notification_cb callback, void *data, uint32_t notification, uint32_t flags) |
| uint32_t STDCALL | storage_get_count (void) |
| Get the current storage count. | |
| STORAGE_DEVICE *STDCALL | storage_device_check (STORAGE_DEVICE *storage) |
| Check if the supplied Storage is in the storage table. | |
| uint32_t STDCALL | storage_device_type_to_string (uint32_t storagetype, char *string, uint32_t len) |
| uint32_t STDCALL | storage_device_state_to_string (uint32_t storagestate, char *string, uint32_t len) |
| uint32_t STDCALL | storage_device_state_to_notification (uint32_t state) |
| Convert a Storage state value into the notification code for device notifications. | |
| #define STORAGE_NAME_PREFIX "Storage" |
Name prefix for Storage Devices.
Storage specific constants
| #define STORAGE_STATUS_TIMER_INTERVAL 1000 |
| #define STORAGE_TYPE_NONE 0 |
Storage Device Types
| #define STORAGE_TYPE_HDD 1 |
| #define STORAGE_TYPE_FDD 2 |
| #define STORAGE_TYPE_CDROM 3 |
| #define STORAGE_TYPE_OPTICAL 4 |
| #define STORAGE_TYPE_TAPE 5 |
| #define STORAGE_TYPE_REMOVABLE 6 |
| #define STORAGE_STATE_EJECTED 0 |
Storage Device States
| #define STORAGE_STATE_EJECTING 1 |
| #define STORAGE_STATE_INSERTING 2 |
| #define STORAGE_STATE_INSERTED 3 |
| #define STORAGE_FLAG_NONE 0x00000000 |
Storage Device Flags
| #define STORAGE_FLAG_REMOVABLE 0x00000001 |
| #define STORAGE_FLAG_LBA48 0x00000002 |
| #define STORAGE_FLAG_NOT_READY 0x00000004 |
| #define STORAGE_FLAG_NO_MEDIA 0x00000008 |
| #define STORAGE_FLAG_READ_ONLY 0x00000010 |
| #define STORAGE_FLAG_WRITE_ONLY 0x00000020 |
| #define STORAGE_FLAG_ERASEABLE 0x00000040 |
| #define STORAGE_FLAG_LOCKABLE 0x00000080 |
| #define STORAGE_FLAG_LOCKED 0x00000100 |
| #define STORAGE_FLAG_EJECTABLE 0x00000200 |
| #define STORAGE_FLAG_CHANGABLE 0x00000400 |
| #define STORAGE_CONTROL_TEST_READY 1 |
Test Unit Ready.
Storage Device Control Codes
| #define STORAGE_CONTROL_RESET 2 |
Reset Device.
| #define STORAGE_CONTROL_TEST_MEDIA 3 |
Test No Media.
| #define STORAGE_CONTROL_LOCK 4 |
Lock Media.
| #define STORAGE_CONTROL_UNLOCK 5 |
Unlock Media.
| #define STORAGE_CONTROL_EJECT 6 |
Eject Media.
| #define STORAGE_CONTROL_TEST_LOCKED 7 |
Test Media Locked.
| #define STORAGE_CONTROL_TEST_CHANGED 8 |
Test Media Changed.
| #define STORAGE_CONTROL_GET_VENDORID 9 |
Get Vendor ID.
| #define STORAGE_CONTROL_GET_PRODUCTID 10 |
Get Product ID.
| #define STORAGE_CONTROL_GET_SERIAL 11 |
Get Serial No.
| #define STORAGE_CONTROL_GET_REVISION 12 |
Get Revision No.
| #define STORAGE_CONTROL_GET_PRODUCT 13 |
Get Product Name.
| #define STORAGE_CONTROL_GET_MANUFACTURER 14 |
Get Manufacturer Name.
| typedef struct _STORAGE_DEVICE STORAGE_DEVICE |
Storage specific types Storage Device
| typedef uint32_t STDCALL(* storage_enumerate_cb) (STORAGE_DEVICE *storage, void *data) |
Storage Enumeration Callback
| typedef uint32_t STDCALL(* storage_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
Storage Notification Callback
| typedef uint32_t STDCALL(* storage_device_read_proc) (STORAGE_DEVICE *storage, int64_t start, int64_t count, void *buffer) |
Storage Device Methods
| typedef uint32_t STDCALL(* storage_device_write_proc) (STORAGE_DEVICE *storage, int64_t start, int64_t count, void *buffer) |
| typedef uint32_t STDCALL(* storage_device_erase_proc) (STORAGE_DEVICE *storage, int64_t start, int64_t count) |
| typedef uint32_t STDCALL(* storage_device_control_proc) (STORAGE_DEVICE *storage, int request, size_t argument1, size_t *argument2) |
| uint32_t STDCALL storage_device_read | ( | STORAGE_DEVICE * | storage, |
| int64_t | start, | ||
| int64_t | count, | ||
| void * | buffer ) |
Storage Functions
| uint32_t STDCALL storage_device_write | ( | STORAGE_DEVICE * | storage, |
| int64_t | start, | ||
| int64_t | count, | ||
| void * | buffer ) |
| uint32_t STDCALL storage_device_erase | ( | STORAGE_DEVICE * | storage, |
| int64_t | start, | ||
| int64_t | count ) |
| uint32_t STDCALL storage_device_control | ( | STORAGE_DEVICE * | storage, |
| int | request, | ||
| size_t | argument1, | ||
| size_t * | argument2 ) |
| uint32_t STDCALL storage_device_set_state | ( | STORAGE_DEVICE * | storage, |
| uint32_t | state ) |
Set the state of the specified storage and send a notification.
| Storage | The storage to set the state for |
| State | The new state to set and notify |
| uint32_t STDCALL storage_device_start_status | ( | STORAGE_DEVICE * | storage, |
| uint32_t | interval ) |
Start status monitoring on the specified storage for insert/eject notifications.
| Storage | The storage to start status monitoring for |
| Interval | The status monitoring interval in milliseconds |
| uint32_t STDCALL storage_device_stop_status | ( | STORAGE_DEVICE * | storage | ) |
Stop status monitoring on the specified storage for insert/eject notifications.
| Storage | The storage to stop status monitoring for |
| STORAGE_DEVICE *STDCALL storage_device_create | ( | void | ) |
Create a new Storage entry.
| STORAGE_DEVICE *STDCALL storage_device_create_ex | ( | uint32_t | size | ) |
Create a new Storage entry.
| Size | Size in bytes to allocate for new storage (Including the storage entry) |
| uint32_t STDCALL storage_device_destroy | ( | STORAGE_DEVICE * | storage | ) |
Destroy an existing Storage entry.
| uint32_t STDCALL storage_device_register | ( | STORAGE_DEVICE * | storage | ) |
Register a new Storage in the Storage table.
| uint32_t STDCALL storage_device_deregister | ( | STORAGE_DEVICE * | storage | ) |
Deregister a Storage from the Storage table.
| STORAGE_DEVICE *STDCALL storage_device_find | ( | uint32_t | storageid | ) |
| STORAGE_DEVICE *STDCALL storage_device_find_by_device | ( | DEVICE * | device | ) |
Find a Storage device by the matching DeviceData property.
| Device | The device entry to match with the DeviceData value |
| STORAGE_DEVICE *STDCALL storage_device_find_by_name | ( | const char * | name | ) |
| STORAGE_DEVICE *STDCALL storage_device_find_by_description | ( | const char * | description | ) |
| uint32_t STDCALL storage_device_enumerate | ( | storage_enumerate_cb | callback, |
| void * | data ) |
| uint32_t STDCALL storage_device_notification | ( | STORAGE_DEVICE * | storage, |
| storage_notification_cb | callback, | ||
| void * | data, | ||
| uint32_t | notification, | ||
| uint32_t | flags ) |
| uint32_t STDCALL storage_get_count | ( | void | ) |
Get the current storage count.
Storage Helper Functions
| STORAGE_DEVICE *STDCALL storage_device_check | ( | STORAGE_DEVICE * | storage | ) |
Check if the supplied Storage is in the storage table.
| uint32_t STDCALL storage_device_type_to_string | ( | uint32_t | storagetype, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL storage_device_state_to_string | ( | uint32_t | storagestate, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL storage_device_state_to_notification | ( | uint32_t | state | ) |
Convert a Storage state value into the notification code for device notifications.