Capsule API Example

Loading...
Searching...
No Matches
CDeviceLocator.h
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include "CDefinesPrivate.h"
6#include "CDeviceInfoList.h"
7#include "CError.h"
8
9#ifdef __cplusplus
10 extern "C" {
11#endif
12
16 typedef enum clCDeviceLocator_FailReason {
17 clCDeviceLocator_FailReason_OK = 0,
18 clCDeviceLocator_FailReason_BluetoothDisabled,
19 clCDeviceLocator_FailReason_Unknown,
20} clCDeviceLocator_FailReason;
21
22 typedef enum clCCapsule_LogLevel {
23 clCCapsule_LogLevel_Trace,
24 clCCapsule_LogLevel_Debug,
25 clCCapsule_LogLevel_Info,
26 clCCapsule_LogLevel_Warn,
27 clCCapsule_LogLevel_Err,
28 clCCapsule_LogLevel_Critical,
29 clCCapsule_LogLevel_Off
30} clCCapsule_LogLevel;
31
32 CL_DLL const char* clCCapsule_GetVersionString() NOEXCEPT;
33
40 CL_DLL void clCCapsule_SetSingleThreaded(bool singleThreaded) NOEXCEPT;
41
45 CL_DLL void clCCapsule_SetLogLevel(clCCapsule_LogLevel logLevel) NOEXCEPT;
50 CL_DLL clCCapsule_LogLevel clCCapsule_GetLogLevel() NOEXCEPT;
51
55 CLC_CLASS_WN(DeviceLocatorPrivate, clCDeviceLocator);
56
62 CL_DLL clCDeviceLocator clCDeviceLocator_Create(clCError* error) NOEXCEPT;
63
70 CL_DLL clCDeviceLocator clCDeviceLocator_CreateWithLogDirectory(const char* logDirectory, clCError* error) NOEXCEPT;
71
77 CL_DLL void clCDeviceLocator_Update(clCDeviceLocator locator) NOEXCEPT;
78
84 CL_DLL void clCDeviceLocator_Destroy(clCDeviceLocator locator) NOEXCEPT;
85
96 CL_DLL void clCDeviceLocator_RequestDevices(clCDeviceLocator locator, clCDeviceType deviceType, int32_t searchTime, clCError* error) NOEXCEPT;
97
101typedef void (*clCDeviceLocator_DeviceListHandler)(clCDeviceLocator, clCDeviceInfoList, clCDeviceLocator_FailReason) NOEXCEPT;
106 CL_DLL void clCDeviceLocator_SetOnDeviceListEvent(clCDeviceLocator locator, clCDeviceLocator_DeviceListHandler handler) NOEXCEPT;
107
108#ifdef __cplusplus
109}
110#endif
CDefinesPrivate.h
NOEXCEPT
#define NOEXCEPT
Definition CDefinesPrivate.h:82
CL_DLL
#define CL_DLL
Definition CDefinesPrivate.h:51
CLC_CLASS_WN
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:84
clCDeviceType
clCDeviceType
Device type.
Definition CDeviceInfo.h:14
CDeviceInfoList.h
clCCapsule_GetLogLevel
CL_DLL clCCapsule_LogLevel clCCapsule_GetLogLevel() NOEXCEPT
clCDeviceLocator_SetOnDeviceListEvent
CL_DLL void clCDeviceLocator_SetOnDeviceListEvent(clCDeviceLocator locator, clCDeviceLocator_DeviceListHandler handler) NOEXCEPT
clCDeviceLocator_Create
CL_DLL clCDeviceLocator clCDeviceLocator_Create(clCError *error) NOEXCEPT
clCCapsule_SetSingleThreaded
CL_DLL void clCCapsule_SetSingleThreaded(bool singleThreaded) NOEXCEPT
clCDeviceLocator_RequestDevices
CL_DLL void clCDeviceLocator_RequestDevices(clCDeviceLocator locator, clCDeviceType deviceType, int32_t searchTime, clCError *error) NOEXCEPT
Find available devices. Search time is in seconds. Searches for available devices of chosen type....
clCCapsule_SetLogLevel
CL_DLL void clCCapsule_SetLogLevel(clCCapsule_LogLevel logLevel) NOEXCEPT
clCDeviceLocator_FailReason
clCDeviceLocator_FailReason
Device locator error.
Definition CDeviceLocator.h:16
clCDeviceLocator_FailReason_OK
@ clCDeviceLocator_FailReason_OK
Definition CDeviceLocator.h:17
clCDeviceLocator_FailReason_BluetoothDisabled
@ clCDeviceLocator_FailReason_BluetoothDisabled
Definition CDeviceLocator.h:18
clCDeviceLocator_FailReason_Unknown
@ clCDeviceLocator_FailReason_Unknown
Definition CDeviceLocator.h:19
clCDeviceLocator_Update
CL_DLL void clCDeviceLocator_Update(clCDeviceLocator locator) NOEXCEPT
clCCapsule_LogLevel
clCCapsule_LogLevel
Definition CDeviceLocator.h:22
clCCapsule_LogLevel_Err
@ clCCapsule_LogLevel_Err
Definition CDeviceLocator.h:27
clCCapsule_LogLevel_Info
@ clCCapsule_LogLevel_Info
Definition CDeviceLocator.h:25
clCCapsule_LogLevel_Trace
@ clCCapsule_LogLevel_Trace
Definition CDeviceLocator.h:23
clCCapsule_LogLevel_Warn
@ clCCapsule_LogLevel_Warn
Definition CDeviceLocator.h:26
clCCapsule_LogLevel_Debug
@ clCCapsule_LogLevel_Debug
Definition CDeviceLocator.h:24
clCCapsule_LogLevel_Off
@ clCCapsule_LogLevel_Off
Definition CDeviceLocator.h:29
clCCapsule_LogLevel_Critical
@ clCCapsule_LogLevel_Critical
Definition CDeviceLocator.h:28
clCDeviceLocator_DeviceListHandler
void(* clCDeviceLocator_DeviceListHandler)(clCDeviceLocator, clCDeviceInfoList, clCDeviceLocator_FailReason) NOEXCEPT
Device callback for the list of device info.
Definition CDeviceLocator.h:101
clCDeviceLocator_Destroy
CL_DLL void clCDeviceLocator_Destroy(clCDeviceLocator locator) NOEXCEPT
clCDeviceLocator_CreateWithLogDirectory
CL_DLL clCDeviceLocator clCDeviceLocator_CreateWithLogDirectory(const char *logDirectory, clCError *error) NOEXCEPT
clCCapsule_GetVersionString
CL_DLL const char * clCCapsule_GetVersionString() NOEXCEPT
CError.h
clCError
Definition CError.h:28