Pms_types

Overview

Defines variables and data structures used by the permission management module.

Since:

1.0

Version:

1.0

Summary

Files

File Name

Description

pms_types.h

Declares variables and data structures used by the permission management module.

Data Structures

Data Structure Name

Description

PermissionSaved

Defines the permission, including the name, description, and whether the permission is granted.

Macros

Macro Name and Value

Description

PERM_NAME_LEN   64

Indicates the length of a permission name.

PERM_DESC_LEN   128

Indicates the length of a permission description.

Enumerations

Enumeration Name

Description

IsGranted { , GRANTED = 1 }

Enumerates granting statuses of the permission.

PmsErrorCode { ,   PERM_ERRORCODE_INVALID_PARAMS = 10, PERM_ERRORCODE_INVALID_PERMNAME, PERM_ERRORCODE_MALLOC_FAIL, PERM_ERRORCODE_OPENFD_FAIL,   PERM_ERRORCODE_READFD_FAIL, PERM_ERRORCODE_WRITEFD_FAIL, PERM_ERRORCODE_JSONPARSE_FAIL, PERM_ERRORCODE_COPY_ERROR,   PERM_ERRORCODE_FIELD_TOO_LONG, PERM_ERRORCODE_PERM_NOT_EXIST, PERM_ERRORCODE_UNLINK_ERROR, PERM_ERRORCODE_FILE_NOT_EXIST,   PERM_ERRORCODE_MEMSET_FAIL, PERM_ERRORCODE_STAT_FAIL, PERM_ERRORCODE_PATH_INVALID, PERM_ERRORCODE_TOO_MUCH_PERM,   PERM_ERRORCODE_TASKID_NOT_EXIST, PERM_ERRORCODE_PERM_NUM_ERROR }

Enumerates error codes of the permission management module.

Details

Macro Definition Documentation

PERM_DESC_LEN

  1. #define PERM_DESC_LEN 128

Description:

Indicates the length of a permission description.

The default length is 128 bytes, including the terminating null byte ‘\0’.

PERM_NAME_LEN

  1. #define PERM_NAME_LEN 64

Description:

Indicates the length of a permission name.

The default length is 64 bytes, including the terminating null byte ‘\0’.

Enumeration Type Documentation

IsGranted

  1. enum [IsGranted]($api-api-SmartVision-Devices-Pms_types.md#ga56644f429963f015addb12e36e2344f7)

Description:

Enumerates granting statuses of the permission.

Enumerator

Description

GRANTED 

Not granted

PmsErrorCode

  1. enum [PmsErrorCode]($api-api-SmartVision-Devices-Pms_types.md#gacb79d7f5cd64c73479e0bdd9525265a8)

Description:

Enumerates error codes of the permission management module.

Enumerator

Description

PERM_ERRORCODE_INVALID_PARAMS 

Success

PERM_ERRORCODE_INVALID_PERMNAME 

Invalid parameters

PERM_ERRORCODE_MALLOC_FAIL 

Invalid permission name

PERM_ERRORCODE_OPENFD_FAIL 

Failed to allocate memory using the malloc function.

PERM_ERRORCODE_READFD_FAIL 

Failed to open the file descriptor.

PERM_ERRORCODE_WRITEFD_FAIL 

Failed to read the file descriptor.

PERM_ERRORCODE_JSONPARSE_FAIL 

Failed to write the file descriptor.

PERM_ERRORCODE_COPY_ERROR 

Failed to parse the JSON string.

PERM_ERRORCODE_FIELD_TOO_LONG 

Failed to copy the string.

PERM_ERRORCODE_PERM_NOT_EXIST 

The permission name or description is too long.

PERM_ERRORCODE_UNLINK_ERROR 

The permission does not exist.

PERM_ERRORCODE_FILE_NOT_EXIST 

Failed to delete the permission file.

PERM_ERRORCODE_MEMSET_FAIL 

The file does not exist.

PERM_ERRORCODE_STAT_FAIL 

Failed to set memory using the memset function.

PERM_ERRORCODE_PATH_INVALID 

Failed to obtain information about the named file using the stat function.

PERM_ERRORCODE_TOO_MUCH_PERM 

Invalid path

PERM_ERRORCODE_TASKID_NOT_EXIST 

Too many permissions

PERM_ERRORCODE_PERM_NUM_ERROR 

The process ID does not exist.

Variable Documentation

desc

  1. char PermissionSaved::desc[[PERM_DESC_LEN]($api-api-SmartVision-Devices-Pms_types.md#gafb859b51e2b9552103cf1ba665e8eb7a)]

Description:

Permission name. For details about its length, see PERM_NAME_LEN.

granted

  1. enum [IsGranted]($api-api-SmartVision-Devices-Pms_types.md#ga56644f429963f015addb12e36e2344f7) PermissionSaved::granted

Description:

Permission description. For details about its length, see PERM_DESC_LEN.