libarchive-formats

title: libarchive-formats(5)

text:
# libarchive-formats(5)

## NAME
libarchive-formats — archive formats supported by the libarchive library

## DESCRIPTION
The libarchive(3) library reads and writes a variety of streaming archive formats. Generally speaking, all of these archive formats consist of a series of “entries”. Each entry stores a single file system object, such as a file, directory, or symbolic link.

The following provides a brief description of each format supported by libarchive, with some information about recognized extensions or limitations of the current library support. Note that just because a format is supported by libarchive does not imply that a program that uses libarchive will support that format. Applications that use libarchive specify which formats they wish to support, though many programs do use libarchive convenience functions to enable all supported formats.

### Tar Formats
The libarchive(3) library can read most tar archives. It can write POSIX-standard “ustar” and “pax interchange” formats as well as v7 tar format and a subset of the legacy GNU tar format.

All tar formats store each entry in one or more 512-byte records. The first record is used for file metadata, including filename, timestamp, and mode information, and the file data is stored in subsequent records. Later variants have extended this by either appropriating undefined areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries.

gnutar

The libarchive(3) library can read most GNU-format tar archives. It currently supports the most popular GNU extensions, including modern long filename and linkname support, as well as atime and ctime data. The libarchive library does not support multi-volume archives, nor the old GNU long filename format. It can read GNU sparse file entries, including the new POSIX-based formats. The libarchive(3) library can write GNU tar format, including long filename and linkname support, as well as atime and ctime data.

pax

The libarchive(3) library can read and write POSIX-compliant pax interchange format archives. Pax interchange format archives are an extension of the older ustar format that adds a separate entry with additional attributes stored as key/value pairs immediately before each regular entry. The presence of these additional entries is the only difference between pax interchange format and the older ustar format. The extended attributes are of unlimited length and are stored as UTF-8 Unicode strings. Keywords defined in the standard are in all lowercase; vendors are allowed to define custom keys by preceding them with the vendor name in all uppercase. When writing pax archives, libarchive uses many of the SCHILY keys defined by Joerg Schilling's “star” archiver and a few LIBARCHIVE keys. The libarchive library can read most of the SCHILY keys and most of the GNU keys introduced by GNU tar. It silently ignores any keywords that it does not understand. The pax interchange format converts filenames to Unicode and stores them using the UTF-8 encoding. Prior to libarchive 3.0, libarchive erroneously assumed that the system wide-character routines natively supported Unicode. This caused it to mis-handle non-ASCII filenames on systems that did not satisfy this assumption.

restricted pax

The libarchive library can also write pax archives in which it attempts to suppress the extended attributes entry whenever possible. The result will be identical to a ustar archive unless the extended attributes entry is required to store a long file name, long linkname, extended ACL, file flags, or if any of the standard ustar data (user name, group name, UID, GID, etc) cannot be fully represented in the ustar header. In all cases, the result can be dearchived by any program that can read POSIX-compliant pax interchange format archives. Programs that correctly read ustar format (see below) will also be able to read this format; any extended attributes will be extracted as separate files stored in PaxHeader directories.

ustar

The libarchive library can both read and write this format. This format has the following limitations:

- Device major and minor numbers are limited to 21 bits. Nodes with larger numbers will not be added to the archive.

- Path names in the archive are limited to 255 bytes. (Shorter if there is no / character in exactly the right place.)

- Symbolic links and hard links are stored in the archive with the name of the referenced file. This name is limited to 100 bytes.

- Extended attributes, file flags, and other extended security information cannot be stored.

- Archive entries are limited to 8 gigabytes in size.

Note that the pax interchange format has none of these restrictions. The ustar format is old and widely supported. It is recommended when compatibility is the primary concern.

v7

The libarchive library can read and write the legacy v7 tar format. This format has the following limitations:

- Only regular files, directories, and symbolic links can be archived. Block and character device nodes, FIFOs, and sockets cannot be archived.

- Path names in the archive are limited to 100 bytes.

- Symbolic links and hard links are stored in the archive with the name of the referenced file. This name is limited to 100 bytes.

- User and group information are stored as numeric IDs; there is no provision for storing user or group names.

- Extended attributes, file flags, and other extended security information cannot be stored.

- Archive entries are limited to 8 gigabytes in size.

Generally, users should prefer the ustar format for portability as the v7 tar format is both less useful and less portable.

The libarchive library also reads a variety of commonly-used extensions to the basic tar format. These extensions are recognized automatically whenever they appear.

Numeric extensions.

The POSIX standards require fixed-length numeric fields to be written with some character position reserved for terminators. Libarchive allows these fields to be written without terminator characters. This extends the allowable range; in particular, ustar archives with this extension can support entries up to 64 gigabytes in size. Libarchive also recognizes base-256 values in most numeric fields. This essentially removes all limitations on file size, modification time, and device numbers.

Solaris extensions

Libarchive recognizes ACL and extended attribute records written by Solaris tar.

The first tar program appeared in Seventh Edition Unix in 1979. The first official standard for the tar file format was the “ustar” (Unix Standard Tar) format defined by POSIX in 1988. POSIX.1-2001 extended the ustar format to create the “pax interchange” format.

### Cpio Formats
The libarchive library can read and write a number of common cpio variants. A cpio archive stores each entry as a fixed-size header followed by a variable-length filename and variable-length data. Unlike the tar format, the cpio format does only minimal padding of the header or file data. There are several cpio variants, which differ primarily in how they store the initial header: some store the values as octal or hexadecimal numbers in ASCII, others as binary values of varying byte order and length.

binary

The libarchive library transparently reads both big-endian and little-endian variants of the the two binary cpio formats; the original one from PWB/UNIX, and the later, more widely used, variant. This format used 32-bit binary values for file size and mtime, and 16-bit binary values for the other fields. The formats support only the file types present in UNIX at the time of their creation. File sizes are limited to 24 bits in the PWB format, because of the limits of the file system, and to 31 bits in the newer binary format, where signed 32 bit longs were used.

odc

This is the POSIX standardized format, which is officially known as the “cpio interchange format” or the “octet-oriented cpio archive format” and sometimes unofficially referred to as the “old character format”. This format stores the header contents as octal values in ASCII. It is standard, portable, and immune from byte-order confusion. File sizes and mtime are limited to 33 bits (8GB file size), other fields are limited to 18 bits.

SVR4/newc

The libarchive library can read both CRC and non-CRC variants of this format. The SVR4 format uses eight-digit hexadecimal values for all header fields. This limits file size to 4GB, and also limits the mtime and other fields to 32 bits. The SVR4 format can optionally include a CRC of the file contents, although libarchive does not currently verify this CRC.

Cpio first appeared in PWB/UNIX 1.0, which was released within AT&T in 1977. PWB/UNIX 1.0 formed the basis of System III Unix, released outside of AT&T in 1981. This makes cpio older than tar, although cpio was not included in Version 7 AT&T Unix. As a result, the tar command became much better known in universities and research groups that used Version 7. The combination of the find and cpio utilities provided very precise control over file selection. Unfortunately, the format has many limitations that make it unsuitable for widespread use. Only the POSIX format permits files over 4GB, and its 18-bit limit for most other fields makes it unsuitable for modern systems. In addition, cpio formats only store numeric UID/GID values (not usernames and group names), which can make it very difficult to correctly transfer archives across systems with dissimilar user numbering.

### Shar Formats
A “shell archive” is a shell script that, when executed on a POSIX-compliant system, will recreate a collection of file system objects. The libarchive library can write two different kinds of shar archives:

shar

The traditional shar format uses a limited set of POSIX commands, including echo(1), mkdir(1), and sed(1). It is suitable for portably archiving small collections of plain text files. However, it is not generally well-suited for large archives (many implementations of sh(1) have limits on the size of a script) nor should it be used with non-text files.

shardump

This format is similar to shar but encodes files using uuencode(1) so that the result will be a plain text file regardless of the file contents. It also includes additional shell commands that attempt to reproduce as many file attributes as possible, including owner, mode, and flags. The additional commands used to restore file attributes make shardump archives less portable than plain shar archives.

### ISO9660 format
Libarchive can read and extract from files containing ISO9660-compliant CDROM images. In many cases, this can remove the need to burn a physical CDROM just in order to read the files contained in an ISO9660 image. It also avoids security and complexity issues that come with virtual mounts and loopback devices. Libarchive supports the most common Rockridge extensions and has partial support for Joliet extensions. If both extensions are present, the Joliet extensions will be used and the Rockridge extensions will be ignored. In particular, this can create problems with hardlinks and symlinks, which are supported by Rockridge but not by Joliet.

Libarchive reads ISO9660 images using a streaming strategy. This allows it to read compressed images directly (decompressing on the fly) and allows it to read images directly from network sockets, pipes, and other non-seekable data sources. This strategy works well for optimized ISO9660 images created by many popular programs. Such programs collect all directory information at the beginning of the ISO9660 image so it can be read from a physical disk with a minimum of seeking. However, not all ISO9660 images can be read in this fashion.

Libarchive can also write ISO9660 images. Such images are fully optimized with the directory information preceding all file data. This is done by storing all file data to a temporary file while collecting directory information in memory. When the image is finished, libarchive writes out the directory structure followed by the file data. The location used for the temporary file can be changed by the usual environment variables.

### Zip format
Libarchive can read and write zip format archives that have uncompressed entries and entries compressed with the “deflate” algorithm. Other zip compression algorithms are not supported. It can extract jar archives, archives that use Zip64 extensions and self-extracting zip archives. Libarchive can use either of two different strategies for reading Zip archives: a streaming strategy which is fast and can handle extremely large archives, and a seeking strategy which can correctly process self-extracting Zip archives and archives with deleted members or other in-place modifications.

The streaming reader processes Zip archives as they are read. It can read archives of arbitrary size from tape or network sockets, and can decode Zip archives that have been separately compressed or encoded. However, self-extracting Zip archives and archives with certain types of modifications cannot be correctly handled. Such archives require that the reader first process the Central Directory, which is ordinarily located at the end of a Zip archive and is thus inaccessible to the streaming reader. If the program using libarchive has enabled seek support, then libarchive will use this to processes the central directory first.

