---
name: "brlapi_raw"
section: "3"
platform: "linux"
package: "libbrlapi1-dev"
version: "3.7.2-7.1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/brlapi_raw"
---

# brlapi\_raw(3)

Raw Mode mechanism.

## NAME

Raw Mode - Raw Mode mechanism.

### Functions

int **brlapi\_getRaw** (const char \*driver)\
 int **brlapi\_leaveRaw** (void)\
 ssize\_t **brlapi\_sendRaw** (const void \*buf, size\_t size)\
 ssize\_t **brlapi\_recvRaw** (void \*buf, size\_t size)\

## Detailed Description

If the application wants to directly talk to the braille terminal, it should use Raw Mode. In this special mode, the driver gives the whole control of the terminal to it: *brltty* doesn't work any more.

For this, it simply has to call **brlapi\_getRaw()**, then **brlapi\_sendRaw()** and **brlapi\_recvRaw()**, and finally give control back thanks to **brlapi\_leaveRaw()**.

Special care of the terminal should be taken, since one might completely trash the terminal's data, or even lock it! The application should always check for terminal's type thanks to **brlapi\_getDriverId()**.

## Function Documentation

### int brlapi\_getRaw (const char \* driver)

Switch to Raw mode

**Parameters:**

*driver* Specifies the name of the driver for which the raw communication will be established.

**Returns:**

0 on success, -1 on error

### int brlapi\_leaveRaw (void)

Leave Raw mode

**Returns:**

0 on success, -1 on error

### ssize\_t brlapi\_recvRaw (void \* buf, size\_t size)

Get a Raw packet

**Parameters:**

*buf* points on a buffer where the function will store the received packet; \
 *size* holds the buffer size.

**Returns:**

its size, -1 on error, or -2 on EOF

### ssize\_t brlapi\_sendRaw (const void \* buf, size\_t size)

Send a Raw Packet

**Parameters:**

*buf* points on the packet; \
 *size* holds the packet size.

**Returns:**

size on success, -1 on error
