Dawn Framework 1.0
Universal data acquisition framework for embedded systems
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
dawn::CProtoNimblePrphOts Class Reference

Object Transfer Service (OTS) for BLE Peripheral. More...

#include <prph_ots.hxx>

Inheritance diagram for dawn::CProtoNimblePrphOts:
[legend]
Collaboration diagram for dawn::CProtoNimblePrphOts:
[legend]

Classes

struct  SProtoNimblePrphIOBindOts
 Top-level OTS binding payload. More...
 
struct  SProtoNimblePrphIOBindOtsObjid
 Per-object descriptor entry. More...
 

Public Types

enum  
 Object Properties bits.
 
enum  
 OACP request opcodes (Bluetooth OTS spec Table 3.9).
 
enum  { }
 OACP result codes (Bluetooth OTS spec Table 3.10). More...
 
enum  
 OLCP request opcodes (Bluetooth OTS spec Table 3.16).
 
enum  { }
 OLCP result codes (Bluetooth OTS spec Table 3.17). More...
 
enum  
 OTS object kinds derived from descriptor cfg.
 
enum  
 Per-object access mode (descriptor-supplied).
 

Public Member Functions

int deinit ()
 Deinitialize service.
 
int init ()
 Initialize service.
 
int start ()
 Start service.
 
int stop ()
 Stop service.
 

Public Attributes

IProtoNimblePrphCbcb
 Callback interface to peripheral.
 
const SObjectCfg::SObjectCfgItemdesc
 Configuration descriptor for this service.
 
std::vector< SObjectId::ObjectIdvio
 Vector of I/O objects exposed by this service.
 

Static Public Attributes

static uint8_t CFG_TYPE_SHIFT = 0
 Per-object cfg word layout (lower bits of obj.cfg).
 
static uint16_t L2CAP_MTU_OTS = 512
 L2CAP CoC MTU for OTS data channel.
 
static uint16_t L2CAP_PSM_OTS = 0x0025
 L2CAP PSM for OTS bulk data (Bluetooth SIG-assigned).
 
static uint8_t OBJ_NAME_MAX = 16
 OTS object name length (bytes, fixed).
 
static uint16_t OBJ_TYPE_CAPS = 0xffe1
 Object Type for a Dawn capabilities blob (Dawn-private UUID16).
 
static uint16_t OBJ_TYPE_DESCRIPTOR = 0xffe0
 Object Type for a Dawn descriptor blob (Dawn-private UUID16).
 
static uint16_t OBJ_TYPE_UNSPECIFIED = 0x2aca
 Object Type for an "Unspecified" file (Bluetooth SIG).
 
static uint16_t UUID16_FEATURE = 0x2abd
 OTS Feature characteristic.
 
static uint16_t UUID16_OACP = 0x2ac5
 Object Action Control Point characteristic.
 
static uint16_t UUID16_OBJ_ID = 0x2ac3
 Object ID characteristic (48-bit).
 
static uint16_t UUID16_OBJ_NAME = 0x2abe
 Object Name characteristic.
 
static uint16_t UUID16_OBJ_PROPS = 0x2ac4
 Object Properties characteristic.
 
static uint16_t UUID16_OBJ_SIZE = 0x2ac0
 Object Size characteristic (current + allocated, 8 bytes).
 
static uint16_t UUID16_OBJ_TYPE = 0x2abf
 Object Type characteristic.
 
static uint16_t UUID16_OLCP = 0x2ac6
 Object List Control Point characteristic.
 
static uint16_t UUID16_OTS = 0x1825
 OTS Service UUID (Bluetooth SIG).
 

Detailed Description

Object Transfer Service (OTS) for BLE Peripheral.

Implements the Bluetooth SIG Object Transfer Service v1.0 (UUID 0x1825).

The service exposes one or more CIOCommon objects whose isSeekable() returns true (e.g. CIOFile, CIODescriptor, CIOCapabilities) as OTS Objects. Bulk data is carried over an L2CAP CoC channel (PSM 0x0025); the GATT side carries only metadata and the OACP/OLCP control points.

Supported OACP opcodes: Read, Write, Abort. Supported OLCP opcodes: First, Last, Previous, Next, Go To. Optional characteristics (List Filter, First-Created, Last-Modified, Object Changed) are not implemented in this revision.