In particular, the seeking reader must be used to correctly handle self-extracting archives. Such archives consist of a program followed by a regular Zip archive. The streaming reader cannot parse the initial program portion, but the seeking reader starts by reading the Central Directory from the end of the archive. Similarly, Zip archives that have been modified in-place can have deleted entries or other garbage data that can only be accurately detected by first reading the Central Directory.

### Archive (library) file format
The Unix archive format (commonly created by the ar(1) archiver) is a general-purpose format which is used almost exclusively for object files to be read by the link editor ld(1). The ar format has never been standardised. There are two common variants: the GNU format derived from SVR4, and the BSD format, which first appeared in 4.4BSD. The two differ primarily in their handling of filenames longer than 15 characters: the GNU/SVR4 variant writes a filename table at the beginning of the archive; the BSD format stores each long filename in an extension area adjacent to the entry. Libarchive can read both extensions, including archives that may include both types of long filenames. Programs using libarchive can write GNU/SVR4 format if they provide an entry called // containing a filename table to be written into the archive before any of the entries. Any entries whose names are not in the filename table will be written using BSD-style long filenames. This can cause problems for programs such as GNU ld that do not support the BSD-style long filenames.

### mtree
Libarchive can read and write files in mtree(5) format. This format is not a true archive format, but rather a textual description of a file hierarchy in which each line specifies the name of a file and provides specific metadata about that file. Libarchive can read all of the keywords supported by both the NetBSD and FreeBSD versions of mtree(8), although many of the keywords cannot currently be stored in an archive_entry object. When writing, libarchive supports use of the archive_write_set_options(3) interface to specify which keywords should be included in the output. If libarchive was compiled with access to suitable cryptographic libraries (such as the OpenSSL libraries), it can compute hash entries such as sha512 or md5 from file data being written to the mtree writer.

When reading an mtree file, libarchive will locate the corresponding files on disk using the contents keyword if present or the regular filename. If it can locate and open the file on disk, it will use that to fill in any metadata that is missing from the mtree file and will read the file contents and return those to the program using libarchive. If it cannot locate and open the file on disk, libarchive will return an error for any attempt to read the entry body.

### 7-Zip
Libarchive can read and write 7-Zip format archives. TODO: Need more information

### CAB
Libarchive can read Microsoft Cabinet ( “CAB”) format archives. TODO: Need more information.

### LHA
TODO: Information about libarchive's LHA support

### RAR
Libarchive has limited support for reading RAR format archives. Currently, libarchive can read RARv3 format archives which have been either created uncompressed, or compressed using any of the compression methods supported by the RARv3 format. Libarchive can also read self-extracting RAR archives.

### Warc
Libarchive can read and write “web archives”. TODO: Need more information

### XAR
Libarchive can read and write the XAR format used by many Apple tools. TODO: Need more information

## SEE ALSO
ar(1), cpio(1), mkisofs(1), shar(1), tar(1), zip(1), zlib(3), cpio(5), mtree(5), tar(5)


mtree

package: libarchive-devel

title: mtree(5)

summary: format of mtree dir hierarchy files

text:
# mtree(5)

## NAME
mtree — format of mtree dir hierarchy files

## DESCRIPTION
The mtree format is a textual format that describes a collection of filesystem objects. Such files are typically used to create or verify directory hierarchies.

### General Format
An mtree file consists of a series of lines, each providing information about a single filesystem object. Leading whitespace is always ignored.

When encoding file or pathnames, any backslash character or character outside of the 95 printable ASCII characters must be encoded as a backslash followed by three octal digits. When reading mtree files, any appearance of a backslash followed by three octal digits should be converted into the corresponding character.

Each line is interpreted independently as one of the following types:

Blank

Blank lines are ignored.

Comment

Lines beginning with # are ignored.

Special

Lines beginning with / are special commands that influence the interpretation of later lines.

Relative

If the first whitespace-delimited word has no / characters, it is the name of a file in the current directory. Any relative entry that describes a directory changes the current directory.

dot-dot

As a special case, a relative entry with the filename .. changes the current directory to the parent directory. Options on dot-dot entries are always ignored.

Full

If the first whitespace-delimited word has a / character after the first character, it is the pathname of a file relative to the starting directory. There can be multiple full entries describing the same file.

Some tools that process mtree files may require that multiple lines describing the same file occur consecutively. It is not permitted for the same file to be mentioned using both a relative and a full file specification.

### Special commands
Two special commands are currently defined:

/set

This command defines default values for one or more keywords. It is followed on the same line by one or more whitespace-separated keyword definitions. These definitions apply to all following files that do not specify a value for that keyword.

/unset

This command removes any default value set by a previous /set command. It is followed on the same line by one or more keywords separated by whitespace.

### Keywords
After the filename, a full or relative entry consists of zero or more whitespace-separated keyword definitions. Each such definition consists of a key from the following list immediately followed by an '=' sign and a value. Software programs reading mtree files should warn about unrecognized keywords.

Currently supported keywords are as follows:

cksum

The checksum of the file using the default algorithm specified by the cksum(1) utility.

device

The device number for block or char file types. The value must be one of the following forms: format,major,minor[,subunit]

A device with major, minor and optional subunit fields. Their meaning is specified by the operating's system format. See below for valid formats.

number

Opaque number (as stored on the file system).

The following values for format are recognized: native, 386bsd, 4bsd, bsdos, freebsd, hpux, isc, linux, netbsd, osf1, sco, solaris, sunos, svr3, svr4, and ultrix.

See mknod(8) for more details.

contents

The full pathname of a file that holds the contents of this file.

flags

The file flags as a symbolic name. See chflags(1) for information on these names. If no flags are to be set the string “none” may be used to override the current default.

gid

The file group as a numeric value.

gname

The file group as a symbolic name.

ignore

Ignore any file hierarchy below this file.

inode

The inode number.

link

The target of the symbolic link when type=link.

md5

The MD5 message digest of the file.

md5digest

A synonym for md5.

mode

The current file's permissions as a numeric (octal) or symbolic value.

nlink

The number of hard links the file is expected to have.

nochange

Make sure this file or directory exists but otherwise ignore all attributes.

optional

The file is optional; do not complain about the file if it is not in the file hierarchy.

resdevice

The “resident” device number of the file, e.g. the ID of the device that contains the file. Its format is the same as the one for device.

ripemd160digest

The RIPEMD160 message digest of the file.

rmd160

A synonym for ripemd160digest.

rmd160digest

A synonym for ripemd160digest.

sha1

The FIPS 160-1 (“SHA-1”) message digest of the file.

sha1digest

A synonym for sha1.

sha256

The FIPS 180-2 (“SHA-256”) message digest of the file.

sha256digest

A synonym for sha256.

sha384

The FIPS 180-2 (“SHA-384”) message digest of the file.

sha384digest

A synonym for sha384.

sha512

The FIPS 180-2 (“SHA-512”) message digest of the file.

sha512digest

A synonym for sha512.

size

The size, in bytes, of the file.

time

The last modification time of the file.

type

The type of the file; may be set to any one of the following:

block

block special device

char

character special device

dir

directory

fifo

fifo

file

regular file

link

symbolic link

socket

socket

uid

The file owner as a numeric value.

uname

The file owner as a symbolic name.

## SEE ALSO
cksum(1), find(1), mtree(8)

## HISTORY
The mtree utility appeared in 4.3BSD-Reno. The MD5 digest capability was added in FreeBSD 2.1, in response to the widespread use of programs which can spoof cksum(1). The SHA-1 and RIPEMD160 digests were added in FreeBSD 4.0, as new attacks have demonstrated weaknesses in MD5. The SHA-256 digest was added in FreeBSD 6.0. Support for file flags was added in FreeBSD 4.0, and mostly comes from NetBSD. The “full” entry format was added by NetBSD.


tar

title: tar(5)

summary: format of tape archive files

text:
# tar(5)

## NAME
tar — format of tape archive files

## DESCRIPTION
The tar archive format collects any number of files, directories, and other file system objects (symbolic links, device nodes, etc.) into a single stream of bytes. The format was originally designed to be used with tape drives that operate with fixed-size blocks, but is widely used as a general packaging mechanism.

### General Format
A tar archive consists of a series of 512-byte records. Each file system object requires a header record which stores basic metadata (pathname, owner, permissions, etc.) and zero or more records containing any file data. The end of the archive is indicated by two records consisting entirely of zero bytes.

For compatibility with tape drives that use fixed block sizes, programs that read or write tar files always read or write a fixed number of records with each I/O operation. These “blocks” are always a multiple of the record size. The maximum block size supported by early implementations was 10240 bytes or 20 records. This is still the default for most implementations although block sizes of 1MiB (2048 records) or larger are commonly used with modern high-speed tape drives. (Note: the terms “block” and “record” here are not entirely standard; this document follows the convention established by John Gilmore in documenting pdtar.)

### Old-Style Archive Format
The original tar archive format has been extended many times to include additional information that various implementors found necessary. This section describes the variant implemented by the tar command included in Version 7 AT&T UNIX, which seems to be the earliest widely-used version of the tar program.

The header record for an old-style tar archive consists of the following:

```
struct header_old_tar {
	char name[100];
	char mode[8];
	char uid[8];
	char gid[8];
	char size[12];
	char mtime[12];
	char checksum[8];
	char linkflag[1];
	char linkname[100];
	char pad[255];
};
```

All unused bytes in the header record are filled with nulls. name

Pathname, stored as a null-terminated string. Early tar implementations only stored regular files (including hardlinks to those files). One common early convention used a trailing "/" character to indicate a directory name, allowing directory permissions and owner information to be archived and restored.

mode

File mode, stored as an octal number in ASCII.

uid, gid

User id and group id of owner, as octal numbers in ASCII.

size

Size of file, as octal number in ASCII. For regular files only, this indicates the amount of data that follows the header. In particular, this field was ignored by early tar implementations when extracting hardlinks. Modern writers should always store a zero length for hardlink entries.

mtime

Modification time of file, as an octal number in ASCII. This indicates the number of seconds since the start of the epoch, 00:00:00 UTC January 1, 1970. Note that negative values should be avoided here, as they are handled inconsistently.

checksum

