Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
direct_bt::HCIComm Class Reference

Read/Write HCI communication channel. More...

#include <HCIComm.hpp>

Collaboration diagram for direct_bt::HCIComm:

Public Member Functions

 HCIComm (const uint16_t dev_id, const uint16_t channel) noexcept
 Constructing a newly opened HCI communication channel instance. More...
 
 HCIComm (const HCIComm &)=delete
 
void operator= (const HCIComm &)=delete
 
 ~HCIComm () noexcept
 Releases this instance after issuing close(). More...
 
void close () noexcept
 Closing the HCI channel, locking mutex_write(). More...
 
bool isOpen () const noexcept
 
int getSocketDescriptor () const noexcept
 Return this HCI socket descriptor. More...
 
std::recursive_mutex & mutex_write () noexcept
 Return the recursive write mutex for multithreading access. More...
 
jau::snsize_t read (uint8_t *buffer, const jau::nsize_t capacity, const int32_t timeoutMS) noexcept
 Generic read w/ own timeoutMS, w/o locking suitable for a unique ringbuffer sink. More...
 
jau::snsize_t write (const uint8_t *buffer, const jau::nsize_t size) noexcept
 Generic write, locking mutex_write(). More...
 

Static Public Member Functions

static void filter_clear (hci_ufilter *f) noexcept
 
static void filter_set_ptype (int t, hci_ufilter *f) noexcept
 
static void filter_clear_ptype (int t, hci_ufilter *f) noexcept
 
static int filter_test_ptype (int t, hci_ufilter *f) noexcept
 
static void filter_all_ptypes (hci_ufilter *f) noexcept
 
static void filter_set_event (int e, hci_ufilter *f) noexcept
 
static void filter_clear_event (int e, hci_ufilter *f) noexcept
 
static int filter_test_event (int e, hci_ufilter *f) noexcept
 
static void filter_all_events (hci_ufilter *f) noexcept
 
static void filter_set_opcode (uint16_t opcode, hci_ufilter *f) noexcept
 
static void filter_clear_opcode (hci_ufilter *f) noexcept
 
static int filter_test_opcode (uint16_t opcode, hci_ufilter *f) noexcept
 

Public Attributes

const uint16_t dev_id
 
const uint16_t channel
 

Detailed Description

Read/Write HCI communication channel.

Definition at line 52 of file HCIComm.hpp.

Constructor & Destructor Documentation

◆ HCIComm() [1/2]

direct_bt::HCIComm::HCIComm ( const uint16_t  dev_id,
const uint16_t  channel 
)
noexcept

Constructing a newly opened HCI communication channel instance.

Definition at line 105 of file HCIComm.cpp.

◆ HCIComm() [2/2]

direct_bt::HCIComm::HCIComm ( const HCIComm )
delete

◆ ~HCIComm()

direct_bt::HCIComm::~HCIComm ( )
inlinenoexcept

Releases this instance after issuing close().

Definition at line 76 of file HCIComm.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ close()

void direct_bt::HCIComm::close ( )
noexcept

Closing the HCI channel, locking mutex_write().

Definition at line 111 of file HCIComm.cpp.

Here is the caller graph for this function:

◆ filter_all_events()

static void direct_bt::HCIComm::filter_all_events ( hci_ufilter *  f)
inlinestaticnoexcept

Definition at line 144 of file HCIComm.hpp.

Here is the caller graph for this function:

◆ filter_all_ptypes()

static void direct_bt::HCIComm::filter_all_ptypes ( hci_ufilter *  f)
inlinestaticnoexcept

Definition at line 128 of file HCIComm.hpp.

◆ filter_clear()

static void direct_bt::HCIComm::filter_clear ( hci_ufilter *  f)
inlinestaticnoexcept

Definition at line 112 of file HCIComm.hpp.

Here is the caller graph for this function:

◆ filter_clear_event()

static void direct_bt::HCIComm::filter_clear_event ( int  e,
hci_ufilter *  f 
)
inlinestaticnoexcept

Definition at line 136 of file HCIComm.hpp.

◆ filter_clear_opcode()

static void direct_bt::HCIComm::filter_clear_opcode ( hci_ufilter *  f)
inlinestaticnoexcept

Definition at line 152 of file HCIComm.hpp.

◆ filter_clear_ptype()

static void direct_bt::HCIComm::filter_clear_ptype ( int  t,
hci_ufilter *  f 
)
inlinestaticnoexcept

Definition at line 120 of file HCIComm.hpp.

◆ filter_set_event()

static void direct_bt::HCIComm::filter_set_event ( int  e,
hci_ufilter *  f 
)
inlinestaticnoexcept

Definition at line 132 of file HCIComm.hpp.

Here is the caller graph for this function:

◆ filter_set_opcode()

static void direct_bt::HCIComm::filter_set_opcode ( uint16_t  opcode,
hci_ufilter *  f 
)
inlinestaticnoexcept

Definition at line 148 of file HCIComm.hpp.

Here is the caller graph for this function:

◆ filter_set_ptype()

static void direct_bt::HCIComm::filter_set_ptype ( int  t,
hci_ufilter *  f 
)
inlinestaticnoexcept

Definition at line 116 of file HCIComm.hpp.

Here is the caller graph for this function:

◆ filter_test_event()

static int direct_bt::HCIComm::filter_test_event ( int  e,
hci_ufilter *  f 
)
inlinestaticnoexcept

Definition at line 140 of file HCIComm.hpp.

◆ filter_test_opcode()

static int direct_bt::HCIComm::filter_test_opcode ( uint16_t  opcode,
hci_ufilter *  f 
)
inlinestaticnoexcept

Definition at line 156 of file HCIComm.hpp.

◆ filter_test_ptype()

static int direct_bt::HCIComm::filter_test_ptype ( int  t,
hci_ufilter *  f 
)
inlinestaticnoexcept

Definition at line 124 of file HCIComm.hpp.

◆ getSocketDescriptor()

int direct_bt::HCIComm::getSocketDescriptor ( ) const
inlinenoexcept

Return this HCI socket descriptor.

Definition at line 84 of file HCIComm.hpp.

Here is the caller graph for this function:

◆ isOpen()

bool direct_bt::HCIComm::isOpen ( ) const
inlinenoexcept

Definition at line 81 of file HCIComm.hpp.

Here is the caller graph for this function:

◆ mutex_write()

std::recursive_mutex& direct_bt::HCIComm::mutex_write ( )
inlinenoexcept

Return the recursive write mutex for multithreading access.

Definition at line 87 of file HCIComm.hpp.

◆ operator=()

void direct_bt::HCIComm::operator= ( const HCIComm )
delete

◆ read()

jau::snsize_t direct_bt::HCIComm::read ( uint8_t *  buffer,
const jau::nsize_t  capacity,
const int32_t  timeoutMS 
)
noexcept

Generic read w/ own timeoutMS, w/o locking suitable for a unique ringbuffer sink.

Definition at line 141 of file HCIComm.cpp.

◆ write()

jau::snsize_t direct_bt::HCIComm::write ( const uint8_t *  buffer,
const jau::nsize_t  size 
)
noexcept

Generic write, locking mutex_write().

Definition at line 183 of file HCIComm.cpp.

Member Data Documentation

◆ channel

const uint16_t direct_bt::HCIComm::channel

Definition at line 55 of file HCIComm.hpp.

◆ dev_id

const uint16_t direct_bt::HCIComm::dev_id

Definition at line 54 of file HCIComm.hpp.


The documentation for this class was generated from the following files: