The hu.dwim.bluez Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The hu.dwim.bluez Reference Manual

This is the hu.dwim.bluez Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 16:21:28 2021 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

hu.dwim.bluez

What

A Common Lisp FFI for Bluez (aka libbluetooth, a Bluetooth stack for Linux).

Who

Written by attila@lendvai.name.

Where

The primary communication channel is the facilities on the project's GitHub page.

How

The project uses CFFI/C2FFI to automatically generate the CFFI definitions from the C header files.

Status

The entire C side of the Bluez API is available through CFFI.

It works well enough to play around with Bluez even from the Lisp REPL.

The lispy helpers in fancy.lisp may need some more love, but it should be a mundane task. Patches are welcome!

For now it's little-endian only, but it's trivial to fix.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 hu.dwim.bluez

Author

Attila Lendvai

License

BSD or Bugroff

Description

Common Lisp FFI wrapper for libbluetooth, aka Bluez, which is a Linux Bluetooth stack.

Version

0.1

Defsystem Dependency

cffi/c2ffi

Dependencies
Source

hu.dwim.bluez.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

3.1 hu.dwim.bluez/source

Dependencies
Parent

hu.dwim.bluez (system)

Location

source/

Components

Previous: , Up: Modules   [Contents][Index]

3.2 hu.dwim.bluez/c2ffi-spec

Dependencies
Parent

hu.dwim.bluez (system)

Location

c2ffi-spec/

Component

bluez.h (file)


Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 hu.dwim.bluez.asd

Location

hu.dwim.bluez.asd

Systems