Header checksum, stored as an octal number in ASCII. To compute the checksum, set the checksum field to all spaces, then sum all bytes in the header using unsigned arithmetic. This field should be stored as six octal digits followed by a null and a space character. Note that many early implementations of tar used signed arithmetic for the checksum field, which can cause interoperability problems when transferring archives between systems. Modern robust readers compute the checksum both ways and accept the header if either computation matches.

linkflag, linkname

In order to preserve hardlinks and conserve tape, a file with multiple links is only written to the archive the first time it is encountered. The next time it is encountered, the linkflag is set to an ASCII ‘1’ and the linkname field holds the first name under which this file appears. (Note that regular files have a null value in the linkflag field.)

Early tar implementations varied in how they terminated these fields. The tar command in Version 7 AT&T UNIX used the following conventions (this is also documented in early BSD manpages): the pathname must be null-terminated; the mode, uid, and gid fields must end in a space and a null byte; the size and mtime fields must end in a space; the checksum is terminated by a null and a space. Early implementations filled the numeric fields with leading spaces. This seems to have been common practice until the IEEE Std 1003.1-1988 (“POSIX.1”) standard was released. For best portability, modern implementations should fill the numeric fields with leading zeros.

### Pre-POSIX Archives
An early draft of IEEE Std 1003.1-1988 (“POSIX.1”) served as the basis for John Gilmore's pdtar program and many system implementations from the late 1980s and early 1990s. These archives generally follow the POSIX ustar format described below with the following variations:

- The magic value consists of the five characters “ustar” followed by a space. The version field contains a space character followed by a null.

- The numeric fields are generally filled with leading spaces (not leading zeros as recommended in the final standard).

- The prefix field is often not used, limiting pathnames to the 100 characters of old-style archives.

### POSIX ustar Archives
IEEE Std 1003.1-1988 (“POSIX.1”) defined a standard tar file format to be read and written by compliant implementations of tar(1). This format is often called the “ustar” format, after the magic value used in the header. (The name is an acronym for “Unix Standard TAR”.) It extends the historic format with new fields:

```
struct header_posix_ustar {
	char name[100];
	char mode[8];
	char uid[8];
	char gid[8];
	char size[12];
	char mtime[12];
	char checksum[8];
	char typeflag[1];
	char linkname[100];
	char magic[6];
	char version[2];
	char uname[32];
	char gname[32];
	char devmajor[8];
	char devminor[8];
	char prefix[155];
	char pad[12];
};
```

typeflag

Type of entry. POSIX extended the earlier linkflag field with several new type values: “0”

Regular file. NUL should be treated as a synonym, for compatibility purposes.

“1”

Hard link.

“2”

Symbolic link.

“3”

Character device node.

“4”

Block device node.

“5”

Directory.

“6”

FIFO node.

“7”

Reserved.

Other

A POSIX-compliant implementation must treat any unrecognized typeflag value as a regular file. In particular, writers should ensure that all entries have a valid filename so that they can be restored by readers that do not support the corresponding extension. Uppercase letters "A" through "Z" are reserved for custom extensions. Note that sockets and whiteout entries are not archivable.

It is worth noting that the size field, in particular, has different meanings depending on the type. For regular files, of course, it indicates the amount of data following the header. For directories, it may be used to indicate the total size of all files in the directory, for use by operating systems that pre-allocate directory space. For all other types, it should be set to zero by writers and ignored by readers.

magic

Contains the magic value “ustar” followed by a NUL byte to indicate that this is a POSIX standard archive. Full compliance requires the uname and gname fields be properly set.

version

Version. This should be “00” (two copies of the ASCII digit zero) for POSIX standard archives.

uname, gname

User and group names, as null-terminated ASCII strings. These should be used in preference to the uid/gid values when they are set and the corresponding names exist on the system.

devmajor, devminor

Major and minor numbers for character device or block device entry.

name, prefix

If the pathname is too long to fit in the 100 bytes provided by the standard format, it can be split at any / character with the first portion going into the prefix field. If the prefix field is not empty, the reader will prepend the prefix value and a / character to the regular name field to obtain the full pathname. The standard does not require a trailing / character on directory names, though most implementations still include this for compatibility reasons.

Note that all unused bytes must be set to NUL.

Field termination is specified slightly differently by POSIX than by previous implementations. The magic, uname, and gname fields must have a trailing NUL. The pathname, linkname, and prefix fields must have a trailing NUL unless they fill the entire field. (In particular, it is possible to store a 256-character pathname if it happens to have a / as the 156th character.) POSIX requires numeric fields to be zero-padded in the front, and requires them to be terminated with either space or NUL characters.

Currently, most tar implementations comply with the ustar format, occasionally extending it by adding new fields to the blank area at the end of the header record.

### Numeric Extensions
There have been several attempts to extend the range of sizes or times supported by modifying how numbers are stored in the header.

One obvious extension to increase the size of files is to eliminate the terminating characters from the various numeric fields. For example, the standard only allows the size field to contain 11 octal digits, reserving the twelfth byte for a trailing NUL character. Allowing 12 octal digits allows file sizes up to 64 GB.

Another extension, utilized by GNU tar, star, and other newer tar implementations, permits binary numbers in the standard numeric fields. This is flagged by setting the high bit of the first byte. The remainder of the field is treated as a signed twos-complement value. This permits 95-bit values for the length and time fields and 63-bit values for the uid, gid, and device numbers. In particular, this provides a consistent way to handle negative time values. GNU tar supports this extension for the length, mtime, ctime, and atime fields. Joerg Schilling's star program and the libarchive library support this extension for all numeric fields. Note that this extension is largely obsoleted by the extended attribute record provided by the pax interchange format.

Another early GNU extension allowed base-64 values rather than octal. This extension was short-lived and is no longer supported by any implementation.

### Pax Interchange Format
There are many attributes that cannot be portably stored in a POSIX ustar archive. IEEE Std 1003.1-2001 (“POSIX.1”) defined a “pax interchange format” that uses two new types of entries to hold text-formatted metadata that applies to following entries. Note that a pax interchange format archive is a ustar archive in every respect. The new data is stored in ustar-compatible archive entries that use the “x” or “g” typeflag. In particular, older implementations that do not fully support these extensions will extract the metadata into regular files, where the metadata can be examined as necessary.

An entry in a pax interchange format archive consists of one or two standard ustar entries, each with its own header and data. The first optional entry stores the extended attributes for the following entry. This optional first entry has an "x" typeflag and a size field that indicates the total size of the extended attributes. The extended attributes themselves are stored as a series of text-format lines encoded in the portable UTF-8 encoding. Each line consists of a decimal number, a space, a key string, an equals sign, a value string, and a new line. The decimal number indicates the length of the entire line, including the initial length field and the trailing newline. An example of such a field is:

25 ctime=1084839148.1212\n

Keys in all lowercase are standard keys. Vendors can add their own keys by prefixing them with an all uppercase vendor name and a period. Note that, unlike the historic header, numeric values are stored using decimal, not octal. A description of some common keys follows: atime, ctime, mtime

File access, inode change, and modification times. These fields can be negative or include a decimal point and a fractional value.

hdrcharset

The character set used by the pax extension values. By default, all textual values in the pax extended attributes are assumed to be in UTF-8, including pathnames, user names, and group names. In some cases, it is not possible to translate local conventions into UTF-8. If this key is present and the value is the six-character ASCII string “BINARY”, then all textual values are assumed to be in a platform-dependent multi-byte encoding. Note that there are only two valid values for this key: “BINARY” or “ISO-IR 10646 2000 UTF-8”. No other values are permitted by the standard, and the latter value should generally not be used as it is the default when this key is not specified. In particular, this flag should not be used as a general mechanism to allow filenames to be stored in arbitrary encodings.

uname, uid, gname, gid

User name, group name, and numeric UID and GID values. The user name and group name stored here are encoded in UTF8 and can thus include non-ASCII characters. The UID and GID fields can be of arbitrary length.

linkpath

The full path of the linked-to file. Note that this is encoded in UTF8 and can thus include non-ASCII characters.

path

The full pathname of the entry. Note that this is encoded in UTF8 and can thus include non-ASCII characters.

realtime.*, security.*

These keys are reserved and may be used for future standardization.

size

The size of the file. Note that there is no length limit on this field, allowing conforming archives to store files much larger than the historic 8GB limit.

SCHILY.*

Vendor-specific attributes used by Joerg Schilling's star implementation.

SCHILY.acl.access, SCHILY.acl.default, SCHILY.acl.ace

Stores the access, default and NFSv4 ACLs as textual strings in a format that is an extension of the format specified by POSIX.1e draft 17. In particular, each user or group access specification can include an additional colon-separated field with the numeric UID or GID. This allows ACLs to be restored on systems that may not have complete user or group information available (such as when NIS/YP or LDAP services are temporarily unavailable).

SCHILY.devminor, SCHILY.devmajor

The full minor and major numbers for device nodes.

SCHILY.fflags

The file flags.

SCHILY.realsize

The full size of the file on disk. XXX explain? XXX

SCHILY.dev, SCHILY.ino, SCHILY.nlinks

The device number, inode number, and link count for the entry. In particular, note that a pax interchange format archive using Joerg Schilling's SCHILY.* extensions can store all of the data from struct stat.

LIBARCHIVE.*

Vendor-specific attributes used by the libarchive library and programs that use it.

LIBARCHIVE.creationtime

The time when the file was created. (This should not be confused with the POSIX “ctime” attribute, which refers to the time when the file metadata was last changed.)

LIBARCHIVE.xattr.namespace.key

Libarchive stores POSIX.1e-style extended attributes using keys of this form. The key value is URL-encoded: All non-ASCII characters and the two special characters “=” and “%” are encoded as “%” followed by two uppercase hexadecimal digits. The value of this key is the extended attribute value encoded in base 64. XXX Detail the base-64 format here XXX

VENDOR.*

XXX document other vendor-specific extensions XXX

Any values stored in an extended attribute override the corresponding values in the regular tar header. Note that compliant readers should ignore the regular fields when they are overridden. This is important, as existing archivers are known to store non-compliant values in the standard header fields in this situation. There are no limits on length for any of these fields. In particular, numeric fields can be arbitrarily large. All text fields are encoded in UTF8. Compliant writers should store only portable 7-bit ASCII characters in the standard ustar header and use extended attributes whenever a text value contains non-ASCII characters.

