XDK API  3.6.0
Documentation
Macros | Functions
BleSystem.h File Reference
#include "BleTypes.h"
+ Include dependency graph for BleSystem.h:
+ This graph shows which files directly or indirectly include this file:

Macros

#define BLEINFOTYPE_ATTHANDLESCHANGED   0x11
 
#define BLEINFOTYPE_MDIV2   0x03
 
#define BLEINFOTYPE_MLTK16   0x01
 
#define BLEINFOTYPE_MPROP   0x05
 
#define BLEINFOTYPE_MRAND8   0x04
 
#define BLEINFOTYPE_REMOTE_IRK   0x07
 
#define BLEINFOTYPE_SERVICECHANGECONFIG   0x12
 
#define BLEINFOTYPE_SLTK16   0x02
 
#define BLEINFOTYPE_SPROP   0x06
 
#define max(a, b)   (((a) > (b)) ? (a) : (b))
 
#define min(a, b)   (((a) < (b)) ? (a) : (b))
 

Functions

void SYSTEM_CancelTimer (void)
 
void SYSTEM_CreateTimer (void *func, void *param, U32 millisecond)
 
void SYSTEM_DatabaseMutexPend (void)
 
void SYSTEM_DatabaseMutexPost (void)
 
void SYSTEM_GetDeviceAddressAtIndexInPersistentMemory (U8 index, BD_ADDR **addr)
 
void SYSTEM_GetNumberOfDevicesInPersistentMemory (U8 *numberOfDevices)
 
BleStatus SYSTEM_GetPersistentInformation (BD_ADDR *addr, U8 infoType, U8 **infoValue, U8 *infoLen)
 
U16 SYSTEM_MemCmp (const void *a1, const void *a2, U16 n)
 
void * SYSTEM_MemCpy (void *to, const void *from, U16 n)
 
void * SYSTEM_MemSet (void *addr, U8 value, U16 n)
 
BleStatus SYSTEM_RemovePersistentInformation (BD_ADDR *addr, U8 infoTypeFrom, U8 infoTypeTo)
 
void * SYSTEM_ReverseMemCpy (void *to, const void *from, U16 n)
 
BleStatus SYSTEM_SetPersistentInformation (BD_ADDR *addr, U8 infoType, U8 *infoValue, U8 infoLen)
 
void SYSTEM_StackMutexPend (void)
 
void SYSTEM_StackMutexPost (void)
 
U32 SYSTEM_TimerGetRemain (void)
 
void SYSTEM_UpdateDeviceAddressAtIndexInPersistentMemory (U8 index, BD_ADDR *to)
 

Macro Definition Documentation

#define BLEINFOTYPE_ATTHANDLESCHANGED   0x11
#define BLEINFOTYPE_MDIV2   0x03
#define BLEINFOTYPE_MLTK16   0x01
#define BLEINFOTYPE_MPROP   0x05
#define BLEINFOTYPE_MRAND8   0x04
#define BLEINFOTYPE_REMOTE_IRK   0x07
#define BLEINFOTYPE_SERVICECHANGECONFIG   0x12
#define BLEINFOTYPE_SLTK16   0x02
#define BLEINFOTYPE_SPROP   0x06
#define max (   a,
 
)    (((a) > (b)) ? (a) : (b))
#define min (   a,
 
)    (((a) < (b)) ? (a) : (b))

Function Documentation

void SYSTEM_CancelTimer ( void  )

The stack request its timer destruction

SYSTEM_CancelTimer() The BLE stack no more need timer. it request destruction of the timer created with SYSTEM_CreateTimer().

See also
SYSTEM_CreateTimer() , SYSTEM_TimerGetRemain()
Returns
none
Author
Alexandre GIMARD
void SYSTEM_CreateTimer ( void *  func,
void *  param,
U32  millisecond 
)

The stack request a timer creation

