Mbed OS Reference
Loading...
Searching...
No Matches
byte_array_t< array_size > Struct Template Reference

Model fixed size array values. More...

#include <BLETypes.h>

Public Member Functions

 byte_array_t ()
 Default to all zeroes.
 
 byte_array_t (const uint8_t *input_value)
 Initialize a data from an array of bytes.
 
 byte_array_t (const uint8_t *input_value, size_t size)
 Initialize a data from an buffer of bytes.
 
uint8_t & operator[] (size_t i)
 Subscript operator to access data content.
 
uint8_t operator[] (size_t i) const
 Subscript operator to access data content.
 
const uint8_t * data () const
 Return the pointer to the buffer holding data.
 
uint8_t * data ()
 Return the pointer to the buffer holding data.
 

Static Public Member Functions

static size_t size ()
 Size in byte of a data.
 

Static Public Attributes

static const size_t size_ = array_size
 Size of the array; accessible at compile time.
 

Detailed Description

template<size_t array_size>
struct ble::byte_array_t< array_size >

Model fixed size array values.

Template Parameters
array_sizeThe size of the array.

Definition at line 344 of file common/BLETypes.h.

Constructor & Destructor Documentation

◆ byte_array_t() [1/3]

template<size_t array_size>
byte_array_t ( )

Default to all zeroes.

Definition at line 353 of file common/BLETypes.h.

◆ byte_array_t() [2/3]

template<size_t array_size>
byte_array_t ( const uint8_t *  input_value)

Initialize a data from an array of bytes.

Parameters
[in]input_valuevalue of the data.

Definition at line 362 of file common/BLETypes.h.

◆ byte_array_t() [3/3]

template<size_t array_size>
byte_array_t ( const uint8_t *  input_value,
size_t  size 
)

Initialize a data from an buffer of bytes.

Parameters
[in]input_valuepointer to buffer.
[in]sizebuffer size

Definition at line 372 of file common/BLETypes.h.

Member Function Documentation

◆ operator[]() [1/2]

template<size_t array_size>
uint8_t & operator[] ( size_t  i)

Subscript operator to access data content.

Definition at line 393 of file common/BLETypes.h.

◆ operator[]() [2/2]

template<size_t array_size>
uint8_t operator[] ( size_t  i) const

Subscript operator to access data content.

Definition at line 400 of file common/BLETypes.h.

◆ data() [1/2]

template<size_t array_size>
const uint8_t * data ( ) const

Return the pointer to the buffer holding data.

Definition at line 407 of file common/BLETypes.h.

◆ data() [2/2]

template<size_t array_size>
uint8_t * data ( )

Return the pointer to the buffer holding data.

Definition at line 414 of file common/BLETypes.h.

◆ size()

template<size_t array_size>
static size_t size ( )
static

Size in byte of a data.

Definition at line 421 of file common/BLETypes.h.

Field Documentation

◆ size_

template<size_t array_size>
const size_t size_ = array_size
static

Size of the array; accessible at compile time.

Definition at line 348 of file common/BLETypes.h.