Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Classes | Functions
ersa::protocols Namespace Reference

Classes

struct  AmsMedia
 
class  AncsAttributes
 
struct  AncsCall
 

Functions

uint32_t readLe32 (const uint8_t *p)
 
void writeLe32 (uint8_t *p, uint32_t value)
 
bool decodeCurrentTime (const uint8_t *value, size_t size, uint32_t &epoch)
 

Function Documentation

◆ decodeCurrentTime()

bool ersa::protocols::decodeCurrentTime ( const uint8_t *  value,
size_t  size,
uint32_t &  epoch 
)
inline

Decode the Bluetooth SIG Current Time characteristic (UUID 0x2A2B).

CTS reports local calendar fields rather than an absolute timezone-aware instant. The returned epoch encodes those fields in a UTC-shaped number so the watch RTC can preserve the wall-clock time shown by the phone. This function validates the complete 10-byte field set and has no BLE dependency, allowing malformed values and leap dates to be checked on a host.

Parameters
valuePointer to the characteristic bytes.
sizeMust equal the specification's 10-byte structure size.
epochReceives encoded seconds only on success; unchanged on failure.
Returns
False for null, wrong length, invalid calendar fields, or overflow.

◆ readLe32()

uint32_t ersa::protocols::readLe32 ( const uint8_t *  p)
inline

Decode a four-byte little-endian integer from a validated input buffer.

◆ writeLe32()

void ersa::protocols::writeLe32 ( uint8_t *  p,
uint32_t  value 
)
inline

Encode a 32-bit integer as four little-endian bytes into caller storage.