SYSTEM_TimerCreate() The BLE stack need one timer in order to calulates timeout or wachdog. It uses this function to create the timer, timers are internally multiplexed, so it need only one.

See also
SYSTEM_TimerCancel() , SYSTEM_TimerGetRemain()
Parameters
func: pointer to a function to call when the timer expires
param: param to pass in func when the timer expire
millisecond: time to wait before the timer expiration
Returns
none
Author
Alexandre GIMARD
void SYSTEM_DatabaseMutexPend ( void  )

Lock the Attribute database mutex.

SYSTEM_DatabaseMutexPend() The BLE stack uses a MUTEX to prevent internal/external multiple access to the Attribute protocol database, the BLE stack calls this function to acquire the MUTEX. This function SHALL be implemented. Note that the User application does not call this function directly, but call the application interface ATT_Server_SecureDatabaseAccess().

It could be implemented using a mutex or perhaps a semaphore

See also
SYSTEM_DatabaseMutexPost()
Returns
none
Author
Alexandre GIMARD
void SYSTEM_DatabaseMutexPost ( void  )

Unlock the stack mutex.

SYSTEM_DatabaseMutexPost() The BLE stack uses a MUTEX to prevent internal/external multiple access to the Attribute protocol database, the BLE stack calls this function to release the MUTEX. This function SHALL be implemented. Note that the User application does not call this function directly, but call the application interface ATT_Server_ReleaseDatabaseAccess().

It could be implemented using a mutex or perhaps a semaphore

See also
SYSTEM_DatabaseMutexPend()
Returns
none
Author
Alexandre GIMARD
void SYSTEM_GetDeviceAddressAtIndexInPersistentMemory ( U8  index,
BD_ADDR **  addr 
)

The stack requests the system the current address of a remote device saved in persistent memory.

SYSTEM_GetDeviceAddressAtIndexInPersistentMemory() When the stack is able to resolve remote RADOM RESOLVABLE private address, it may ask the system the devices addresses of the remote device saved in persistent memory.

BLE_SECURITY shall be enabled. BLE_SM_SLAVE_RESOLVE_MASTER_RANDOM_ADDRESS shall be enabled

index : a 0-based index used to describe for which device, the address shall be retrieved (if SYSTEM_GetNumberOfDevicesInPersistentMemory set numberOfDevices = 1; then the first device will have index of 0)

addr : A valid pointer to a system memory block in which the stack will read the remote device address. Upon failure the system layer shall return a NULL pointer.

return none

void SYSTEM_GetNumberOfDevicesInPersistentMemory ( U8 numberOfDevices)

The stack requests the system the number of remote devices saved in persistent memory

SYSTEM_GetNumberOfDevicesInPersistentMemory() When the stack is able to resolve remote RADOM RESOLVABLE private address, it need to have access to the number of records (devices) that the implementation is saving in the persistent memory

BLE_SECURITY shall be enabled. BLE_SM_SLAVE_RESOLVE_MASTER_RANDOM_ADDRESS shall be enabled