In addition to the x entry described above, the pax interchange format also supports a g entry. The g entry is identical in format, but specifies attributes that serve as defaults for all subsequent archive entries. The g entry is not widely used.

Besides the new x and g entries, the pax interchange format has a few other minor variations from the earlier ustar format. The most troubling one is that hardlinks are permitted to have data following them. This allows readers to restore any hardlink to a file without having to rewind the archive to find an earlier entry. However, it creates complications for robust readers, as it is no longer clear whether or not they should ignore the size field for hardlink entries.

### GNU Tar Archives
The GNU tar program started with a pre-POSIX format similar to that described earlier and has extended it using several different mechanisms: It added new fields to the empty space in the header (some of which was later used by POSIX for conflicting purposes); it allowed the header to be continued over multiple records; and it defined new entries that modify following entries (similar in principle to the x entry described above, but each GNU special entry is single-purpose, unlike the general-purpose x entry). As a result, GNU tar archives are not POSIX compatible, although more lenient POSIX-compliant readers can successfully extract most GNU tar archives.

```
struct header_gnu_tar {
	char name[100];
	char mode[8];
	char uid[8];
	char gid[8];
	char size[12];
	char mtime[12];
	char checksum[8];
	char typeflag[1];
	char linkname[100];
	char magic[6];
	char version[2];
	char uname[32];
	char gname[32];
	char devmajor[8];
	char devminor[8];
	char atime[12];
	char ctime[12];
	char offset[12];
	char longnames[4];
	char unused[1];
	struct {
		char offset[12];
		char numbytes[12];
	} sparse[4];
	char isextended[1];
	char realsize[12];
	char pad[17];
};
```

typeflag

GNU tar uses the following special entry types, in addition to those defined by POSIX: 7

GNU tar treats type "7" records identically to type "0" records, except on one obscure RTOS where they are used to indicate the pre-allocation of a contiguous file on disk.

D

This indicates a directory entry. Unlike the POSIX-standard "5" typeflag, the header is followed by data records listing the names of files in this directory. Each name is preceded by an ASCII "Y" if the file is stored in this archive or "N" if the file is not stored in this archive. Each name is terminated with a null, and an extra null marks the end of the name list. The purpose of this entry is to support incremental backups; a program restoring from such an archive may wish to delete files on disk that did not exist in the directory when the archive was made. Note that the "D" typeflag specifically violates POSIX, which requires that unrecognized typeflags be restored as normal files. In this case, restoring the "D" entry as a file could interfere with subsequent creation of the like-named directory.

K

The data for this entry is a long linkname for the following regular entry.

L

The data for this entry is a long pathname for the following regular entry.

M

This is a continuation of the last file on the previous volume. GNU multi-volume archives guarantee that each volume begins with a valid entry header. To ensure this, a file may be split, with part stored at the end of one volume, and part stored at the beginning of the next volume. The "M" typeflag indicates that this entry continues an existing file. Such entries can only occur as the first or second entry in an archive (the latter only if the first entry is a volume label). The size field specifies the size of this entry. The offset field at bytes 369-380 specifies the offset where this file fragment begins. The realsize field specifies the total size of the file (which must equal size plus offset). When extracting, GNU tar checks that the header file name is the one it is expecting, that the header offset is in the correct sequence, and that the sum of offset and size is equal to realsize.

N

Type "N" records are no longer generated by GNU tar. They contained a list of files to be renamed or symlinked after extraction; this was originally used to support long names. The contents of this record are a text description of the operations to be done, in the form “Rename %s to %s\n” or “Symlink %s to %s\n”; in either case, both filenames are escaped using K&R C syntax. Due to security concerns, "N" records are now generally ignored when reading archives.

S

This is a “sparse” regular file. Sparse files are stored as a series of fragments. The header contains a list of fragment offset/length pairs. If more than four such entries are required, the header is extended as necessary with “extra” header extensions (an older format that is no longer used), or “sparse” extensions.

V

The name field should be interpreted as a tape/volume header name. This entry should generally be ignored on extraction.

magic

The magic field holds the five characters “ustar” followed by a space. Note that POSIX ustar archives have a trailing null.

version

The version field holds a space character followed by a null. Note that POSIX ustar archives use two copies of the ASCII digit “0”.

atime, ctime

The time the file was last accessed and the time of last change of file information, stored in octal as with mtime.

longnames

This field is apparently no longer used.

Sparse offset / numbytes

Each such structure specifies a single fragment of a sparse file. The two fields store values as octal numbers. The fragments are each padded to a multiple of 512 bytes in the archive. On extraction, the list of fragments is collected from the header (including any extension headers), and the data is then read and written to the file at appropriate offsets.

isextended

If this is set to non-zero, the header will be followed by additional “sparse header” records. Each such record contains information about as many as 21 additional sparse blocks as shown here:

```
struct gnu_sparse_header {
	struct {
		char offset[12];
		char numbytes[12];
	} sparse[21];
	char    isextended[1];
	char    padding[7];
};
```

realsize

A binary representation of the file's complete size, with a much larger range than the POSIX file size. In particular, with M type files, the current entry is only a portion of the file. In that case, the POSIX size field will indicate the size of this entry; the realsize field will indicate the total size of the file.

### GNU tar pax archives
GNU tar 1.14 (XXX check this XXX) and later will write pax interchange format archives when you specify the --posix flag. This format follows the pax interchange format closely, using some SCHILY tags and introducing new keywords to store sparse file information. There have been three iterations of the sparse file support, referred to as “0.0”, “0.1”, and “1.0”.

GNU.sparse.numblocks, GNU.sparse.offset, GNU.sparse.numbytes, GNU.sparse.size

The “0.0” format used an initial GNU.sparse.numblocks attribute to indicate the number of blocks in the file, a pair of GNU.sparse.offset and GNU.sparse.numbytes to indicate the offset and size of each block, and a single GNU.sparse.size to indicate the full size of the file. This is not the same as the size in the tar header because the latter value does not include the size of any holes. This format required that the order of attributes be preserved and relied on readers accepting multiple appearances of the same attribute names, which is not officially permitted by the standards.

GNU.sparse.map

The “0.1” format used a single attribute that stored a comma-separated list of decimal numbers. Each pair of numbers indicated the offset and size, respectively, of a block of data. This does not work well if the archive is extracted by an archiver that does not recognize this extension, since many pax implementations simply discard unrecognized attributes.

GNU.sparse.major, GNU.sparse.minor, GNU.sparse.name, GNU.sparse.realsize

The “1.0” format stores the sparse block map in one or more 512-byte blocks prepended to the file data in the entry body. The pax attributes indicate the existence of this map (via the GNU.sparse.major and GNU.sparse.minor fields) and the full size of the file. The GNU.sparse.name holds the true name of the file. To avoid confusion, the name stored in the regular tar header is a modified name so that extraction errors will be apparent to users.

### Solaris Tar
XXX More Details Needed XXX

Solaris tar (beginning with SunOS XXX 5.7 ?? XXX) supports an “extended” format that is fundamentally similar to pax interchange format, with the following differences:

- Extended attributes are stored in an entry whose type is X, not x, as used by pax interchange format. The detailed format of this entry appears to be the same as detailed above for the x entry.

- An additional A header is used to store an ACL for the following regular entry. The body of this entry contains a seven-digit octal number followed by a zero byte, followed by the textual ACL description. The octal value is the number of ACL entries plus a constant that indicates the ACL type: 01000000 for POSIX.1e ACLs and 03000000 for NFSv4 ACLs.

### AIX Tar
XXX More details needed XXX

AIX Tar uses a ustar-formatted header with the type A for storing coded ACL information. Unlike the Solaris format, AIX tar writes this header after the regular file body to which it applies. The pathname in this header is either NFS4 or AIXC to indicate the type of ACL stored. The actual ACL is stored in platform-specific binary format.

### Mac OS X Tar
The tar distributed with Apple's Mac OS X stores most regular files as two separate files in the tar archive. The two files have the same name except that the first one has “._” prepended to the last path element. This special file stores an AppleDouble-encoded binary blob with additional metadata about the second file, including ACL, extended attributes, and resources. To recreate the original file on disk, each separate file can be extracted and the Mac OS X copyfile() function can be used to unpack the separate metadata file and apply it to th regular file. Conversely, the same function provides a “pack” option to encode the extended metadata from a file into a separate file whose contents can then be put into a tar archive.

Note that the Apple extended attributes interact badly with long filenames. Since each file is stored with the full name, a separate set of extensions needs to be included in the archive for each one, doubling the overhead required for files with long names.

### Summary of tar type codes
The following list is a condensed summary of the type codes used in tar header records generated by different tar implementations. More details about specific implementations can be found above:

NUL

Early tar programs stored a zero byte for regular files.

0

POSIX standard type code for a regular file.

1

POSIX standard type code for a hard link description.

2

POSIX standard type code for a symbolic link description.

3

POSIX standard type code for a character device node.

4

POSIX standard type code for a block device node.

5

POSIX standard type code for a directory.

6

POSIX standard type code for a FIFO.

7

POSIX reserved.

7

GNU tar used for pre-allocated files on some systems.

A

Solaris tar ACL description stored prior to a regular file header.

A

AIX tar ACL description stored after the file body.

D

GNU tar directory dump.

K

GNU tar long linkname for the following header.

L

GNU tar long pathname for the following header.

M

GNU tar multivolume marker, indicating the file is a continuation of a file from the previous volume.

N

GNU tar long filename support. Deprecated.

S

GNU tar sparse regular file.

V

GNU tar tape/volume header name.

X

Solaris tar general-purpose extension header.

g

POSIX pax interchange format global extensions.

x

POSIX pax interchange format per-file extensions.

## SEE ALSO
ar(1), pax(1), tar(1)

## STANDARDS
The tar utility is no longer a part of POSIX or the Single Unix Standard. It last appeared in Version 2 of the Single UNIX Specification (“SUSv2”). It has been supplanted in subsequent standards by pax(1). The ustar format is currently part of the specification for the pax(1) utility. The pax interchange file format is new with IEEE Std 1003.1-2001 (“POSIX.1”).