hu.dwim.bluez (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 hu.dwim.bluez/package-stage-1.lisp

Parent

hu.dwim.bluez (system)

Location

source/package-stage-1.lisp

Packages

hu.dwim.bluez


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 hu.dwim.bluez/ffi-prelude.lisp

Dependency

package-stage-1.lisp (file)

Parent

hu.dwim.bluez (system)

Location

source/ffi-prelude.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 hu.dwim.bluez/source/package-stage-2.lisp

Parent

source (module)

Location

source/package-stage-2.lisp

Internal Definitions

import-all-owned-symbols (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 hu.dwim.bluez/source/package-stage-3.lisp

Dependency

package-stage-2.lisp (file)

Parent

source (module)

Location

source/package-stage-3.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 hu.dwim.bluez/source/bluez.lisp

Dependency

package-stage-3.lisp (file)

Parent

source (module)

Location

source/bluez.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.7 hu.dwim.bluez/c2ffi-spec/bluez.h

Parent

c2ffi-spec (module)

Location

c2ffi-spec/bluez.h


Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 hu.dwim.bluez

Source

package-stage-1.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Constants

Constant: +eir-device-id+

device ID

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-flags+
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-name-complete+

complete local name

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-name-short+

shortened local name

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-tx-power+

transmit power level

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-uuid128-all+

128-bit UUID, all listed

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-uuid128-some+

128-bit UUID, more available

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-uuid16-all+

16-bit UUID, all listed

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-uuid16-some+

16-bit UUID, more available

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-uuid32-all+

32-bit UUID, all listed

Package

hu.dwim.bluez

Source

bluez.lisp (file)

Constant: +eir-uuid32-some+

32-bit UUID, more available

Package

hu.dwim.bluez

Source

bluez.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Macros

Macro: c-fun/rc FN-NAME &rest ARGS
Package

hu.dwim.bluez

Source

bluez.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Functions

Function: bdaddr->string BDADDR
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: (setf fd-nonblocking-p) ENABLED FD
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: hci-filter/clear FILTER
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: hci-filter/initialize-for-le-scanning FILTER
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: hci-filter/set-event EVENT FILTER
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: hci-filter/set-ptype TYPE FILTER
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: hci/adapter-name DEVICE-ID
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: hci/is-device-le-capable? DEVICE-ID
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: hci/reset-adapter DEVICE-ID
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: parse-extended-inquiry-response EIR EIR-LENGTH
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: string->bdaddr STR BDADDR
Package

hu.dwim.bluez

Source

bluez.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.4 Types

Type: hci/device-id ()
Package

hu.dwim.bluez

Source

bluez.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Symbol macros

Symbol Macro: *errno*
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Expansion

(cffi:mem-ref (hu.dwim.bluez::%errno-location) :int)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Macros

Macro: c-fun FN-NAME &rest ARGS
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Macro: c-ref OBJECT TYPE SLOT
Package

hu.dwim.bluez

Source

bluez.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Functions

Function: %c-fun/rc/check-error RC FN-NAME WHOLE-FORM
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: %errno-location ()
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: %strerror ERRNO
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: copy-sap-to-byte-vector POINTER SIZE
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: ffi-type-transformer TYPE CONTEXT &rest ARGS &key &allow-other-keys
Package

hu.dwim.bluez

Source

ffi-prelude.lisp (file)

Function: hci/bringup-device SOCKET DEVICE-ID
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: hci/shutdown-device SOCKET DEVICE-ID
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: htob/128 VALUE
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: htob/16 VALUE
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: htob/32 VALUE
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: htob/64 VALUE
Package

hu.dwim.bluez

Source

bluez.lisp (file)

Function: import-all-owned-symbols SOURCE-PACKAGE TARGET-PACKAGE &key OVERWRITE
Package

hu.dwim.bluez

Source

package-stage-2.lisp (file)

Function: strerror &optional ERRNO
Package

hu.dwim.bluez

Source

bluez.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.4 Generic functions

Generic Function: error-code-of CONDITION
Generic Function: (setf error-code-of) NEW-VALUE CONDITION
Package

hu.dwim.bluez

Methods
Method: error-code-of (CONDITION hci-error/negative-return-code)
Method: (setf error-code-of) NEW-VALUE (CONDITION hci-error/negative-return-code)
Source

ffi-prelude.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.5 Conditions

Condition: bluez-error ()
Package

hu.dwim.bluez

Source

ffi-prelude.lisp (file)

Direct superclasses

error (condition)

Direct subclasses

hci-error (condition)

Condition: hci-error ()
Package

hu.dwim.bluez

Source

ffi-prelude.lisp (file)

Direct superclasses

bluez-error (condition)

Direct subclasses

hci-error/negative-return-code (condition)

Condition: hci-error/negative-return-code ()
Package

hu.dwim.bluez

Source

ffi-prelude.lisp (file)

Direct superclasses
  • hci-error (condition)
  • simple-error (condition)
Direct methods
Direct slots
Slot: error-code
Initargs

:error-code

Initform

(quote (error "must specify error-code."))

Readers

error-code-of (generic function)

Writers

(setf error-code-of) (generic function)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.6 Classes

Class: hci-return-code ()
Package

hu.dwim.bluez

Source

ffi-prelude.lisp (file)

Direct superclasses

foreign-type-alias (class)

Direct methods

expand-from-foreign (method)

Direct Default Initargs
InitargValue
:actual-type(cffi::parse-type :int)

Previous: , Up: Internal definitions   [Contents][Index]

6.2.7 Types

Type: fd ()
Package

hu.dwim.bluez

Source

bluez.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   H   L   M  
Index Entry  Section

F
File, Lisp, hu.dwim.bluez.asd: The hu․dwim․bluez․asd file
File, Lisp, hu.dwim.bluez/c2ffi-spec/bluez.h: The hu․dwim․bluez/c2ffi-spec/bluez․h file
File, Lisp, hu.dwim.bluez/ffi-prelude.lisp: The hu․dwim․bluez/ffi-prelude․lisp file
File, Lisp, hu.dwim.bluez/package-stage-1.lisp: The hu․dwim․bluez/package-stage-1․lisp file
File, Lisp, hu.dwim.bluez/source/bluez.lisp: The hu․dwim․bluez/source/bluez․lisp file
File, Lisp, hu.dwim.bluez/source/package-stage-2.lisp: The hu․dwim․bluez/source/package-stage-2․lisp file
File, Lisp, hu.dwim.bluez/source/package-stage-3.lisp: The hu․dwim․bluez/source/package-stage-3․lisp file

H
hu.dwim.bluez.asd: The hu․dwim․bluez․asd file
hu.dwim.bluez/c2ffi-spec: The hu․dwim․bluez/c2ffi-spec module
hu.dwim.bluez/c2ffi-spec/bluez.h: The hu․dwim․bluez/c2ffi-spec/bluez․h file
hu.dwim.bluez/ffi-prelude.lisp: The hu․dwim․bluez/ffi-prelude․lisp file
hu.dwim.bluez/package-stage-1.lisp: The hu․dwim․bluez/package-stage-1․lisp file
hu.dwim.bluez/source: The hu․dwim․bluez/source module
hu.dwim.bluez/source/bluez.lisp: The hu․dwim․bluez/source/bluez․lisp file
hu.dwim.bluez/source/package-stage-2.lisp: The hu․dwim․bluez/source/package-stage-2․lisp file
hu.dwim.bluez/source/package-stage-3.lisp: The hu․dwim․bluez/source/package-stage-3․lisp file

L
Lisp File, hu.dwim.bluez.asd: The hu․dwim․bluez․asd file
Lisp File, hu.dwim.bluez/c2ffi-spec/bluez.h: The hu․dwim․bluez/c2ffi-spec/bluez․h file
Lisp File, hu.dwim.bluez/ffi-prelude.lisp: The hu․dwim․bluez/ffi-prelude․lisp file
Lisp File, hu.dwim.bluez/package-stage-1.lisp: The hu․dwim․bluez/package-stage-1․lisp file
Lisp File, hu.dwim.bluez/source/bluez.lisp: The hu․dwim․bluez/source/bluez․lisp file
Lisp File, hu.dwim.bluez/source/package-stage-2.lisp: The hu․dwim․bluez/source/package-stage-2․lisp file
Lisp File, hu.dwim.bluez/source/package-stage-3.lisp: The hu․dwim․bluez/source/package-stage-3․lisp file

M
Module, hu.dwim.bluez/c2ffi-spec: The hu․dwim․bluez/c2ffi-spec module
Module, hu.dwim.bluez/source: The hu․dwim․bluez/source module

Jump to:   F   H   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %   (  
B   C   E   F   G   H   I   M   P   S  
Index Entry  Section

%
%c-fun/rc/check-error: Internal functions
%errno-location: Internal functions
%strerror: Internal functions

(
(setf error-code-of): Internal generic functions
(setf error-code-of): Internal generic functions
(setf fd-nonblocking-p): Exported functions

B
bdaddr->string: Exported functions

C
c-fun: Internal macros
c-fun/rc: Exported macros
c-ref: Internal macros
copy-sap-to-byte-vector: Internal functions

E
error-code-of: Internal generic functions
error-code-of: Internal generic functions

F
ffi-type-transformer: Internal functions
Function, %c-fun/rc/check-error: Internal functions
Function, %errno-location: Internal functions
Function, %strerror: Internal functions
Function, (setf fd-nonblocking-p): Exported functions
Function, bdaddr->string: Exported functions
Function, copy-sap-to-byte-vector: Internal functions
Function, ffi-type-transformer: Internal functions
Function, hci-filter/clear: Exported functions
Function, hci-filter/initialize-for-le-scanning: Exported functions
Function, hci-filter/set-event: Exported functions
Function, hci-filter/set-ptype: Exported functions
Function, hci/adapter-name: Exported functions
Function, hci/bringup-device: Internal functions
Function, hci/is-device-le-capable?: Exported functions
Function, hci/reset-adapter: Exported functions
Function, hci/shutdown-device: Internal functions
Function, htob/128: Internal functions
Function, htob/16: Internal functions
Function, htob/32: Internal functions
Function, htob/64: Internal functions
Function, import-all-owned-symbols: Internal functions
Function, parse-extended-inquiry-response: Exported functions
Function, strerror: Internal functions
Function, string->bdaddr: Exported functions

G
Generic Function, (setf error-code-of): Internal generic functions
Generic Function, error-code-of: Internal generic functions

H
hci-filter/clear: Exported functions
hci-filter/initialize-for-le-scanning: Exported functions
hci-filter/set-event: Exported functions
hci-filter/set-ptype: Exported functions
hci/adapter-name: Exported functions
hci/bringup-device: Internal functions
hci/is-device-le-capable?: Exported functions
hci/reset-adapter: Exported functions
hci/shutdown-device: Internal functions
htob/128: Internal functions
htob/16: Internal functions
htob/32: Internal functions
htob/64: Internal functions

I
import-all-owned-symbols: Internal functions

M
Macro, c-fun: Internal macros
Macro, c-fun/rc: Exported macros
Macro, c-ref: Internal macros
Method, (setf error-code-of): Internal generic functions
Method, error-code-of: Internal generic functions

P
parse-extended-inquiry-response: Exported functions

S
strerror: Internal functions
string->bdaddr: Exported functions

Jump to:   %   (  
B   C   E   F   G   H   I   M   P   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
C   E   S  
Index Entry  Section

*
*errno*: Internal symbol macros

+
+eir-device-id+: Exported constants
+eir-flags+: Exported constants
+eir-name-complete+: Exported constants
+eir-name-short+: Exported constants
+eir-tx-power+: Exported constants
+eir-uuid128-all+: Exported constants
+eir-uuid128-some+: Exported constants
+eir-uuid16-all+: Exported constants
+eir-uuid16-some+: Exported constants
+eir-uuid32-all+: Exported constants
+eir-uuid32-some+: Exported constants

C
Constant, +eir-device-id+: Exported constants
Constant, +eir-flags+: Exported constants
Constant, +eir-name-complete+: Exported constants
Constant, +eir-name-short+: Exported constants
Constant, +eir-tx-power+: Exported constants
Constant, +eir-uuid128-all+: Exported constants
Constant, +eir-uuid128-some+: Exported constants
Constant, +eir-uuid16-all+: Exported constants
Constant, +eir-uuid16-some+: Exported constants
Constant, +eir-uuid32-all+: Exported constants
Constant, +eir-uuid32-some+: Exported constants

E
error-code: Internal conditions

S
Slot, error-code: Internal conditions
Symbol Macro, *errno*: Internal symbol macros

Jump to:   *   +  
C   E   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   B   C   F   H   P   S   T  
Index Entry  Section

B
bluez-error: Internal conditions

C
Class, hci-return-code: Internal classes
Condition, bluez-error: Internal conditions
Condition, hci-error: Internal conditions
Condition, hci-error/negative-return-code: Internal conditions

F
fd: Internal types

H
hci-error: Internal conditions
hci-error/negative-return-code: Internal conditions
hci-return-code: Internal classes
hci/device-id: Exported types
hu.dwim.bluez: The hu․dwim․bluez system
hu.dwim.bluez: The hu․dwim․bluez package

P
Package, hu.dwim.bluez: The hu․dwim․bluez package

S
System, hu.dwim.bluez: The hu․dwim․bluez system

T
Type, fd: Internal types
Type, hci/device-id: Exported types

Jump to:   B   C   F   H   P   S   T