numberOfDevices : A valid pointer to a stack memory block in which the number of devices supported by the persistent memory storage shall be written (ex: *numberOfDevices = 1; indicate that the persistent memory storage is supporting one device.

return none

BleStatus SYSTEM_GetPersistentInformation ( BD_ADDR addr,
U8  infoType,
U8 **  infoValue,
U8 infoLen 
)

The stack requests the system to retrieve an information from persistent memory

SYSTEM_GetPersistentInformation() The BLE stack needs to retrieve a specific security information from the persistent memory.

BLE_SECURITY shall be enabled.

addr : A valid pointer to the remote address for which security information shall be retrieved infoType : the type of the information to retrieve infoValue : the value of the information retrieved infoLen : a the length the information retrieved

return the status of the operation

U16 SYSTEM_MemCmp ( const void *  a1,
const void *  a2,
U16  n 
)
void* SYSTEM_MemCpy ( void *  to,
const void *  from,
U16  n 
)
void* SYSTEM_MemSet ( void *  addr,
U8  value,
U16  n 
)
BleStatus SYSTEM_RemovePersistentInformation ( BD_ADDR addr,
U8  infoTypeFrom,
U8  infoTypeTo 
)

The stack request the system to remove an information from persistent memory

SYSTEM_RemovePersistentInformation() The BLE stack needs to remove a specific persistent information from the persistent memory. It request to remove a range of infotype The stack call this function when the Application wants to unbond with a remote device or when it detect that profile information is no more valid Also, an application may delete the linkUp information for a given profile by calling this function.

BLE_SECURITY shall be enabled.

addr : A valid pointer to the remote address for which persistent information shall be retrieved infoTypeFrom : the starting range of the infoType to delete, this infoTypeFrom is included into the range to delete infoTypeTo : the ending range of the infoType to delete, this infoTypeTo is included into the range to delete

return the status of the operation

void* SYSTEM_ReverseMemCpy ( void *  to,
const void *  from,
U16  n 
)
BleStatus SYSTEM_SetPersistentInformation ( BD_ADDR addr,
U8  infoType,
U8 infoValue,
U8  infoLen 
)

The stack requests the system to store an information in persistent memory

SYSTEM_SetPersistentInformation() The BLE stack needs to save a specific security information with a specified remote device in the persistent memory.

BLE_SECURITY shall be enabled.

addr : A valid pointer to the remote address for which security information should be stored, IMPORTANT NOTE: if BD_ADDR is 00:00:00:00:00:00, all the entry of the persistent memory shall be updated. infoType : the type of the information to store infoValue : a valid pointer to the information to save infoLen : the length the information to save

return the status of the operation

void SYSTEM_StackMutexPend ( void  )

Lock the stack mutex.

SYSTEM_StackMutexPend() The BLE stack uses a MUTEX to prevent internal interface reentrency and dead lock, the BLE stack calls this function to acquire the MUTEX this function SHALL be implemented. It could be implemented using a mutex or perhaps a semaphore

See also
SYSTEM_StackMutexPost()
Returns
none
Author
Alexandre GIMARD
void SYSTEM_StackMutexPost ( void  )

Unlock the stack mutex.

SYSTEM_StackMutexPost() The BLE stack uses a MUTEX to prevent internal interface reentrency and dead lock, the BLE stack calls this function to acquire the MUTEX this function SHALL be implemented. It could be implemented using a mutex or perhaps a semaphore

See also
SYSTEM_StackMutexPend()
Returns
none
Author
Alexandre GIMARD
U32 SYSTEM_TimerGetRemain ( void  )

The stack request the timer remainting time

SYSTEM_TimerGetRemain() The BLE stack need the remaining time of the timer created by SYSTEM_CreateTimer() in order to do some internal things

See also
SYSTEM_CreateTimer() , SYSTEM_CancelTimer()
Returns
the time remaining in millisecond.
Author
Alexandre GIMARD
void SYSTEM_UpdateDeviceAddressAtIndexInPersistentMemory ( U8  index,
BD_ADDR to 
)

The stack requests the system to replace the address of a remote device saved in persistent memory

SYSTEM_UpdateDeviceAddressAtIndexInPersistentMemory() When the stack is able to resolve remote RADOM RESOLVABLE private address, it may be able to "resolve remote"random resolvable address meaning that it can detect that the remote device has changed its Bluetooth device address; in this case the stack is asking the system to update the persistent memory storage with the new address for the given device index.

BLE_SECURITY shall be enabled. BLE_SM_SLAVE_RESOLVE_MASTER_RANDOM_ADDRESS shall be enabled

index : a 0-based index used to describe for which device, the address shall be updated (if SYSTEM_GetNumberOfDevicesInPersistentMemory set numberOfDevices = 1; then the first device will have index of 0)

to : A valid pointer to a stack memory block in which the new remote device address is stored.

return none


All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:41 by doxygen 1.8.8