## HISTORY
A tar command appeared in Seventh Edition Unix, which was released in January, 1979. It replaced the tp program from Fourth Edition Unix which in turn replaced the tap program from First Edition Unix. John Gilmore's pdtar public-domain implementation (circa 1987) was highly influential and formed the basis of GNU tar (circa 1988). Joerg Shilling's star archiver is another open-source (CDDL) archiver (originally developed circa 1985) which features complete support for pax interchange format.

This documentation was written as part of the libarchive and bsdtar project by Tim Kientzle ⟨kientzle@FreeBSD.org⟩.


org.bluez.Adapter

package: libbluez-devel

title: org.bluez.Adapter(5)

summary: BlueZ D-Bus Adapter API documentation

text:
# org.bluez.Adapter(5)

## NAME
org.bluez.Adapter - BlueZ D-Bus Adapter API documentation

## INTERFACE
Service

org.bluez

Interface

org.bluez.Adapter1

Object path

[variable prefix]/{hci0,hci1,...}

### void StartDiscovery()
Starts device discovery session which may include starting an inquiry and/or scanning procedures and remote device name resolving. Use StopDiscovery to release the sessions acquired.

This process will start creating Device objects as new devices are discovered.

During discovery RSSI delta-threshold is imposed.

Each client can request a single device discovery session per adapter.

Possible errors:

org.bluez.Error.NotReady

org.bluez.Error.Failed

org.bluez.Error.InProgress

### void StopDiscovery()
Stops device discovery session started by StartDiscovery. Note that a discovery procedure is shared between all discovery sessions thus calling StopDiscovery will only release a single session and discovery will stop when all sessions from all clients have finished.

Possible errors:

org.bluez.Error.NotReady

org.bluez.Error.Failed

org.bluez.Error.NotAuthorized

### void RemoveDevice(object device)
Removes the remote device object at the given path including cahed information such as bonding information. Possible errors:

org.bluez.Error.InvalidArguments

org.bluez.Error.Failed

### void SetDiscoveryFilter(dict filter)
Sets the device discovery filter for the caller. When this method is called with no filter parameter, filter is removed. Possible filter values:

array{string} UUIDs

Filter by service UUIDs, empty means match any UUID. When a remote device is found that advertises any UUID from UUIDs, it will be reported if:

- Pathloss and RSSI are both empty.

- only Pathloss param is set, device advertise TX power, and computed pathloss is less than Pathloss param.

- only RSSI param is set, and received RSSI is higher than RSSI param.

int16 RSSI

RSSI threshold value. PropertiesChanged signals will be emitted for already existing Device objects, with updated RSSI value. If one or more discovery filters have been set, the RSSI delta-threshold, that is imposed by StartDiscovery by default, will not be applied.

uint16 Pathloss

Pathloss threshold value. PropertiesChanged signals will be emitted for already existing Device objects, with updated Pathloss value.

string Transport (Default auto )

Transport parameter determines the type of scan. Possible values:

auto

Interleaved scan, use LE, BREDR, or both, depending on what's currently enabled.

bredr

BR/EDR inquiry only.

le

LE scan only.

bool DuplicateData (Default false)

Disables duplicate detection of advertisement data. When enabled PropertiesChanged signals will be generated for either ManufacturerData and ServiceData everytime they are discovered.

bool Discoverable (Default false)

Make adapter discoverable while discovering, if the adapter is already discoverable setting this filter won't do anything.

string Pattern (Default none)

Discover devices where the pattern matches either the prefix of the address or device name which is convenient way to limited the number of device objects created during a discovery. When set disregards device discoverable flags.

Note: The pattern matching is ignored if there are other client that don't set any pattern as it work as a logical OR, also setting empty string "" pattern will match any device found.

bool AutoConnect (Default false)

Connect to discovered devices automatically if a Pattern has been set and it matches the device address or name and it is connectable.

When discovery filter is set, Device objects will be created as new devices with matching criteria are discovered regardless of they are connectable or discoverable which enables listening to non-connectable and non-discoverable devices.

When multiple clients call SetDiscoveryFilter, their filters are internally merged, and notifications about new devices are sent to all clients. Therefore, each client must check that device updates actually match its filter.

When SetDiscoveryFilter is called multiple times by the same client, last filter passed will be active for given client.

SetDiscoveryFilter can be called before StartDiscovery. It is useful when client will create first discovery session, to ensure that proper scan will be started right after call to StartDiscovery.

Possible errors:

org.bluez.Error.NotReady

org.bluez.Error.NotSupported

org.bluez.Error.Failed

### array{string} GetDiscoveryFilters()
Returns available filters that can be given to SetDiscoveryFilter. Possible errors: None

### object ConnectDevice(dict properties) [experimental]
connects to device without need of performing General Discovery. Connection mechanism is similar to Connect method on org.bluez.Device1(5) interface with exception that this method returns success when physical connection is established and you can specify bearer to connect with parameter. After this method returns, services discovery will continue and any supported profile will be connected. There is no need for calling Connect on Device1 after this call. If connection was successful this method returns object path to created device object or device that already exist. Possible properties values:

string Address (Mandatory)

The Bluetooth device address of the remote device.

string AddressType (Default BR/EDR )

The Bluetooth device Address Type. This is address type that should be used for initial connection. Possible values:

public

Public address

random

Random address

Possible errors:

org.bluez.Error.InvalidArguments

org.bluez.Error.AlreadyExists

org.bluez.Error.NotSupported

org.bluez.Error.NotReady

org.bluez.Error.Failed

### string Address [readonly]
The Bluetooth device address.

### string AddressType [readonly]
The Bluetooth Address Type. For dual-mode and BR/EDR only adapter this defaults to "public". Single mode LE adapters may have either value. With privacy enabled this contains type of Identity Address and not type of address used for connection. Possible values:

public

Public address.

random

Random address.

### string Name [readonly]
The Bluetooth system name (pretty hostname). This property is either a static system default or controlled by an external daemon providing access to the pretty hostname configuration.

### string Alias [readwrite]
The Bluetooth friendly name. This value can be changed. In case no alias is set, it will return the system provided name. Setting an empty string as alias will convert it back to the system provided name.

When resetting the alias with an empty string, the property will default back to system name.

On a well configured system, this property never needs to be changed since it defaults to the system name and provides the pretty hostname. Only if the local name needs to be different from the pretty hostname, this property should be used as last resort.

### uint32 Class [readonly]
The Bluetooth class of device. This property represents the value that is either automatically configured by DMI/ACPI information or provided as static configuration.

### boolean Connectable [readwrite]
Set an adapter to connectable or non-connectable. This is a global setting and should only be used by the settings application. Setting this property to false will set the Discoverable property of the adapter to false as well, which will not be reverted if if Connectable is set back to true. If required, the application will need to manually set Discoverable to true.

Note that this property only affects incoming connections.

### boolean Powered [readwrite]
Switch an adapter on or off. This will also set the appropriate connectable state of the controller. The value of this property is not persistent. After restart or unplugging of the adapter it will reset back to false.

### string PowerState [readonly, experimental]
The power state of an adapter. The power state will show whether the adapter is turning off, or turning on, as well as being on or off.

Possible values:

on

Powered on.

off

Powered off

off-enabling

Transitioning from "off" to "on".

on-disabling

Transitioning from "on" to "off".

off-blocked

Blocked by rfkill.

### boolean Discoverable [readwrite] (Default: false)
Switch an adapter to discoverable or non-discoverable to either make it visible or hide it. This is a global setting and should only be used by the settings application. If the DiscoverableTimeout is set to a non-zero value then the system will set this value back to false after the timer expired.

In case the adapter is switched off, setting this value will fail.

When changing the Powered property the new state of this property will be updated via a PropertiesChanged signal.

### boolean Pairable [readwrite] (Default: true)
Switch an adapter to pairable or non-pairable. This is a global setting and should only be used by the settings application. Note that this property only affects incoming pairing requests.

### uint32 PairableTimeout [readwrite] (Default: 0)
The pairable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in pairable mode forever.

### uint32 DiscoverableTimeout [readwrite] (Default: 180)
The discoverable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode forever.

### boolean Discovering [readonly]
Indicates that a device discovery procedure is active.

### array{string} UUIDs [readonly]
List of 128-bit UUIDs that represents the available local services.

### string Modalias [readonly, optional]
Local Device ID information in modalias format used by the kernel and udev.

### array{string} Roles [readonly]
List of supported roles. Possible values:

central

Supports the central role.

peripheral

Supports the peripheral role.

central-peripheral

Supports both roles concurrently.

### array{string} ExperimentalFeatures [readonly, optional]
List of 128-bit UUIDs that represents the experimental features currently enabled.

### uint16 Manufacturer [readonly]
The manufacturer of the device, as a uint16 company identifier defined by the Core Bluetooth Specification.

### byte Version [readonly]
The Bluetooth version supported by the device, as a core version code defined by the Core Bluetooth Specification.


org.bluez.AdminPolicySet

title: org.bluez.AdminPolicySet(5)

text:
# org.bluez.AdminPolicySet(5)

## NAME
org.bluez.AdminPolicySet - BlueZ D-Bus AdminPolicySet API documentation

## DESCRIPTION
This API provides methods to control the behavior of bluetoothd(8) as an administrator.

Interface AdminPolicySet1 provides methods to set policies. Once the policy is set successfully, it will affect all clients and stay persistently even after restarting bluetoothd(8). The only way to clear it is to overwrite the policy with the same method.

## INTERFACE
Service

org.bluez

Interface

org.bluez.AdminPolicySet1 [experimental]

Object path

[variable prefix]/{hci0,hci1,...}

### void SetServiceAllowList(array{string} UUIDs)
Sets the service allowlist by specifying service UUIDs. When called, bluetoothd(8) will block incoming and outgoing connections to the service not in UUIDs for all of the clients.

Any subsequent calls to this method will supersede any previously set allowlist values. Calling this method with an empty array will allow any service UUIDs to be used.

The default value is an empty array.

Possible errors:

org.bluez.Error.InvalidArguments

org.bluez.Error.Failed


org.bluez.AdminPolicyStatus

title: org.bluez.AdminPolicyStatus(5)

text:
# org.bluez.AdminPolicyStatus(5)

## NAME
org.bluez.AdminPolicyStatus - BlueZ D-Bus AdminPolicyStatus API documentation

