Skip to content

File ns_ble_tests.c

FileList > neuralSPOT > neuralspot > ns-ble > tests > ns_ble_tests.c

Go to the source code of this file

  • #include "unity/unity.h"
  • #include "ns_ble.h"

Public Attributes

Type Name
uint16_t humidity = = 2
float temperature = = 0.0
size_t const ucHeapSize = = configTOTAL_HEAP_SIZE
ns_ble_characteristic_t webbleAccel
ns_ble_characteristic_t webbleBsec
ns_ble_characteristic_t webbleCo2
ns_ble_characteristic_t webbleGas
ns_ble_characteristic_t webbleGyro
ns_ble_characteristic_t webbleHumidity
ns_ble_characteristic_t webblePressure
ns_ble_characteristic_t webbleQuat
ns_ble_characteristic_t webbleRgb
ns_ble_service_t webbleService
ns_ble_characteristic_t webbleTemperature

Public Static Attributes

Type Name
wsfBufPoolDesc_t webbleBufferDescriptors = = {
{16, 8},
{32, 4},
{64, 6},
{512, 14}}
uint32_t webbleWSFBufferPool
ns_ble_pool_config_t webbleWsfBuffers = = {
.pool = webbleWSFBufferPool,
.poolSize = sizeof(webbleWSFBufferPool),
.desc = webbleBufferDescriptors,
.descNum = WEBBLE_WSF_BUFFER_POOLS}

Public Functions

Type Name
uint8_t ucHeap[NS_MALLOC_HEAP_SIZE_IN_K *1024] __attribute__ ((aligned(4)))
void ns_ble_characteristic_test ()
void ns_ble_create_different_service_test ()
void ns_ble_create_null_service_test ()
void ns_ble_create_service_test ()
void ns_ble_create_service_test_no_characteristics ()
void ns_ble_empty_service_add_characteristic_test ()
void ns_ble_multiple_characteristics_fail_test ()
void ns_ble_multiple_characteristics_test ()
void ns_ble_negative_attribute_test ()
void ns_ble_start_service_test ()
void ns_ble_tests_post_test_hook ()
void ns_ble_tests_pre_test_hook ()

Public Static Functions

Type Name
int webbleReadHandler (ns_ble_service_t * s, struct ns_ble_characteristic * c, void * dest)
int webbleWriteHandler (ns_ble_service_t * s, struct ns_ble_characteristic * c, void * src)

Macros

Type Name
define WEBBLE_WSF_BUFFER_POOLS 4
define WEBBLE_WSF_BUFFER_SIZE (WEBBLE_WSF_BUFFER_POOLS * 16 + 16 * 8 + 32 * 4 + 64 * 6 + 280 * 14) / sizeof(uint32_t)
define configTOTAL_HEAP_SIZE NS_MALLOC_HEAP_SIZE_IN_K * 1024
define webbleUuid (uuid) "19b10000" uuid "537e4f6cd104768a1214"

Public Attributes Documentation

variable humidity

uint16_t humidity;

variable temperature

float temperature;

variable ucHeapSize

size_t const ucHeapSize;

variable webbleAccel

ns_ble_characteristic_t webbleAccel;

variable webbleBsec

ns_ble_characteristic_t webbleBsec;

variable webbleCo2

ns_ble_characteristic_t webbleCo2;

variable webbleGas

ns_ble_characteristic_t webbleGas;

variable webbleGyro

ns_ble_characteristic_t webbleGyro;

variable webbleHumidity

ns_ble_characteristic_t webbleHumidity;

variable webblePressure

ns_ble_characteristic_t webblePressure;

variable webbleQuat

ns_ble_characteristic_t webbleQuat;

variable webbleRgb

ns_ble_characteristic_t webbleRgb;

variable webbleService

ns_ble_service_t webbleService;

variable webbleTemperature

ns_ble_characteristic_t webbleTemperature;

Public Static Attributes Documentation

variable webbleBufferDescriptors

wsfBufPoolDesc_t webbleBufferDescriptors[WEBBLE_WSF_BUFFER_POOLS];

variable webbleWSFBufferPool

uint32_t webbleWSFBufferPool[WEBBLE_WSF_BUFFER_SIZE];

variable webbleWsfBuffers

ns_ble_pool_config_t webbleWsfBuffers;

Public Functions Documentation

function __attribute__

uint8_t ucHeap[NS_MALLOC_HEAP_SIZE_IN_K *1024] __attribute__ (
    (aligned(4))
) 

function ns_ble_characteristic_test

void ns_ble_characteristic_test () 

function ns_ble_create_different_service_test

void ns_ble_create_different_service_test () 

function ns_ble_create_null_service_test

void ns_ble_create_null_service_test () 

function ns_ble_create_service_test

void ns_ble_create_service_test () 

function ns_ble_create_service_test_no_characteristics

void ns_ble_create_service_test_no_characteristics () 

function ns_ble_empty_service_add_characteristic_test

void ns_ble_empty_service_add_characteristic_test () 

function ns_ble_multiple_characteristics_fail_test

void ns_ble_multiple_characteristics_fail_test () 

function ns_ble_multiple_characteristics_test

void ns_ble_multiple_characteristics_test () 

function ns_ble_negative_attribute_test

void ns_ble_negative_attribute_test () 

function ns_ble_start_service_test

void ns_ble_start_service_test () 

function ns_ble_tests_post_test_hook

void ns_ble_tests_post_test_hook () 

function ns_ble_tests_pre_test_hook

void ns_ble_tests_pre_test_hook () 

Public Static Functions Documentation

function webbleReadHandler

static int webbleReadHandler (
    ns_ble_service_t * s,
    struct ns_ble_characteristic * c,
    void * dest
) 

function webbleWriteHandler

static int webbleWriteHandler (
    ns_ble_service_t * s,
    struct ns_ble_characteristic * c,
    void * src
) 

Macro Definition Documentation

define WEBBLE_WSF_BUFFER_POOLS

#define WEBBLE_WSF_BUFFER_POOLS 4

define WEBBLE_WSF_BUFFER_SIZE

#define WEBBLE_WSF_BUFFER_SIZE (WEBBLE_WSF_BUFFER_POOLS * 16 + 16 * 8 + 32 * 4 + 64 * 6 + 280 * 14) / sizeof(uint32_t)

define configTOTAL_HEAP_SIZE

#define configTOTAL_HEAP_SIZE NS_MALLOC_HEAP_SIZE_IN_K * 1024

define webbleUuid

#define webbleUuid (
    uuid
) "19b10000" uuid "537e4f6cd104768a1214"

The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-ble/tests/ns_ble_tests.c