Note
Single-client only. The L2CAP CoC server accepts at most one active channel; concurrent OTS sessions from a second central are refused with BLE_HS_EBUSY at BLE_L2CAP_EVENT_COC_ACCEPT. The pre-allocated transfer buffer is shared and not safe for multi-client use.

Definition at line 41 of file prph_ots.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

OACP result codes (Bluetooth OTS spec Table 3.10).

Enumerator
OACP_RES_OPCODE_NS 

Opcode Not Supported.

Definition at line 140 of file prph_ots.hxx.

◆ anonymous enum

anonymous enum

OLCP result codes (Bluetooth OTS spec Table 3.17).

Enumerator
OLCP_RES_OOR 

Out Of Bounds.

Definition at line 170 of file prph_ots.hxx.

Member Function Documentation

◆ deinit()

int CProtoNimblePrphOts::deinit ( )
virtual

Deinitialize service.

Releases all allocated resources for this service.

Returns
int 0 on success, negative error code on failure.

Implements dawn::IProtoNimblePrphService.

Definition at line 363 of file prph_ots.cxx.

◆ init()

int CProtoNimblePrphOts::init ( )
virtual

Initialize service.

Allocates service resources and prepares characteristics.

Returns
int 0 on success, negative error code on failure.

Implements dawn::IProtoNimblePrphService.

Definition at line 341 of file prph_ots.cxx.

References dawn::IProtoNimblePrphService::cb, dawn::IProtoNimblePrphService::desc, and dawn::IProtoNimblePrphCb::serviceRegister().

Here is the call graph for this function:

◆ start()

int CProtoNimblePrphOts::start ( )
virtual

Start service.

Registers the service with the GATT database.

Returns
int 0 on success, negative error code on failure.

Implements dawn::IProtoNimblePrphService.

Definition at line 372 of file prph_ots.cxx.

References dawn::IProtoNimblePrphService::cb, L2CAP_MTU_OTS, L2CAP_PSM_OTS, and dawn::IProtoNimblePrphCb::startService().

Here is the call graph for this function:

◆ stop()

int CProtoNimblePrphOts::stop ( )
virtual

Stop service.

Removes the service from the GATT database.

Returns
int 0 on success, negative error code on failure.

Implements dawn::IProtoNimblePrphService.

Definition at line 402 of file prph_ots.cxx.

References dawn::IProtoNimblePrphService::cb, and dawn::IProtoNimblePrphCb::stopService().

Here is the call graph for this function:

Member Data Documentation

◆ cb

IProtoNimblePrphCb* dawn::IProtoNimblePrphService::cb
inherited

Callback interface to peripheral.

Services use this to register GATT services, start/stop services, and access I/O objects.

Definition at line 566 of file iprph.hxx.

◆ desc

const SObjectCfg::SObjectCfgItem* dawn::IProtoNimblePrphService::desc
inherited

Configuration descriptor for this service.

Points to the configuration item that specified this service's setup.

Definition at line 574 of file iprph.hxx.

◆ OBJ_TYPE_CAPS

uint16_t dawn::CProtoNimblePrphOts::OBJ_TYPE_CAPS = 0xffe1
static

Object Type for a Dawn capabilities blob (Dawn-private UUID16).

Allocated in the unassigned 16-bit UUID range; same caveat as OBJ_TYPE_DESCRIPTOR.

Definition at line 101 of file prph_ots.hxx.

◆ OBJ_TYPE_DESCRIPTOR

uint16_t dawn::CProtoNimblePrphOts::OBJ_TYPE_DESCRIPTOR = 0xffe0
static

Object Type for a Dawn descriptor blob (Dawn-private UUID16).

Allocated in the unassigned 16-bit UUID range. Subject to revision if the Bluetooth SIG ever assigns this value. Clients that don't recognise it should treat the object as opaque bytes.

Definition at line 92 of file prph_ots.hxx.

◆ vio

std::vector<SObjectId::ObjectId> dawn::IProtoNimblePrphService::vio
inherited

Vector of I/O objects exposed by this service.

Each entry is an I/O object ID that this service manages.

Definition at line 557 of file iprph.hxx.


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