## DESCRIPTION
Interface AdminPolicyStatus1 provides readonly properties to indicate the current values of admin policy affecting the Adapter and Device objects.

## INTERFACE

### Adapter
Service

org.bluez

Interface

org.bluez.AdminPolicyStatus1 [experimental]

Object path

[variable prefix]/{hci0,hci1,...}

### Device
Service

org.bluez

Interface

org.bluez.AdminPolicyStatus1 [experimental]

Object path

[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

### array{string} ServiceAllowList [readonly, adapter-only]
Current value of service allow list.

### bool IsAffectedByPolicy [readonly, device-only]
Indicate if there is any auto-connect profile in this device is not allowed by admin policy.


org.bluez.AdvertisementMonitor

title: org.bluez.AdvertisementMonitor(5)

text:
# org.bluez.AdvertisementMonitor(5)

## NAME
org.bluez.AdvertisementMonitor - BlueZ D-Bus AdvertisementMonitor API documentation

## DESCRIPTION
This API allows an client to specify a job of monitoring advertisements by registering the root of hierarchy and then exposing advertisement monitors under the root with filtering conditions, thresholds of RSSI and timers of RSSI thresholds.

Once a monitoring job is activated by bluetoothd(8), the client can expect to get notified on the targeted advertisements no matter if there is an ongoing discovery session (see StartDiscovery() in org.bluez.Adapter(5)).

## INTERFACE
Service

org.bluez

Interface

org.bluez.AdvertisementMonitor1 [experimental]

Object path

freely definable

### void Release() [noreply]
This gets called as a signal for a client to perform clean-up when:

- Monitor cannot be activated after it was exposed

- Monitor has been deactivated.

### void Activate() [noreply]
After a monitor was exposed, this gets called as a signal for client to get acknowledged when a monitor has been activated, so the client can expect to receive calls on DeviceFound() or DeviceLost().

### void DeviceFound(object device) [noreply]
This gets called to notify the client of finding the targeted device. Once receiving the call, the client should start to monitor the corresponding device to retrieve the changes on RSSI and advertisement content.

### void DeviceLost(object device) [noreply]
This gets called to notify the client of losing the targeted device. Once receiving this call, the client should stop monitoring the corresponding device.

### string Type [read-only]
The type of the monitor. See SupportedMonitorTypes in org.bluez.AdvertisementMonitorManager(5) for the available options.

### int16 RSSILowThreshold [read-only, optional]
Used in conjunction with RSSILowTimeout to determine whether a device becomes out-of-range. Valid range is -127 to 20 (dBm), while 127 indicates unset.

### int16 RSSIHighThreshold [read-only, optional]
Used in conjunction with RSSIHighTimeout to determine whether a device becomes in-range. Valid range is -127 to 20 (dBm), while 127 indicates unset.

### uint16 RSSILowTimeout [read-only, optional]
The time it takes to consider a device as out-of-range. If this many seconds elapses without receiving any signal at least as strong as RSSILowThreshold, a currently in-range device will be considered as out-of-range (lost). Valid range is 1 to 300 (seconds), while 0 indicates unset.

### uint16 RSSIHighTimeout [read-only, optional]
The time it takes to consider a device as in-range. If this many seconds elapses while we continuouslyreceive signals at least as strong as RSSIHighThreshold, a currently out-of-range device will be considered as in-range (found). Valid range is 1 to 300 (seconds), while 0 indicates unset.

### uint16 RSSISamplingPeriod [read-only, optional]
Grouping rules on how to propagate the received advertisement packets to the client. Possible values:

0

All advertisement packets from in-range devices would be propagated.

255

Only the first advertisement packet of in-range devices would be propagated. If the device becomes lost, then the first packet when it is found again will also be propagated.

1 to 254

Advertisement packets would be grouped into 100ms * N time period. Packets in the same group will only be reported once, with the RSSI value being averaged out.

Currently this is unimplemented in user space, so the value is only used to be forwarded to the kernel.

### array{(uint8, uint8, array{byte})} Patterns [read-only, optional]
If the Type property is set to "or_patterns", then this property must exist and have at least one entry in the array. The structure of a pattern contains the following:

uint8 start_position

The index in an AD data field where the search hould start. The beginning of an AD data field is index 0.

uint8 AD_data_type

See https://www.bluetooth.com/specifications/assigned-numbers/ generic-access-profile/ for the possible allowed value.

array{byte} content_of_pattern

This is the value of the pattern. The maximum length of the bytes is 31.


org.bluez.AdvertisementMonitorManager

text:
# org.bluez.AdvertisementMonitorManager(5)

## NAME
org.bluez.AdvertisementMonitorManager - BlueZ D-Bus AdvertisementMonitorManager API documentation

## INTERFACE
Service

org.bluez

Interface

org.bluez.AdvertisementMonitorManager1 [experimental]

Object path

/org/bluez/{hci0,hci1,...}

### void RegisterMonitor(object application)
Registers the root path of a hierarchy of advertisement monitors implementing org.bluez.AdvertisementMonitor(5). The application object path together with the D-Bus ystem bus connection ID define the identification of the application registering advertisement monitors.

Once a root path is registered by a client via this method, the client can freely expose/unexpose advertisement monitors without re-registering the root path again. After use, the client should call UnregisterMonitor() method to invalidate the advertisement monitors.

Possible errors:

org.bluez.Error.InvalidArguments

org.bluez.Error.AlreadyExists

org.bluez.Error.Failed

### void UnregisterMonitor(object application)
Unregisters a hierarchy of advertisement monitors that has been previously registered with RegisterMonitor(). The object path parameter must match the same value that has been used on registration. Upon unregistration, the advertisement monitor(s) should expect to receive Release() method as the signal that the advertisement monitor(s) has been deactivated.

Possible errors:

org.bluez.Error.InvalidArguments

org.bluez.Error.DoesNotExist

### array{string} SupportedMonitorTypes [read-only]
This lists the supported types of advertisement monitors. An application should check this before instantiate and expose an object of org.bluez.AdvertisementMonitor(5). Possible values:

or_patterns

Patterns with logic OR applied. With this type, property Patterns must exist and has at least one pattern.

### array{string} SupportedFeatures [read-only]
This lists the features of advertisement monitoring supported by bluetoothd(8). Possible values:

controller-patterns

If the controller is capable of performing advertisement monitoring by patterns, bluetoothd(8) would offload the patterns to the controller to reduce power consumption.


org.bluez.Agent

title: org.bluez.Agent(5)

summary: BlueZ D-Bus Agent API documentation

text:
# org.bluez.Agent(5)

## NAME
org.bluez.Agent - BlueZ D-Bus Agent API documentation

## INTERFACE
Service

unique name

Interface

org.bluez.Agent1

Object path

freely definable

### void Release()
This method gets called when the service daemon unregisters the agent. An agent can use it to do cleanup tasks. There is no need to unregister the agent, because when this method gets called it has already been unregistered.

### string RequestPinCode(object device)
This method gets called when the service daemon needs to get the passkey for an authentication. The return value should be a string of 1-16 characters length. The string can be alphanumeric.

Possible errors:

org.bluez.Error.Rejected

org.bluez.Error.Canceled

### void DisplayPinCode(object device, string pincode)
This method gets called when the service daemon needs to display a pincode for an authentication. An empty reply should be returned. When the pincode needs no longer to be displayed, the Cancel method of the agent will be called.

This is used during the pairing process of keyboards that don't support Bluetooth 2.1 Secure Simple Pairing, in contrast to DisplayPasskey which is used for those that do.

This method will only ever be called once since older keyboards do not support typing notification.

Note that the PIN will always be a 6-digit number, zero-padded to 6 digits. This is for harmony with the later specification.

Possible errors:

org.bluez.Error.Rejected

org.bluez.Error.Canceled

### uint32 RequestPasskey(object device)
This method gets called when the service daemon needs to get the passkey for an authentication. The return value should be a numeric value between 0-999999.

Possible errors:

org.bluez.Error.Rejected

org.bluez.Error.Canceled

### void DisplayPasskey(object device, uint32 passkey, uint16 entered)
This method gets called when the service daemon needs to display a passkey for an authentication. The entered parameter indicates the number of already typed keys on the remote side.

An empty reply should be returned. When the passkey needs no longer to be displayed, the Cancel method of the agent will be called.

During the pairing process this method might be called multiple times to update the entered value.

Note that the passkey will always be a 6-digit number, so the display should be zero-padded at the start if the value contains less than 6 digits.

### void RequestConfirmation(object device, uint32 passkey)
This method gets called when the service daemon needs to confirm a passkey for an authentication. To confirm the value it should return an empty reply or an error in case the passkey is invalid.

Note that the passkey will always be a 6-digit number, so the display should be zero-padded at the start if the value contains less than 6 digits.

Possible errors:

org.bluez.Error.Rejected

org.bluez.Error.Canceled

### void RequestAuthorization(object device)
This method gets called to request the user to authorize an incoming pairing attempt which would in other circumstances trigger the just-works model, or when the user plugged in a device that implements cable pairing. In the latter case, the device would not be connected to the adapter via Bluetooth yet. Possible errors:

org.bluez.Error.Rejected

org.bluez.Error.Canceled

### void AuthorizeService(object device, string uuid)
This method gets called when the service daemon needs to authorize a connection/service request. Possible errors:

org.bluez.Error.Rejected

org.bluez.Error.Canceled

### void Cancel()
This method gets called to indicate that the agent request failed before a reply was returned.


org.bluez.AgentManager

title: org.bluez.AgentManager(5)

text:
# org.bluez.AgentManager(5)

## NAME
org.bluez.AgentManager - BlueZ D-Bus AgentManager API documentation

## INTERFACE
Service

org.bluez

Interface

org.bluez.AgentManager1

Object path

/org/bluez

### void RegisterAgent(object agent, string capability)
Registers pairing agent. The object path defines the path of the agent that will be called when user input is needed and must implement org.bluez.Agent(5) interface.

Every application can register its own agent and for all actions triggered by that application its agent is used.

It is not required by an application to register an agent. If an application does chooses to not register an agent, the default agent is used. This is on most cases a good idea. Only application like a pairing wizard should register their own agent.

An application can only register one agent. Multiple agents per application is not supported.

Possible capability values:

Fallback to "KeyboardDisplay".

DisplayOnly

DisplayYesNo

KeyboardOnly

NoInputNoOutput

KeyboardDisplay

Possible errors:

org.bluez.Error.InvalidArguments

org.bluez.Error.AlreadyExists

### void UnregisterAgent(object agent)
Unregisters an agent that has been previously registered using RegisterAgent. The object path parameter must match the same value that has been used on registration. Possible errors:

org.bluez.Error.DoesNotExist

### void RequestDefaultAgent(object agent)
Requests to make the application agent the default agent. The application is required to register an agent. Special permission might be required to become the default agent.

Possible errors:

org.bluez.Error.DoesNotExist


org.bluez.Battery

title: org.bluez.Battery(5)

summary: BlueZ D-Bus Battery API documentation

text:
# org.bluez.Battery(5)

## NAME
org.bluez.Battery - BlueZ D-Bus Battery API documentation

## INTERFACE
Service

org.bluez

Interface

org.bluez.Battery1

Object path

[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

### byte Percentage [readonly]
The percentage of battery left as an unsigned 8-bit integer.

### string Source [readonly, optional]
Describes where the battery information comes from. This property is informational only and may be useful for debugging purposes.

Providers from org.bluez.BatteryProvider(5) may make use of this property to indicate where the battery report comes from (e.g. "HFP 1.7", "HID", or the profile UUID).


org.bluez.BatteryProvider

title: org.bluez.BatteryProvider(5)

text:
# org.bluez.BatteryProvider(5)

## NAME
org.bluez.BatteryProvider - BlueZ D-Bus BatteryProvider API documentation

## INTERFACE
Service

<client D-Bus address>

Interface

org.bluez.BatteryProvider1

Object path

{provider_root}/{unique battery object path}

### Properties
Objects provided on this interface contain the same properties as org.bluez.Battery(5) interface. Additionally, this interface needs to have the Device property indicating the object path of the device this battery provides.

### object Device [readonly]
The object path of the device that has this battery.


org.bluez.BatteryProviderManager

title: org.bluez.BatteryProviderManager(5)

text:
# org.bluez.BatteryProviderManager(5)

## NAME
org.bluez.BatteryProviderManager - BlueZ D-Bus BatteryProviderManager API documentation

## DESCRIPTION
A battery provider starts by registering itself as a battery provider with the RegisterBatteryProvider() method passing an object path as the provider ID. Then, it can start exposing org.bluez.BatteryProvider(5) objects having the path starting with the given provider ID. It can also remove objects at any time. The objects and their properties exposed by battery providers will be reflected on org.bluez.Battery(5) interface.

bluetoothd(8) will stop monitoring these exposed and removed objects after UnregisterBatteryProvider is called for that provider ID.

## INTERFACE
Service

org.bluez

Interface

org.bluez.BatteryProviderManager1

Object path

/org/bluez/{hci0,hci1,...}

### void RegisterBatteryProvider(object provider)
Registers a battery provider. A registered battery provider can then expose objects with org.bluez.BatteryProvider(5) interface.

### void UnregisterBatteryProvider(object provider)
Unregisters a battery provider previously registered with RegisterBatteryProvider(). After unregistration, the org.bluez.BatteryProvider(5) objects provided by this client are ignored by bluetoothd(8).


org.bluez.Device

title: org.bluez.Device(5)

summary: BlueZ D-Bus Device API documentation

text:
# org.bluez.Device(5)

## NAME
org.bluez.Device - BlueZ D-Bus Device API documentation

## INTERFACE
Service

org.bluez

Interface

org.bluez.Device1

Object path

[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

### void Connect()
Connects all profiles the remote device supports that can be connected to and have been flagged as auto-connectable. If only subset of profiles is already connected it will try to connect currently disconnected ones. If at least one profile was connected successfully this method will indicate success.

For dual-mode devices only one bearer is connected at time, the conditions are in the following order:

1.

Connect the disconnected bearer if already connected.

2. Connect first the bonded bearer. If no bearers are bonded or both are skip and check latest seen bearer.

3. Connect last seen bearer, in case the timestamps are the same BR/EDR takes precedence, or in case PreferredBearer has been set to a specific bearer then that is used instead.

Possible errors:

org.bluez.Error.NotReady

org.bluez.Error.Failed

org.bluez.Error.InProgress

org.bluez.Error.AlreadyConnected

### void Disconnect()
Disconnects all connected profiles and then terminates low-level ACL connection. ACL connection will be terminated even if some profiles were not disconnected properly e.g. due to misbehaving device.

This method can be also used to cancel a preceding Connect call before a reply to it has been received.

For non-trusted devices connected over LE bearer calling this method will disable incoming connections until Connect method is called again.

Possible errors:

org.bluez.Error.NotConnected

### void ConnectProfile(string uuid)
Connects a specific profile of this device. The UUID provided is the remote service UUID for the profile. Possible errors:

org.bluez.Error.Failed

org.bluez.Error.InProgress

org.bluez.Error.InvalidArguments

org.bluez.Error.NotAvailable

org.bluez.Error.NotReady

### void DisconnectProfile(string uuid)
Disconnects a specific profile of this device. The profile needs to be registered client profile. There is no connection tracking for a profile, so as long as the profile is registered this will always succeed.

Possible errors:

org.bluez.Error.Failed

org.bluez.Error.InProgress

org.bluez.Error.InvalidArguments

org.bluez.Error.NotSupported

### void Pair()
Connects to the remote device and initiate pairing procedure then proceed with service discovery. If the application has registered its own agent, then that specific agent will be used. Otherwise it will use the default agent.

Only for applications like a pairing wizard it would make sense to have its own agent. In almost all other cases the default agent will handle this just fine.

In case there is no application agent and also no default agent present, this method will fail.

Possible errors:

org.bluez.Error.InvalidArguments

org.bluez.Error.Failed

org.bluez.Error.AlreadyExists

org.bluez.Error.AuthenticationCanceled

org.bluez.Error.AuthenticationFailed

org.bluez.Error.AuthenticationRejected

org.bluez.Error.AuthenticationTimeout

org.bluez.Error.ConnectionAttemptFailed

### void CancelPairing()
Cancels a pairing operation initiated by the Pair method. Possible errors:

org.bluez.Error.DoesNotExist

org.bluez.Error.Failed

### array{array{byte}} GetServiceRecords() [experimental]
Returns all currently known BR/EDR service records for the device. Each individual byte array represents a raw SDP record, as defined by the Bluetooth Service Discovery Protocol specification. This method is intended to be only used by compatibility layers like Wine, that need to provide access to raw SDP records to support foreign Bluetooth APIs. General applications should instead use the Profile API for services-related functionality.

Possible errors:

org.bluez.Error.Failed

org.bluez.Error.NotReady

org.bluez.Error.NotConnected

org.bluez.Error.DoesNotExist

### void Disconnected(string reason, string message)
This signal is launched when a device is disconnected, with the reason of the disconnection. This could be used by client application, depending on internal policy, to try to reconnect to the device in case of timeout or unknown disconnection, or to try to connect to another device.

Possible reasons:

org.bluez.Reason.Unknown

org.bluez.Reason.Timeout

Connection timeout. The link supervision timeout has expired for a connection or the synchronization timeout has expired for a broadcast.

org.bluez.Reason.Local

Connection terminated by local host. The local device terminated the connection, terminated synchronization with a broadcaster, or terminated broadcasting packets.

org.bluez.Reason.Remote

Connection terminated by remote host. This disconnection can be due to: - the user on the remote device either terminated the connection or stopped broadcasting packets, - the remote device terminated the connection because of low resources, - the remote device terminated the connection because the device is about to power off.

org.bluez.Reason.Authentication

Connection terminated due to an authentication failure.

org.bluez.Reason.Suspend

Connection terminated by local host for suspend.

### string Address [readonly]
The Bluetooth device address of the remote device.

### string AddressType [readonly]
The Bluetooth device Address Type. For dual-mode and BR/EDR only devices this defaults to "public". Single mode LE devices may have either value. If remote device uses privacy than before pairing this represents address type used for connection and Identity Address after pairing. Possible values:

public

Public address

random

Random address

### string Name [readonly, optional]
The Bluetooth remote name. This value is only present for completeness. It is better to always use the Alias property when displaying the devices name.

If the Alias property is unset, it will reflect this value which makes it more convenient.

### string Icon [readonly, optional]
Proposed icon name according to the freedesktop.org icon naming specification.

### uint32 Class [readonly, optional]
The Bluetooth class of device of the remote device.

### uint16 Appearance [readonly, optional]
External appearance of device, as found on GAP service.

### array{string} UUIDs [readonly, optional]
List of 128-bit UUIDs that represents the available remote services.

### boolean Paired [readonly]
Indicates if the remote device is paired. Paired means the pairing process where devices exchange the information to establish an encrypted connection has been completed.

### boolean Bonded [readonly]
Indicates if the remote device is bonded. Bonded means the information exchanged on pairing process has been stored and will be persisted.

### boolean Connected [readonly]
Indicates if the remote device is currently connected. A PropertiesChanged signal indicate changes to this status.

### boolean Trusted [readwrite]
Indicates if the remote is seen as trusted. This setting can be changed by the application.

### boolean Blocked [readwrite]
If set to true any incoming connections from the device will be immediately rejected. Any device drivers will also be removed and no new ones will be probed as long as the device is blocked.

### boolean WakeAllowed [readwrite]
If set to true this device will be allowed to wake the host from system suspend.

### string Alias [readwrite]
The name alias for the remote device. The alias can be used to have a different friendly name for the remote device. In case no alias is set, it will return the remote device name. Setting an empty string as alias will convert it back to the remote device name.

When resetting the alias with an empty string, the property will default back to the remote name.

### object Adapter [readonly]
The object path of the adapter the device belongs to.

### boolean LegacyPairing [readonly]
Set to true if the device only supports the pre-2.1 pairing mechanism. This property is useful during device discovery to anticipate whether legacy or simple pairing will occur if pairing is initiated. Note that this property can exhibit false-positives in the case of Bluetooth 2.1 (or newer) devices that have disabled Extended Inquiry Response support.

### boolean CablePairing [readonly]
Set to true if the device was cable paired and it doesn't support the canonical bonding with encryption, e.g. the Sixaxis gamepad. If true, BlueZ will establish a connection without enforcing encryption.

### string Modalias [readonly, optional]
Remote Device ID information in modalias format used by the kernel and udev.

### int16 RSSI [readonly, optional]
Received Signal Strength Indicator of the remote device (inquiry or advertising).

### int16 TxPower [readonly, optional]
Advertised transmitted power level (inquiry or advertising).

### dict ManufacturerData [readonly, optional]
Manufacturer specific advertisement data. Keys are 16 bits Manufacturer ID followed by its byte array value.

### dict ServiceData [readonly, optional]
Service advertisement data. Keys are the UUIDs in string format followed by its byte array value.

### bool ServicesResolved [readonly]
Indicate whether or not service discovery has been resolved.

### array{byte} AdvertisingFlags [readonly]
The Advertising Data Flags of the remote device.

### dict AdvertisingData [readonly]
The Advertising Data of the remote device. Keys are 1 byte AD Type followed by data as byte array. Note: Only types considered safe to be handled by application are exposed.

Possible values:

<type>

<byte array>

Example:

<Transport Discovery> <Organization Flags...> 0x26 0x01 0x01...

### array{object, dict} Sets [readonly, experimental]
The object paths of the sets the device belongs to followed by a dictionary which can contain the following: byte Rank

Rank of the device in the Set.

### string PreferredBearer [readwrite, optional, experimental]
Indicate the preferred bearer when initiating a connection, only available for dual-mode devices. When changing from "bredr" to "le" the device will be removed from the 'auto-connect' list so it won't automatically be connected when adverting.

Note: Changes only take effect when the device is disconnected.

Possible values:

last-used

Connect to last used bearer first. Default.

bredr

Connect to BR/EDR first.

le

Connect to LE first.

last-seen

Connect to last seen bearer first.


org.bluez.DeviceSet

title: org.bluez.DeviceSet(5)

summary: BlueZ D-Bus DeviceSet API documentation

text:
# org.bluez.DeviceSet(5)

## NAME
org.bluez.DeviceSet - BlueZ D-Bus DeviceSet API documentation

## INTERFACE
Service

org.bluez

Interface

org.bluez.DeviceSet1

Object path

[variable prefix]/{hci0,hci1,...}/set_{sirk}

### void Connect() [experimental]
Connects all devices members of the set, each member is connected in sequence as they were added/loaded following the same proceedure as described in Device1.Connect. Possible errors:

org.bluez.Error.NotReady

org.bluez.Error.Failed

org.bluez.Error.InProgress

org.bluez.Error.AlreadyConnected

### void Disconnect() [experimental]
Disconnects all devices members of the set, each member is disconnected in sequence as they were connected following the same proceedure as described in Device1.Disconnect. Possible errors:

org.bluez.Error.NotConnected

### object Adapter [readonly, experimental]
The object path of the adapter the set belongs to.

### bool AutoConnect [read-write, experimental]
Indicates if the devices members of the set shall be automatically connected once any of its members is connected.

### array(object) Devices [ready-only, experimental]
List of devices objects that are members of the set.

### byte Size [read-only, experimental]
Set members size.


org.bluez.GattCharacteristic

title: org.bluez.GattCharacteristic(5)

text:
# org.bluez.GattCharacteristic(5)

## NAME
org.bluez.GattCharacteristic - BlueZ D-Bus GattCharacteristic API documentation

## DESCRIPTION
GATT local/server and remote/client characteristic attribute representation share the same high-level D-Bus API.

Local/Server refers to GATT based characteristics exported by a plugin or an external application.

Remote/Client refers to GATT characteristics exported by the peer.

## INTERFACE

### Client
Service

org.bluez

Interface

org.bluez.GattCharacteristic1

Object path

[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY

### Server
Service

unique name

Interface

org.bluez.GattCharacteristic1

Object path

freely definable

### array{byte} ReadValue(dict options)
Issues a request to read the value of the characteristic and returns the value if the operation was successful. Possible options:

uint16 offset

Read start offset in bytes.

uint16 mtu (server only)

Exchange MTU in bytes.

object device (server only)

Device object.

string link (server only)

Link type. Possible values:

BR/EDR

LE

Possible Errors:

org.bluez.Error.Failed

Possible values: string 0x80 - 0x9f

org.bluez.Error.InProgress

org.bluez.Error.NotPermitted

org.bluez.Error.NotAuthorized

org.bluez.Error.InvalidOffset

org.bluez.Error.NotSupported

### void WriteValue(array{byte} value, dict options)
Issues a request to write the value of the characteristic. Possible options:

uint16 offset

Write start offset in bytes.

string type

Possible values:

command

Use Write without response procedure.

request

Use Write with response procedure.

reliable

Use Reliable Write procedure.

uint16 mtu

Exchanged MTU (Server only).

object device

Device path (Server only).

string link

Link type (Server only). Possible values:

BR/EDR

LE

boolean prepare-authorize

True if prepare authorization request.

Possible Errors:

org.bluez.Error.Failed

Possible values: string 0x80 - 0x9f

org.bluez.Error.InProgress

org.bluez.Error.NotPermitted

org.bluez.Error.InvalidValueLength

org.bluez.Error.NotAuthorized

org.bluez.Error.NotSupported

org.bluez.Error.ImproperlyConfigured

### fd, uint16 AcquireWrite(dict options) [optional]
Acquire file descriptor and MTU for writing. Only sockets are supported. Usage of WriteValue will be locked causing it to return NotPermitted error. For server the MTU returned shall be equal or smaller than the negotiated MTU.

For client it only works with characteristic that has WriteAcquired property which relies on write-without-response Flag.

To release the lock the client shall close the file descriptor, a HUP is generated in case the device is disconnected.

Note: the MTU can only be negotiated once and is symmetric therefore this method may be delayed in order to have the exchange MTU completed, because of that the file descriptor is closed during reconnections as the MTU has to be renegotiated.

Possible options:

object device

Object Device (Server only).

uint16 mtu

Exchanged MTU (Server only).

string link

Link type (Server only). Possible values:

BR/EDR

LE

Possible Errors:

org.bluez.Error.Failed

org.bluez.Error.NotSupported

### fd, uint16 AcquireNotify(dict options) [optional]
Acquire file descriptor and MTU for notify. Only sockets are support. Usage of StartNotify will be locked causing it to return org.bluez.Error.NotPermitted.

For server the MTU returned shall be equal or smaller than the negotiated MTU.

Only works with characteristic that has NotifyAcquired property which relies on presence of "notify" or "indicate" Flag and no other client have called StartNotify().

Notification are enabled during this procedure so StartNotify() shall not be called, any notification will be dispatched via file descriptor therefore the Value property is not affected during the time where notify has been acquired.

To release the lock the client shall close the file descriptor, a HUP is generated in case the device is disconnected.

As a client if indication procedure is used the confirmation is generated automatically once received, for a server if the file descriptor is writable (POLLOUT) then upon receiving a confirmation from the client one byte (0x01) is written to the file descriptor.

Note: the MTU can only be negotiated once and is symmetric therefore this method may be delayed in order to have the exchange MTU completed, because of that the file descriptor is closed during reconnections as the MTU has to be renegotiated.

Possible options:

object device

Object Device (Server only).

uint16 mtu

Exchanged MTU (Server only).

string link

Link type (Server only). Possible values:

BR/EDR

LE

Possible Errors:

org.bluez.Error.Failed

org.bluez.Error.NotSupported

org.bluez.Error.NotPermitted

### void StartNotify()
Starts a notification session from this characteristic if it supports value notifications or indications. Possible Errors:

org.bluez.Error.Failed

org.bluez.Error.NotPermitted

org.bluez.Error.InProgress

org.bluez.Error.NotConnected

org.bluez.Error.NotSupported

### void StopNotify()
Stops or cancel session previously created by StartNotify(). Note that notifications from a characteristic are shared between sessions thus calling StopNotify will release a single session.

Possible Errors:

org.bluez.Error.Failed

### void Confirm() [noreply, optional] (Server only)
Confirms value was received. Possible Errors:

org.bluez.Error.Failed

### string UUID [read-only]
128-bit characteristic UUID.

### object Service [read-only]
Object path of the GATT service the characteristic belongs to.

### array{byte} Value [read-only, optional]
The cached value of the characteristic. This property gets updated only after a successful read request and when a notification or indication is received, upon which a PropertiesChanged signal will be emitted.

### boolean WriteAcquired [read-only, optional]
True, if this characteristic has been acquired by any client using AcquireWrite. For client properties is ommited in case 'write-without-response' flag is not set.

For server the presence of this property indicates that AcquireWrite is supported.

### boolean NotifyAcquired [read-only, optional]
True, if this characteristic has been acquired by any client using AcquireNotify. For client this properties is ommited in case 'notify' flag is not set.

For server the presence of this property indicates that AcquireNotify is supported.

### boolean Notifying [read-only, optional]
True, if notifications or indications on this characteristic are currently enabled.

### array{string} Flags [read-only]
Defines how the characteristic value can be used. See Core spec "Table 3.5: Characteristic Properties bit field", and "Table 3.8: Characteristic Extended Properties bit field". The "x-notify" and "x-indicate" flags restrict access to notifications and indications by imposing write restrictions on a characteristic's client characteristic configuration descriptor.

Possible values:

broadcast

read

write-without-response

write

notify

indicate

authenticated-signed-writes

extended-properties

reliable-write

writable-auxiliaries

encrypt-read

encrypt-write

encrypt-notify (Server only)

encrypt-indicate (Server only)

encrypt-authenticated-read

encrypt-authenticated-write

encrypt-authenticated-notify (Server only)

encrypt-authenticated-indicate (Server only)

secure-read (Server only)

secure-write (Server only)

secure-notify (Server only)

secure-indicate (Server only)

authorize

### uint16 Handle [read-only] (Client Only)
Characteristic handle.

### uint16 Handle [read-write, optional] (Server Only)
Characteristic handle. When available in the server it would attempt to use to allocate into the database which may fail, to auto allocate the value 0x0000 shall be used which will cause the allocated handle to be set once registered.

### uint16 MTU [read-only]
Characteristic MTU, this is valid both for ReadValue() and WriteValue() but either method can use long procedures when supported.