CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::mod_ble_serial Namespace Reference

Classes

class  BleSerialModule
class  BleUartService

Functions

static void bleOutputHook (const char *data, size_t len)
 Console hook bridge between shell I/O and BLE UART transport.
static bool bleInputAvailableHook ()
 Console input-available hook using BLE UART RX queue.
static int bleInputGetcharHook ()
 Console getchar hook reading one byte from BLE UART.

Variables

constexpr ui::I18nEntry kStrings []
static const uint8_t NUS_SVC_UUID [16]
 NUS UUIDs in little-endian byte order for BleUuid::from128.
static const uint8_t NUS_RX_UUID [16]
 RX characteristic UUID (phone writes to badge).
static const uint8_t NUS_TX_UUID [16]
 TX characteristic UUID (badge notifies phone).

Function Documentation

◆ bleInputAvailableHook()

bool cdc::mod_ble_serial::bleInputAvailableHook ( )
static

Console input-available hook using BLE UART RX queue.

Returns
true when BLE serial has pending input.

Definition at line 50 of file BleSerialModule.cpp.

References cdc::mod_ble_serial::BleUartService::instance().

◆ bleInputGetcharHook()

int cdc::mod_ble_serial::bleInputGetcharHook ( )
static

Console getchar hook reading one byte from BLE UART.

Returns
Character value or negative when unavailable.

Definition at line 59 of file BleSerialModule.cpp.

References cdc::mod_ble_serial::BleUartService::instance().

◆ bleOutputHook()

void cdc::mod_ble_serial::bleOutputHook ( const char * data,
size_t len )
static

Console hook bridge between shell I/O and BLE UART transport.

Console output hook that forwards bytes to the BLE UART service.

Parameters
dataPointer to output bytes.
lenNumber of bytes to forward.
Returns
void

Definition at line 39 of file BleSerialModule.cpp.

References cdc::mod_ble_serial::BleUartService::instance().

Variable Documentation

◆ kStrings

ui::I18nEntry cdc::mod_ble_serial::kStrings[]
constexpr
Initial value:
= {
{"mod_ble_serial.title", "BLE Serial"},
{"mod_ble_serial.enabled", "Enabled"},
{"mod_ble_serial.disabled", "Disabled"},
}

Definition at line 21 of file BleSerialModule.cpp.

◆ NUS_RX_UUID

const uint8_t cdc::mod_ble_serial::NUS_RX_UUID[16]
static
Initial value:
= {
0x9e, 0xca, 0xdc, 0x24, 0x0e, 0xe5, 0xa9, 0xe0,
0x93, 0xf3, 0xa3, 0xb5, 0x02, 0x00, 0x40, 0x6e
}

RX characteristic UUID (phone writes to badge).

Definition at line 21 of file BleUartService.cpp.

Referenced by cdc::mod_ble_serial::BleUartService::init().

◆ NUS_SVC_UUID

const uint8_t cdc::mod_ble_serial::NUS_SVC_UUID[16]
static
Initial value:
= {
0x9e, 0xca, 0xdc, 0x24, 0x0e, 0xe5, 0xa9, 0xe0,
0x93, 0xf3, 0xa3, 0xb5, 0x01, 0x00, 0x40, 0x6e
}

NUS UUIDs in little-endian byte order for BleUuid::from128.

Definition at line 16 of file BleUartService.cpp.

Referenced by cdc::mod_ble_serial::BleUartService::deinit(), and cdc::mod_ble_serial::BleUartService::init().

◆ NUS_TX_UUID

const uint8_t cdc::mod_ble_serial::NUS_TX_UUID[16]
static
Initial value:
= {
0x9e, 0xca, 0xdc, 0x24, 0x0e, 0xe5, 0xa9, 0xe0,
0x93, 0xf3, 0xa3, 0xb5, 0x03, 0x00, 0x40, 0x6e
}

TX characteristic UUID (badge notifies phone).

Definition at line 26 of file BleUartService.cpp.

Referenced by cdc::mod_ble_serial::BleUartService::init().