metee library API
More...
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
|
TEESTATUS TEEAPI | TeeInit (IN OUT PTEEHANDLE handle, IN const GUID *guid, IN OPTIONAL const char *device) |
|
TEESTATUS TEEAPI | TeeInitHandle (IN OUT PTEEHANDLE handle, IN const GUID *guid, IN const TEE_DEVICE_HANDLE device_handle) |
|
TEESTATUS TEEAPI | TeeConnect (OUT PTEEHANDLE handle) |
|
TEESTATUS TEEAPI | TeeRead (IN PTEEHANDLE handle, IN OUT void *buffer, IN size_t bufferSize, OUT OPTIONAL size_t *pNumOfBytesRead, IN OPTIONAL uint32_t timeout) |
|
TEESTATUS TEEAPI | TeeWrite (IN PTEEHANDLE handle, IN const void *buffer, IN size_t bufferSize, OUT OPTIONAL size_t *numberOfBytesWritten, IN OPTIONAL uint32_t timeout) |
|
TEESTATUS TEEAPI | TeeFWStatus (IN PTEEHANDLE handle, IN uint32_t fwStatusNum, OUT uint32_t *fwStatus) |
|
void TEEAPI | TeeDisconnect (IN PTEEHANDLE handle) |
|
TEE_DEVICE_HANDLE TEEAPI | TeeGetDeviceHandle (IN PTEEHANDLE handle) |
|
TEESTATUS TEEAPI | GetDriverVersion (IN PTEEHANDLE handle, IN OUT teeDriverVersion_t *driverVersion) |
|
metee library API
Definition in file metee.h.
◆ TEE_BUSY
The device is busy
Definition at line 107 of file metee.h.
◆ TEE_CLIENT_NOT_FOUND
The ME client is not present in the firmware
Definition at line 105 of file metee.h.
◆ TEE_DEVICE_NOT_FOUND
The device is not in the system or is not working
Definition at line 93 of file metee.h.
◆ TEE_DEVICE_NOT_READY
The device is not ready for the operation
Definition at line 95 of file metee.h.
◆ TEE_DISCONNECTED
The ME client is not connected
Definition at line 109 of file metee.h.
◆ TEE_ERROR_BASE
#define TEE_ERROR_BASE 0x0000U |
METEE ERROR BASE
Definition at line 87 of file metee.h.
◆ TEE_INSUFFICIENT_BUFFER
The buffer for read not big enough
Definition at line 111 of file metee.h.
◆ TEE_INTERNAL_ERROR
An internal error occurred in the library
Definition at line 91 of file metee.h.
◆ TEE_INVALID_PARAMETER
An invalid parameter was used in the call
Definition at line 97 of file metee.h.
◆ TEE_IS_SUCCESS
Macro for successful operation result check
Definition at line 117 of file metee.h.
◆ TEE_NOTSUPPORTED
The operation is not supported
Definition at line 103 of file metee.h.
◆ TEE_PERMISSION_DENIED
The user don't have permission for this operation
Definition at line 113 of file metee.h.
◆ TEE_SUCCESS
METEE SUCCESS
Definition at line 89 of file metee.h.
◆ TEE_TIMEOUT
The operation has timed out
Definition at line 101 of file metee.h.
◆ TEE_UNABLE_TO_COMPLETE_OPERATION
It is not possible to complete the operation
Definition at line 99 of file metee.h.
◆ TEEHANDLE_ZERO
#define TEEHANDLE_ZERO {0} |
ZERO/NULL device handle
Definition at line 83 of file metee.h.
◆ PTEEHANDLE
A type definition for pointer to TEEHANDLE.
Definition at line 78 of file metee.h.
◆ TEEHANDLE
Structure to store connection data
◆ TEESTATUS
return status for API functions
Definition at line 85 of file metee.h.
◆ GetDriverVersion()
Obtains version of the TEE device driver Not implemented on Linux
- Parameters
-
handle | The handle of the session. |
driverVersion | Pointer to driver version struct |
- Returns
- 0 if successful, otherwise error code.
◆ TeeConnect()
Connects to the TEE driver and starts a session
- Parameters
-
handle | A handle to the TEE device |
- Returns
- 0 if successful, otherwise error code
◆ TeeDisconnect()
Closes the session to TEE driver Make sure that you call this function as soon as you are done with the device, as other clients might be blocked until the session is closed.
- Parameters
-
handle | The handle of the session to close. |
◆ TeeFWStatus()
TEESTATUS TEEAPI TeeFWStatus |
( |
IN PTEEHANDLE |
handle, |
|
|
IN uint32_t |
fwStatusNum, |
|
|
OUT uint32_t * |
fwStatus |
|
) |
| |
Retrieves specified FW status register.
- Parameters
-
handle | The handle of the session. |
fwStatusNum | The FW status register number (0-5). |
fwStatus | The memory to store obtained FW status. |
- Returns
- 0 if successful, otherwise error code.
◆ TeeGetDeviceHandle()
TEE_DEVICE_HANDLE TEEAPI TeeGetDeviceHandle |
( |
IN PTEEHANDLE |
handle | ) |
|
Returns handle of TEE device Obtains HECI device handle on Windows and mei device file descriptor on Linux
- Parameters
-
handle | The handle of the session. |
- Returns
- device handle
◆ TeeInit()
TEESTATUS TEEAPI TeeInit |
( |
IN OUT PTEEHANDLE |
handle, |
|
|
IN const GUID * |
guid, |
|
|
IN OPTIONAL const char * |
device |
|
) |
| |
Initializes a TEE connection
- Parameters
-
handle | A handle to the TEE device. All subsequent calls to the lib's functions must be with this handle |
guid | GUID of the FW client that want to start a session |
device | optional device path, set NULL to use default |
- Returns
- 0 if successful, otherwise error code
◆ TeeInitHandle()
TEESTATUS TEEAPI TeeInitHandle |
( |
IN OUT PTEEHANDLE |
handle, |
|
|
IN const GUID * |
guid, |
|
|
IN const TEE_DEVICE_HANDLE |
device_handle |
|
) |
| |
Initializes a TEE connection
- Parameters
-
handle | A handle to the TEE device. All subsequent calls to the lib's functions must be with this handle |
guid | GUID of the FW client that want to start a session |
device_handle | open file handle |
- Returns
- 0 if successful, otherwise error code
◆ TeeRead()
TEESTATUS TEEAPI TeeRead |
( |
IN PTEEHANDLE |
handle, |
|
|
IN OUT void * |
buffer, |
|
|
IN size_t |
bufferSize, |
|
|
OUT OPTIONAL size_t * |
pNumOfBytesRead, |
|
|
IN OPTIONAL uint32_t |
timeout |
|
) |
| |
Read data from the TEE device synchronously.
- Parameters
-
handle | The handle of the session to read from. |
buffer | A pointer to a buffer that receives the data read from the TEE device. |
bufferSize | The number of bytes to be read. |
pNumOfBytesRead | A pointer to the variable that receives the number of bytes read, ignored if set to NULL. |
timeout | The timeout to complete read in milliseconds, zero for infinite |
- Returns
- 0 if successful, otherwise error code
◆ TeeWrite()
TEESTATUS TEEAPI TeeWrite |
( |
IN PTEEHANDLE |
handle, |
|
|
IN const void * |
buffer, |
|
|
IN size_t |
bufferSize, |
|
|
OUT OPTIONAL size_t * |
numberOfBytesWritten, |
|
|
IN OPTIONAL uint32_t |
timeout |
|
) |
| |
Writes the specified buffer to the TEE device synchronously.
- Parameters
-
handle | The handle of the session to write to. |
buffer | A pointer to the buffer containing the data to be written to the TEE device. |
bufferSize | The number of bytes to be written. |
numberOfBytesWritten | A pointer to the variable that receives the number of bytes written, ignored if set to NULL. |
timeout | The timeout to complete write in milliseconds, zero for infinite |
- Returns
- 0 if successful, otherwise error code