CySmart 1.2 API Reference Guide 002-11435 A V
CySmart 1.2 API Reference Guide 002-11435 A V
CySmart 1.2 API Reference Guide 002-11435 A V
Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709
Phone (USA): 800.858.1810
Phone (Intnl): +1.408.943.2600
www.cypress.com
Copyright
Copyrights
© Cypress Semiconductor Corporation, 2016-2017. This document is the property of Cypress Semiconductor
Corporation and its subsidiaries, including Spansion LLC (“Cypress”). This document, including any software or
firmware included or referenced in this document (“Software”), is owned by Cypress under the intellectual property
laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such laws
and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents,
copyrights, trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement
and you do not otherwise have a written agreement with Cypress governing the use of the Software, then Cypress
hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its
copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software
solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the
Software in binary code form externally to end users (either directly or indirectly through resellers and distributors),
solely for use on Cypress hardware product units, and (2) under those claims of Cypress’s patents that are infringed
by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for use
with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software
is prohibited.
TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING
HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to
make changes to this document without further notice. Cypress does not assume any liability arising out of the
application or use of any product or circuit described in this document. Any information provided in this document,
including any sample design information or programming code, is provided only for reference purposes. It is the
responsibility of the user of this document to properly design, program, and test the functionality and safety of any
application made of this information and any resulting product. Cypress products are not designed, intended, or
authorized for use as critical components in systems designed or intended for the operation of weapons, weapons
systems, nuclear installations, life-support devices or systems, other medical devices or systems (including
resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses
where the failure of the device or system could cause personal injury, death, or property damage (“Unintended Uses”).
A critical component is any component of a device or system whose failure to perform can be reasonably expected to
cause the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in
part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to
all Unintended Uses of Cypress products. You shall indemnify and hold Cypress harmless from and against all claims,
costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any
Unintended Uses of Cypress products.
Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, WICED, PSoC, CapSense, EZ-
USB, F-RAM, and Traveo are trademarks or registered trademarks of Cypress in the United States and other
countries. For a more complete list of Cypress trademarks, visit cypress.com. Other names and brands may be
claimed as property of their respective owners.
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 2 of 198
Contents
Introduction .................................................................................................................................................................................... 7
CySmart Subsystem Overview .................................................................................................................................................... 7
CySmart APIs .............................................................................................................................................................................. 8
Dongle Communicator ................................................................................................................................................................. 8
Dongle Transport Channel .......................................................................................................................................................... 8
Development Platform ................................................................................................................................................................. 8
API Design ...................................................................................................................................................................................... 9
ICySmartDongleCommunicator ................................................................................................................................................. 10
ICyBleMgr .................................................................................................................................................................................. 10
ICyBleDevice ............................................................................................................................................................................. 10
ICyGattClient ............................................................................................................................................................................. 11
ICyL2CapMgr ............................................................................................................................................................................ 11
ICyL2CapChannel ..................................................................................................................................................................... 11
ICyBleDeviceList ....................................................................................................................................................................... 11
ICyBleSecurityMgr ..................................................................................................................................................................... 12
ICyBleDeviceAddressMgr .......................................................................................................................................................... 12
API Reference ............................................................................................................................................................................... 13
Enumeration Type Documentation ............................................................................................................................................ 13
CyAddressResolutionControlInfo............................................................................................................................................... 30
CyAddToResolvingListInfo ........................................................................................................................................................ 31
CyAdvertisementData................................................................................................................................................................ 32
CyAdvertisementDataItem ......................................................................................................................................................... 33
CyApiErr .................................................................................................................................................................................... 38
CyAuthenticationKeys ............................................................................................................................................................... 41
CyBleBdAddress ....................................................................................................................................................................... 43
CyBleConnectionSettings .......................................................................................................................................................... 45
CyBleDeviceCallback ................................................................................................................................................................ 50
CyBleMgrCallback ..................................................................................................................................................................... 54
CyBleScanSettings .................................................................................................................................................................... 59
CyBondListDevice ..................................................................................................................................................................... 64
CyChannelClassificationInfo ...................................................................................................................................................... 64
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 3 of 198
Contents
CyCharacteristicChangedInfo .................................................................................................................................................... 68
CyConnectInfo ........................................................................................................................................................................... 68
CyConnectionParameters .......................................................................................................................................................... 69
CyConnectResult ....................................................................................................................................................................... 71
CyConvertOctetToTimeInfo ....................................................................................................................................................... 72
CyConvertOctetToTimeResult ................................................................................................................................................... 73
CyCurrentConnectionParameters .............................................................................................................................................. 73
CyCurrentDataLength ................................................................................................................................................................ 74
CyDataLengthInfo ...................................................................................................................................................................... 75
CyDefaultDataLengthResult ...................................................................................................................................................... 76
CyDeviceAddressMgrCallback .................................................................................................................................................. 78
CyDeviceListCallback ................................................................................................................................................................ 80
CyDiscoverAllServicesResult..................................................................................................................................................... 83
CyDiscoverCharacteristicsByUUIDInfo ...................................................................................................................................... 84
CyDiscoverCharacteristicsCallback ........................................................................................................................................... 85
CyDiscoverCharacteristicsInfo ................................................................................................................................................... 86
CyDiscoverCharacteristicsResult ............................................................................................................................................... 87
CyDiscoverDescriptorsCallback ................................................................................................................................................. 88
CyDiscoverDescriptorsInfo ........................................................................................................................................................ 88
CyDiscoverDescriptorsResult .................................................................................................................................................... 90
CyDiscoverPrimaryServiceCallback........................................................................................................................................... 90
CyDiscoverPrimaryServicesByUUIDInfo.................................................................................................................................... 91
CyDiscoverPrimaryServicesResult ............................................................................................................................................ 92
CyDongleInfo ............................................................................................................................................................................. 92
CyEstablishL2CapChannelInfo .................................................................................................................................................. 94
CyFindIncludedServicesCallback .............................................................................................................................................. 96
CyFindIncludedServicesInfo ...................................................................................................................................................... 97
CyFindIncludedServicesResult .................................................................................................................................................. 98
CyGattAttribute .......................................................................................................................................................................... 98
CyGattCharacteristic ................................................................................................................................................................ 100
CyGattClientCallback ............................................................................................................................................................... 101
CyGattDescriptor ..................................................................................................................................................................... 105
CyGattExchangeMtuInfo .......................................................................................................................................................... 106
CyGattExchangeMtuResult...................................................................................................................................................... 107
CyGattIncludedService ............................................................................................................................................................ 108
CyGattReadInfo ....................................................................................................................................................................... 109
CyGattReadResult ................................................................................................................................................................... 111
CyGattService .......................................................................................................................................................................... 112
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 4 of 198
Contents
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 5 of 198
Contents
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 6 of 198
Introduction
CySmart™ is a Bluetooth® LE (BLE) host emulation tool for Windows PCs. The tool uses the
CySmart BLE dongle to emulate a Generic Access Profile (GAP) central device. The tool
provides an easy-to-use Graphical User Interface (GUI) to enable customers to test and debug
their Bluetooth LE peripheral applications. In addition to the GUI, the tool also provides C# APIs
to communicate with the dongle. These APIs allow custom GAP central applications to be
developed.
This document serves as the reference guide for the APIs exposed by the tool. The document
also captures the high level API design, development platform and general usage guidelines for
the APIs.
CySmart APIs
Dongle Communicator
Hardware Manager
Other Hardware Dongle Transport
Manager Channel
Modules (UART)
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 7 of 198
Introduction
CySmart APIs
The CySmart APIs module exposes the APIs to build custom GAP central applications. The
module is essentially a wrapper over the ‘Dongle Communicator’ module and abstracts the
complexities of the dongle communicator module. See API Design section for details about the
design.
Dongle Communicator
This module understands the CySmart BLE protocol and implements the protocol communication
state machine. This module is designed to be independent of the transport channel to the
CySmart BLE dongle.
Development Platform
The CySmart APIs are developed in C# and built for .NET framework 2.0. To use the CySmart
APIs, add reference to the followings CySmart DLLs in your C# project. The DLLs can be located
in the CySmart installation directory.
cybledonglecommunicator.dll
cybleautobase.dll
cyblecommonbase.dll
All CySmart APIs are defined under the CySmart.DongleCommunicator.API namespace in the
cybledonglecommunicator.dll. The other two DLLs contain data structure and utility methods
used by the API implementation.
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 8 of 198
API Design
CySmart APIs communicates with the CySmart dongle to perform a BLE operation. Due to the
nature of communication (interface with hardware), the APIs are asynchronous and uses
callback mechanism to report the result and status of an operation. Depending on the purpose of
the APIs, the APIs are categorized into multiple modules.
Each module defines its own callback interface and provides a mechanism to register the
callbacks. The callbacks need to be implemented by the API client. When implementing the
callback method, ensure that long running operations are not performed on the thread in which
the callback is invoked. If long running operations needs to performed, execute them on a
different thread.
ICySmartDongleCommunicator
ICyBleMgr
ICyBleDeviceAddressMgr
ICyBleDeviceList
ICyBleSecurityMgr
ICyBleDevice
ICyGattClient
ICyL2CapMgr
ICyL2CapChannel
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 9 of 198
API Design
ICySmartDongleCommunicator
This interface provides the following information about the CySmart BLE dongle and provides
access to the ICyBleMgr interface:
Device ID – Identifies whether the dongle supports BLE version 4.1 or 4.2
BLE stack version
Firmware version
Hardware version
Use CySmartDongleMgr class methods to get an instance of this interface.
ICyBleMgr
This interface represents the BLE manager and provides APIs to perform the following BLE GAP
central operations:
Scan
Connect
Set device IO capabilities
Register and Unregister L2CAP PSMs
Set Tx power level for advertisement and connection channel
Set host channel map
Set data length (BLE version 4.2 only)
Enable / Disable Privacy 1.2 (BLE version 4.2 only)
The interface also provides access to the following interfaces
ICyBleDevice
ICyBleDeviceList
ICyBleSecurityMgr
ICyBleDeviceAddressMgr
ICyBleDevice
An instance of this interface is created when a connection with a peer device is established. This
interface represents an active connection with a peer device. This interface provides the
following information about the peer device
Device address
Connection handle
The interface provides APIs to perform the following operations:
Pair
Update data length (BLE version 4.2 only)
Update connection parameters
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 10 of 198
API Design
ICyGattClient
This represents the GATT client interface of the connected peer BLE device. This interface
provides APIs to perform the following operations
Negotiate GATT MTU size
Discover services and characteristics
Read and write characteristics
Read and write characteristic descriptors
Receive notifications and indications
ICyL2CapMgr
This represents the L2CAP Credit Based Flow Control (CBFC) channel manager interface for the
connected peer BLE device. This interface provides APIs to perform the following operations:
Create new L2CAP channel
Accept L2CAP channel request from peer device
Disconnect L2CAP channels
Send and receive data
Send and receive flow control credits
This interface provides access to the ICyL2CapChannel interface.
ICyL2CapChannel
An instance of this interface is created when an L2CAP CBFC channel is created. This
represents an active L2CAP channel. This interface provides the following information about the
channel
Channel ID
Local MTU and MPS size
Remote MTU and MPS size
ICyBleDeviceList
This interface represents the device list manager and provides APIs to manage the following lists
in the CySmart dongle:
Whitelist
o Add, remove and clear whitelist
o Get devices in the whitelist
Bond list
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 11 of 198
API Design
ICyBleSecurityMgr
This interface represents the security manager of the CySmart dongle and provides APIs to
perform the following operations
Get and set security keys (LTK, IRK, CSRK)
Generate new security keys
Get security keys of previously bonded devices
Generate ECDH keys (BLE version 4.2 only)
Generate OOB data for secure connection pairing (BLE version 4.2 only)
ICyBleDeviceAddressMgr
This interface provides APIs to manage the CySmart dongle address. The following operations
can be performed using the APIs
Get and set dongle address
Generate address based on address type
Set dongle identity address
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 12 of 198
API Reference
Enumeration of response for connection parameter update request from remote device
Enumerator
ACCEPT Accept the new connection parameters requested by the remote device
REJECT Reject the new connection parameters requested by the remote device
enum CySecurityLevel[strong]
Enumerator
NO_SECURITY No security (no authentication and no encryption)
AUTHENTICATED_LE_SECURE_CONNECTION_PAIRING_WITH_ENCRYPTION Authenticated
LE secure connection pairing with encryption
Pairing properties
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 13 of 198
API Reference
Enumerator
NONE None
Enumerator
DIGIT_ENTERED A passkey digit is entered by the user
Enumerator
REJECT Reject request
Enumerator
NONE Unknown This is the initial state for a characteristic
BROADCAST Broadcast
READ Read
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 14 of 198
API Reference
WRITE Write
NOTIFY Notify
INDICATE Indicate
Enumeration of responses
Enumerator
CONNECTION_SUCCESSFUL Connection successful
Enumerator
SUCCESS Success
COMMAND_TIMEOUT Command timeout. If the L2CAP signaling timeout occurs, the application should
disconnect
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 15 of 198
API Reference
enum CyScanStatus[strong]
Scan status
Enumerator
IN_PROGRESS Scan is in-progress
Enumerator
PUBLIC Use public address
Enumerator
PASSIVE_SCAN Passive scan
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 16 of 198
API Reference
Enumerator
ACCEPT_ALL_ADV Accept all advertisement packets except directed advertising packets not addressed to
this device
Enumerator
DISABLE_DUPLICATE_FILTERING Disable duplicate filtering
Enumerator
OBSERVATION_PROCEDURE Observation procedure - This procedure needs to be used to discover
directed advertisements
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 17 of 198
API Reference
Enumerator
USE_PEER_DEVICE_ADDRESS Use the peer device address specified in the connection request. Whitelist
is ignored
USE_WHITE_LIST Whitelist is used to determine which advertiser to connect to. Peer device address in
the connection request is ignored
Enumerator
DISPLAY_ONLY Display only
UNKNOWN Unknown
Enumerator
PUBLIC_ADDRESS Public address
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 18 of 198
API Reference
Enumerator
RANDOM_NON_RESOLVABLE Random non-resolvable Bluetooth device address
Enumerator
ADV_CHANNEL Advertisement channel
Enumerator
PWR_LEVEL_NEG_18_DBM -18 dBm
PWR_LEVEL_NEG_6_DBM -6 dBm
PWR_LEVEL_NEG_3_DBM -3 dBm
PWR_LEVEL_NEG_2_DBM -2 dBm
PWR_LEVEL_NEG_1_DBM -1 dBm
PWR_LEVEL_0_DBM 0 dBm
PWR_LEVEL_3_DBM 3 dBm
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 19 of 198
API Reference
Enumerator
PHY_1MBPS 1 Mbps physical layer
Enumerator
NONE No keys are exchanged
SHARE_ALL Initiator distributes all the keys and also requests the responder to distribute all keys
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 20 of 198
API Reference
Enumerator
RESOLVED Peer device address was resolved and matches with an existing bonded device
NOT_RESOLVED Peer device address resolution failed or did not match with a device in the bond list
Dongle ID enumeration
Enumerator
UNKNOWN Unknown dongle
Enumerator
BLE_STATUS_OK Status OK
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 21 of 198
API Reference
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 22 of 198
API Reference
BLE_ERROR_HCI_SYNCHRONOUS_CONNECTION_LIMIT_TO_A_DEVICE_EXCEEDED
Synchronous Connection Limit to a Device Exceeded
BLE_ERROR_HCI_CONNECTION_REJECTED_DUE_TO_LIMITED_RESOURCES Connection
Rejected Due to Limited Resources
BLE_ERROR_HCI_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS Connection
Rejected Due to Security Reasons
BLE_ERROR_HCI_CONNECTION_REJECTED_DUE_TO_UNACCEPTABLE_BD_ADDR
Connection Rejected Due to Unacceptable Bluetooth device Address
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 23 of 198
API Reference
BLE_ERROR_HCI_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOUR
CES Remote Device Terminated Connection Due to Low Resources
BLE_ERROR_HCI_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_POWER_OFF
Remote Device Terminated Connection Due to Power Off
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 24 of 198
API Reference
BLE_ERROR_HCI_LMP_PDU_NOT_ALLOWED LMP_PDU_NOT_ALLOWED
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 25 of 198
API Reference
BLE_ERROR_HCI_CONNECTION_REJECTED_DUE_TO_NO_SUITABLE_CHANNEL_FOUND
Connection Rejected due to No Suitable Channel Found
BLE_ERROR_HCI_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE Connection
Terminated due to MIC Failure
BLE_ERROR_GATT_INVALID_HANDLE The attribute handle given was not valid on this server
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 26 of 198
API Reference
BLE_ERROR_GATT_HRS_CPT_NOT_SUPPORTED
BLE_ERROR_GATT_CCD_IMPROPERLY_CONFIGURED
BLE_ERROR_GATT_PROCEDURE_ALREADY_IN_PROGRESS
BLE_ERROR_GATT_OUT_OF_RANGE
BLE_ERROR_GATT_OPERATION_TIMEOUT
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 27 of 198
API Reference
BLE_ERROR_OPERATION_CANCELLED
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 28 of 198
API Reference
BLE_ERROR_L2CAP_CONNECTION_REFUSED_INSUFFICIENT_AUTHENTICATION
Connection refused - Insufficient authentication
BLE_ERROR_L2CAP_CONNECTION_REFUSED_INSUFFICIENT_AUTHORIZATION Connection
refused - Insufficient authorization
BLE_ERROR_L2CAP_CONNECTION_REFUSED_INSUFFICIENT_ENCRYPTION_KEY_SIZE
Connection refused - Insufficient encryption key size
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 29 of 198
API Reference
CyAddressResolutionControlInfo
Properties
□ bool Enable [get]
Gets whether the address resolution in controller should be enabled or disabled
Detailed Description
Holds the information necessary to enable / disable address resolution in controller
Parameters:
enable True to enable address resolution; False to disable address
resolution
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 30 of 198
API Reference
Property Documentation
bool Enable[get]
CyAddToResolvingListInfo
Properties
□ CyBleBdAddress PeerIdAddress [get]
Gets the ID address of the peer device to be added to the resolving list
□ byte[] PeerIRK [get]
Gets the peer device IRK
□ byte[] LocalIRK [get]
Gets the local device IRK
Detailed Description
Holds the information necessary to add a device to the resolving list
Parameters:
peerIdAddres Peer device ID address
s
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 31 of 198
API Reference
Property Documentation
CyBleBdAddress PeerIdAddress[get]
Gets the ID address of the peer device to be added to the resolving list
byte [] PeerIRK[get]
byte [] LocalIRK[get]
CyAdvertisementData
Properties
□ CyBleAdvEventType AdvertisementType [get]
Gets the advertisement type
□ List< CyAdvertisementDataItem > Items [get]
Gets the advertisement data items
□ byte[] RawData [get]
Gets the raw advertisement or scan data
Detailed Description
Represents advertisement or scan response data
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 32 of 198
API Reference
Property Documentation
CyBleAdvEventType AdvertisementType[get]
List<CyAdvertisementDataItem> Items[get]
byte [] RawData[get]
CyAdvertisementDataItem
Public Attributes
□ const byte FLAGS = 0x01
Flags
□ const byte INCOMPLETE_16_BIT_SERVICE_UUID = 0x02
Incomplete List of 16-bit Service Class UUIDs
□ const byte COMPLETE_16_BIT_SERVICE_UUID = 0x03
Complete List of 16-bit Service Class UUIDs
□ const byte INCOMPLETE_32_BIT_SERVICE_UUID = 0x04
Incomplete List of 32-bit Service Class UUIDs
□ const byte COMPLETE_32_BIT_SERVICE_UUID = 0x05
Complete List of 32-bit Service Class UUIDs
□ const byte INCOMPLETE_128_BIT_SERVICE_UUID = 0x06
Incomplete List of 128-bit Service Class UUIDs
□ const byte COMPLETE_128_BIT_SERVICE_UUID = 0x07
Complete List of 128-bit Service Class UUIDs
□ const byte SHORTENED_LOCAL_NAME = 0x08
Shortened Local Name
□ const byte COMPLETE_LOCAL_NAME = 0x09
Complete Local Name
□ const byte TX_POWER_LEVEL = 0x0A
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 33 of 198
API Reference
Tx Power Level
□ const byte DEVICE_ID = 0x10
Device ID
□ const byte SLAVE_CONNECTION_INTERVAL_RANGE = 0x12
Slave Connection Interval Range
□ const byte SERVICE_SOLICITATION_16_BIT_UUID = 0x14
List of 16-bit Service Solicitation UUIDs
□ const byte SERVICE_SOLICITATION_32_BIT_UUID = 0x1F
List of 32-bit Service Solicitation UUIDs
□ const byte SERVICE_SOLICITATION_128_BIT_UUID = 0x15
List of 128-bit Service Solicitation UUIDs
□ const byte SERVICE_DATA_16_BIT_UUID = 0x16
Service Data - 16-bit UUID
□ const byte SERVICE_DATA_32_BIT_UUID = 0x20
Service Data - 32-bit UUID
□ const byte SERVICE_DATA_128_BIT_UUID = 0x21
Service Data - 128-bit UUID
□ const byte PUBLIC_TARGET_ADDRESS = 0x17
Public Target Address
□ const byte RANDOM_ADDRESS = 0x18
Random Target Address
□ const byte APPEARANCE = 0x19
Appearance
□ const byte ADVERTISING_INTERVAL = 0x1A
Advertising Interval
□ const byte LE_BLUETOOTH_DEVICE_ADDRESS = 0x1B
LE Bluetooth Device Address
□ const byte LE_ROLE = 0x1C
LE Role
□ const byte URI = 0x24
URI
□ const byte MANUFACTURER_SPECIFIC_DATA = 0xFF
Manufacturer Specific Data
Properties
□ int Type [get]
Gets the advertisement item type
□ int Length [get]
Gets the advertisement data item length
□ List< byte > Data [get]
Gets the advertisement item data
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 34 of 198
API Reference
Detailed Description
Represents an item in the advertisement data
Flags
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 35 of 198
API Reference
Tx Power Level
Device ID
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 36 of 198
API Reference
Appearance
Advertising Interval
LE Role
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 37 of 198
API Reference
URI
Property Documentation
int Type[get]
int Length[get]
List<byte> Data[get]
CyApiErr
Public Attributes
□ const int ID_OK = 0
□ const int ID_FAIL = -1
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 38 of 198
API Reference
Properties
□ StackTrace [get]
Get the stack trace at the point where the CyApiErr was created.
□ bool HasStackTrace [get]
Return true if the CyApiErr captured the stack.
□ Exception WrappedException [get]
Get the wrapped exception. Will return null if no exception was wrapped.
□ bool HasWrappedException [get]
Returns true if the CyApiErr is wrapping an exception.
□ int ErrorId [get]
□ string Message [get]
Get the message from a CyApiErr.
□ static CyApiErr Ok [get]
The cannonical "Ok" CyApiErr. When reporting success, always return CyApiErr.Ok.
□ static CyApiErr OK [get]
An alias for "Ok".
□ bool IsOk [get]
Check to see if the CyApiErr is the cannonical "Ok" instance. Used to indicate success.
□ bool IsOK [get]
An alias for "IsOk".
□ bool IsNotOk [get]
Check to see if the CyApiErr is not the canonical "Ok" instance. Used to indicate failure.
□ bool IsNotOK [get]
An alias for "IsNotOk".
Detailed Description
Indicate success or failure, and if failure, what was the cause.
CyApiErr may contain an exception, a string message, and an integer ID. A CyApiErr instances has been pre-created
to represent Ok. It is available as CyApiErr.Ok.
CyApiErr can also wrap exceptions. If no message is explicitly specified with the error, the exceptions message is
adopted by the wrapping CyApiErr instance.
Stringify a CyApiErr.
Returns:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 39 of 198
API Reference
Property Documentation
StackTrace StackTrace[get]
Get the stack trace at the point where the CyApiErr was created.
bool HasStackTrace[get]
Exception WrappedException[get]
Get the wrapped exception. Will return null if no exception was wrapped.
bool HasWrappedException[get]
string Message[get]
The cannonical "Ok" CyApiErr. When reporting success, always return CyApiErr.Ok.
bool IsOk[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 40 of 198
API Reference
Check to see if the CyApiErr is the cannonical "Ok" instance. Used to indicate success.
bool IsOK[get]
bool IsNotOk[get]
Check to see if the CyApiErr is not the canonical "Ok" instance. Used to indicate failure.
bool IsNotOK[get]
CyAuthenticationKeys
Properties
□ CyAuthenticationKeyFlags KeyFlags [get]
Keys to be exchanged between the pairing initiator and responder
□ byte[] LTK [get]
Gets the 16-byte Long Term Key (LTK)
□ byte[] MasterIDKeys [get]
Gets the 10-byte Master Identification Keys - Encryption Diversifier (EDIV) and a Random number
□ byte[] IRK [get]
Gets the 16-byte Identity Resolution Key (IRK)
□ byte[] CSRK [get]
Gets the 16-byte Connection data Signature Resolution Key (CSRK)
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 41 of 198
API Reference
Detailed Description
Holds the authentication keys
Parameters:
keyFlags Keys to be exchanged between initiator and responder
during pairing
Property Documentation
CyAuthenticationKeyFlags KeyFlags[get]
byte [] LTK[get]
byte [] MasterIDKeys[get]
Gets the 10-byte Master Identification Keys - Encryption Diversifier (EDIV) and a Random number
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 42 of 198
API Reference
byte [] IRK[get]
byte [] CSRK[get]
CyBleBdAddress
Public Attributes
□ const ulong MAX_ADDRESS = (ulong.MaxValue & ADDR_MASK)
Maximum value for the address
□ const ulong MIN_ADDRESS = ulong.MinValue
Minimum value for the address
Properties
□ CyBleBdAddressType AddressType [get]
Gets the address type
□ ulong Address [get]
Gets the address
Detailed Description
Represents the Bluetooth device address
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 43 of 198
API Reference
Parameters:
address Bluetooth device address The address should be within
0x000000000000 and 0xFFFFFFFFFFFF (inclusive)
Parameters:
obj Bluetooth device address
Returns:
True if equal; otherwise, false
Returns:
Hash code
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 44 of 198
API Reference
Property Documentation
CyBleBdAddressType AddressType[get]
ulong Address[get]
CyBleConnectionSettings
Public Attributes
□ const ushort DEFAULT_MINIMUM_CONNECTION_INTERVAL = 0x0006
Default minimum connection interval
□ const ushort DEFAULT_MAXIMUM_CONNECTION_INTERVAL = 0x0006
Default maximum connection interval
□ const ushort DEFAULT_SLAVE_LATENCY = 0x0000
Default slave latency
□ const ushort DEFAULT_SUPERVISION_TIMEOUT = 0x000A
Default supervision timeout
□ const CyConnectionInitiatorFilterPolicy DEFAULT_INITIATOR_FILTER_POLICY
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 45 of 198
API Reference
Properties
□ ushort MinimumConnectionInterval [get]
Gets the minimum connection interval
□ ushort MaximumConnectionInterval [get]
Gets the maximum connection interval
□ ushort SlaveLatency [get]
Gets the slave latency
□ ushort ConnectionSupervisionTimeout [get]
Gets the connection supervision timeout
□ CyConnectionInitiatorFilterPolicy ConnectionInitiatorFilterPolicy [get]
Gets the connection initiator filter policy
□ CyInitiatorAddrType ConnectionInitiatorBdAddrType [get]
Gets the connection initiator Bluetooth address type
□ ushort MinimumCeLength [get]
Gets the minimum CE length
□ ushort MaximumCeLength [get]
Gets the maximum CE length
□ ushort ConnectionScanInterval [get]
Gets the connection scan interval
□ ushort ConnectionScanWindow [get]
Gets the connection scan window
Detailed Description
Holds the settings to be used for connection establishment
CyBleConnectionSettings ()
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 46 of 198
API Reference
Parameters:
minConnectio minimum connection interval
nInterval
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 47 of 198
API Reference
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 48 of 198
API Reference
Property Documentation
ushort MinimumConnectionInterval[get]
ushort MaximumConnectionInterval[get]
ushort SlaveLatency[get]
ushort ConnectionSupervisionTimeout[get]
CyConnectionInitiatorFilterPolicy ConnectionInitiatorFilterPolicy[get]
CyInitiatorAddrType ConnectionInitiatorBdAddrType[get]
ushort MinimumCeLength[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 49 of 198
API Reference
ushort MaximumCeLength[get]
ushort ConnectionScanInterval[get]
ushort ConnectionScanWindow[get]
CyBleDeviceCallback
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 50 of 198
API Reference
Detailed Description
Device callback Defines device specific method callbacks
Parameters:
request New connection parameters requested by the remote
device
Use ICyBleDevice.SendConnectionParametersResponse method to send the response
Parameters:
status Status of ICyBleDevice.UpdateConnectionParameter
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 51 of 198
API Reference
Parameters:
status Status of ICyBleDevice.SetDataLength
Parameters:
dataLength Current data length for the connection
Parameters:
settings Remote device pairing settings
Parameters:
settings Negotiated pair settings
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 52 of 198
API Reference
Parameters:
response Contains the response for passkey entry request
Use ICyBleDevice.SendPasskeyResponse to send the response
Parameters:
info Passkey to be displayed
Parameters:
response Contains the numeric comparison request details and the
response for the request
Use ICyBleDevice.SendNumericComparisonResponse to send the response
Parameters:
status Status of ICyBleDevice.SendKeyPressNotification
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 53 of 198
API Reference
Parameters:
status Status of ICyBleDevice.SetOob
CyBleMgrCallback
BLE manager callback The interface defines callback methods which needs to be implemented
by the API client
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 54 of 198
API Reference
Detailed Description
BLE manager callback The interface defines callback methods which needs to be implemented by the API client
Parameters:
status Status of the ICyBleMgr.SetDeviceIoCapabilities method
execution
Parameters:
ioCapabilities IO capabilities of the local device
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 55 of 198
API Reference
This callback reports the RSSI and the status of the ICyBleMgr.GetRSSI method
Parameters:
rssi RSSI of the last received packet This field is valid only if the
status is OK
This callback reports the result and status of the ICyBleMgr.Connect method
Parameters:
result Contains the connection result if the status is OK;
otherwise is null
Parameters:
status Status of the ICyBleMgr.CancelConnection method
execution
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 56 of 198
API Reference
Parameters:
psm Registered PSM
Parameters:
status Status of the ICyBleMgr.UnregisterPsm method execution
Parameters:
status Status of the ICyBleMgr.SetHostChannelClassification
method execution
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 57 of 198
API Reference
Parameters:
result Channel power level
Parameters:
result Default data length of the local device (dongle)
Parameters:
status Status of the ICyBleMgr.SetSuggestedDataLength method
execution
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 58 of 198
API Reference
Parameters:
result Contains the conversion result if status is OK; Otherwise
is null
Parameters:
status Status of ICyBleMgr.SetResolvableAddressTimeout
Parameters:
status Status of ICyBleMgr.SetAddressResolutionControl
CyBleScanSettings
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 59 of 198
API Reference
Public Attributes
□ const CyScanType DEFAULT_SCAN_TYPE = CyScanType.ACTIVE_SCAN
Default scan type
□ const ushort DEFAULT_SCAN_INTERVAL = 0x0010
Default scan interval
□ const ushort DEFAULT_SCAN_WINDOW = 0x0010
Default scan window
□ const CyInitiatorAddrType DEFAULT_SCAN_OWN_ADDRESS_TYPE = CyInitiatorAddrType.PUBLIC
Default own Bluetooth address type
□ const CyScanInitiatorFilterPolicy DEFAULT_INITIATOR_FILTER_POLICY =
CyScanInitiatorFilterPolicy.ACCEPT_ALL_ADV
Default initiator filter policy
□ const CyDiscoveryType DEFAULT_DISCOVERY_TYPE = CyDiscoveryType.OBSERVATION_PROCEDURE
Default discovery procedure
□ const ushort DEFAULT_SCAN_TIMEOUT = 0
Default scan timeout
□ const CyScanDuplicateFilterPolicy DEFAULT_DUPLICATE_FILTER_POLICY
Default duplicate filter policy
Properties
□ CyScanType ScanType [get]
Gets the scan type
□ ushort ScanInterval [get]
Gets the scan interval
□ ushort ScanWindow [get]
Gets the scan window
□ CyInitiatorAddrType ScanOwnBdAddrType [get]
Gets the own bluetooth address type to be used for scan
□ CyScanInitiatorFilterPolicy InitiatorFilterPolicy [get]
Gets the scan initiator filter policy
□ CyDiscoveryType ScanProcedureType [get]
Gets the scan procedure type
□ ushort ScanTimeout [get]
Gets the scan timeout in seconds
□ CyScanDuplicateFilterPolicy DuplicateFilterPolicy [get]
Gets the scan duplicate filtering policy
Detailed Description
Holds the scan settings
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 60 of 198
API Reference
CyBleScanSettings ()
Parameters:
scanType scan type
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 61 of 198
API Reference
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 62 of 198
API Reference
Property Documentation
CyScanType ScanType[get]
ushort ScanInterval[get]
ushort ScanWindow[get]
CyInitiatorAddrType ScanOwnBdAddrType[get]
CyScanInitiatorFilterPolicy InitiatorFilterPolicy[get]
CyDiscoveryType ScanProcedureType[get]
ushort ScanTimeout[get]
CyScanDuplicateFilterPolicy DuplicateFilterPolicy[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 63 of 198
API Reference
CyBondListDevice
Properties
□ CyBleBdAddress DeviceAddress [get]
Gets the device address
□ byte DeviceHandle [get]
Gets the device handle
Detailed Description
Represents a device in the bond list
Property Documentation
CyBleBdAddress DeviceAddress[get]
byte DeviceHandle[get]
CyChannelClassificationInfo
Public Types
□ enum Channels : ulong { NONE = 0x0000000000, CHANNEL_00 = 0x0000000001, CHANNEL_01 = 0x0000000002,
CHANNEL_02 = 0x0000000004, CHANNEL_03 = 0x0000000008, CHANNEL_04 = 0x0000000010, CHANNEL_05 =
0x0000000020, CHANNEL_06 = 0x0000000040, CHANNEL_07 = 0x0000000080, CHANNEL_08 = 0x0000000100,
CHANNEL_09 = 0x0000000200, CHANNEL_10 = 0x0000000400, CHANNEL_11 = 0x0000000800, CHANNEL_12 =
0x0000001000, CHANNEL_13 = 0x0000002000, CHANNEL_14 = 0x0000004000, CHANNEL_15 = 0x0000008000,
CHANNEL_16 = 0x0000010000, CHANNEL_17 = 0x0000020000, CHANNEL_18 = 0x0000040000, CHANNEL_19 =
0x0000080000, CHANNEL_20 = 0x0000100000, CHANNEL_21 = 0x0000200000, CHANNEL_22 = 0x0000400000,
CHANNEL_23 = 0x0000800000, CHANNEL_24 = 0x0001000000, CHANNEL_25 = 0x0002000000, CHANNEL_26 =
0x0004000000, CHANNEL_27 = 0x0008000000, CHANNEL_28 = 0x0010000000, CHANNEL_29 = 0x0020000000,
CHANNEL_30 = 0x0040000000, CHANNEL_31 = 0x0080000000, CHANNEL_32 = 0x0100000000, CHANNEL_33 =
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 64 of 198
API Reference
Properties
□ Channels ChannelClassification [get]
Gets the channel classification
Detailed Description
Holds the information necessary to modify the host channel classification
Enumeration of channels Two or more channels can be selected by OR'ing the corresponding channel enumeration
Enumerator
NONE No channels selected
CHANNEL_00 Channel 00
CHANNEL_01 Channel 01
CHANNEL_02 Channel 02
CHANNEL_03 Channel 03
CHANNEL_04 Channel 04
CHANNEL_05 Channel 05
CHANNEL_06 Channel 06
CHANNEL_07 Channel 07
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 65 of 198
API Reference
CHANNEL_08 Channel 08
CHANNEL_09 Channel 09
CHANNEL_10 Channel 10
CHANNEL_11 Channel 11
CHANNEL_12 Channel 12
CHANNEL_13 Channel 13
CHANNEL_14 Channel 14
CHANNEL_15 Channel 15
CHANNEL_16 Channel 16
CHANNEL_17 Channel 17
CHANNEL_18 Channel 18
CHANNEL_19 Channel 19
CHANNEL_20 Channel 20
CHANNEL_21 Channel 21
CHANNEL_22 Channel 22
CHANNEL_23 Channel 23
CHANNEL_24 Channel 24
CHANNEL_25 Channel 25
CHANNEL_26 Channel 26
CHANNEL_27 Channel 27
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 66 of 198
API Reference
CHANNEL_28 Channel 28
CHANNEL_29 Channel 29
CHANNEL_30 Channel 30
CHANNEL_31 Channel 31
CHANNEL_32 Channel 32
CHANNEL_33 Channel 33
CHANNEL_34 Channel 34
CHANNEL_35 Channel 35
CHANNEL_36 Channel 36
Parameters:
channelClassi Channel classification It is mandatory that at least one
fication channel is selected
Property Documentation
Channels ChannelClassification[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 67 of 198
API Reference
CyCharacteristicChangedInfo
Holds the information of the characteristic value changed as a result of notification or indication
Properties
□ ushort Handle [get]
Gets the handle of the changed characteristic
□ byte[] Value [get]
Gets the changed value
Detailed Description
Holds the information of the characteristic value changed as a result of notification or indication
Property Documentation
ushort Handle[get]
byte [] Value[get]
CyConnectInfo
Properties
□ CyBleBdAddress PeerDeviceAddress [get]
Gets the address of the peer device to be connected
□ CyBleConnectionSettings Settings [get]
Gets the connection settings
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 68 of 198
API Reference
Detailed Description
Holds the information necessary to connect to a BLE device
Parameters:
peerDeviceAd Address of the peer device to be connected
dress
Property Documentation
CyBleBdAddress PeerDeviceAddress[get]
CyBleConnectionSettings Settings[get]
CyConnectionParameters
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 69 of 198
API Reference
Properties
□ ushort ConnectionIntervalMinimum [get]
Gets the minimum value for the connection interval
□ ushort ConnectionIntervalMaximum [get]
Gets the maximum value for the connection interval
□ ushort SlaveLatency [get]
Gets the slave latency for the connection in number of connection events
□ ushort SupervisionTimeout [get]
Gets the supervision timeout for the LE link
Detailed Description
Connection parameter settings
Parameters:
connectionInt Minimum value for the connection interval This shall be less
ervalMin than or equal to connectionIntervalMax
Range: 0x0006 to 0x0C80 Time: N * 1.25 ms; where N is the connection interval value
Parameters:
connectionInt Maximum value for the connection interval. This shall be
ervalMax greater than or equal to connectionIntervalMin
Range: 0x0006 to 0x0C80 Time: N * 1.25 ms; where N is the connection interval value
Parameters:
slaveLatency Slave latency for the connection in number of connection
events Range: 0x0000 to 0x01F3
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 70 of 198
API Reference
Property Documentation
ushort ConnectionIntervalMinimum[get]
ushort ConnectionIntervalMaximum[get]
ushort SlaveLatency[get]
Gets the slave latency for the connection in number of connection events
ushort SupervisionTimeout[get]
CyConnectResult
Properties
□ ICyBleDevice Device [get]
Gets the connected device instance
Detailed Description
Holds the connection result
Property Documentation
ICyBleDevice Device[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 71 of 198
API Reference
CyConvertOctetToTimeInfo
Properties
□ CyPhyType PhysicalLayerType [get]
Gets the physical layer type
□ ushort Octet [get]
Gets the octet value to be converted
Detailed Description
Holds the information necessary to convert octet to time
Parameters:
octet Octet value to be converted
Property Documentation
CyPhyType PhysicalLayerType[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 72 of 198
API Reference
ushort Octet[get]
CyConvertOctetToTimeResult
Properties
□ ushort Octet [get]
Gets the octet value that was converted
□ ushort Time [get]
Gets the converted time value in µs
Detailed Description
Holds the result of the octet to time conversion
Property Documentation
ushort Octet[get]
ushort Time[get]
CyCurrentConnectionParameters
Properties
□ ushort ConnectionInterval [get]
Gets the connection interval
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 73 of 198
API Reference
Detailed Description
Holds the current connection parameters
Property Documentation
ushort ConnectionInterval[get]
ushort SlaveLatency[get]
Gets the slave latency for the connection in number of connection events
ushort SupervisionTimeout[get]
CyCurrentDataLength
Properties
□ ushort ConnectionMaximumTxOctets [get]
Gets the maximum Tx octet size for the current connection
□ ushort ConnectionMaximumTxTime [get]
Gets the maximum Tx time (in µs) for the current connection
□ ushort ConnectionMaximumRxOctets [get]
Gets the maximum Rx octet size for the current connection
□ ushort ConnectionMaximumRxTime [get]
Gets the maximum Rx time (in µs) for the current connection
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 74 of 198
API Reference
Detailed Description
Holds the current data length
Property Documentation
ushort ConnectionMaximumTxOctets[get]
ushort ConnectionMaximumTxTime[get]
Gets the maximum Tx time (in µs) for the current connection
ushort ConnectionMaximumRxOctets[get]
ushort ConnectionMaximumRxTime[get]
Gets the maximum Rx time (in µs) for the current connection
CyDataLengthInfo
Holds the information necessary to change the data length for the current connection
Properties
□ ushort MaxTxOctets [get]
Gets the preferred maximum Tx octet size for the connection
□ ushort MaxTxTime [get]
Gets the preferred maximum Tx time (in µs) for the connection
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 75 of 198
API Reference
Detailed Description
Holds the information necessary to change the data length for the current connection
Parameters:
maxTxOctets Preferred maximum Tx octet size for the connection
maxTxTime Preferred maximum Tx time (in µs) for the connection Use
ICyBleMgr.ConvertDataLengthOctetToTime API to convert
octet to time
Property Documentation
ushort MaxTxOctets[get]
ushort MaxTxTime[get]
Gets the preferred maximum Tx time (in µs) for the connection
CyDefaultDataLengthResult
Properties
□ ushort SuggestedMaxTxOctets [get]
Gets the suggested data octet size to be used for new connections
□ ushort SuggestedMaxTxTime [get]
Gets the suggested data transmission time (in µs) for new connections
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 76 of 198
API Reference
Detailed Description
Holds the default data length of the local device (dongle)
Property Documentation
ushort SuggestedMaxTxOctets[get]
Gets the suggested data octet size to be used for new connections
ushort SuggestedMaxTxTime[get]
Gets the suggested data transmission time (in µs) for new connections
ushort SupportedMaxTxOctets[get]
ushort SupportedMaxTxTime[get]
ushort SupportedMaxRxTime[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 77 of 198
API Reference
CyDeviceAddressMgrCallback
Device address manager callback The interface defines callback methods which needs to be
implemented by the API client
Detailed Description
Device address manager callback The interface defines callback methods which needs to be implemented by the API
client
Parameters:
result Contains the generated Bluetooth device address, if status
is OK; otherwise is null
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 78 of 198
API Reference
Parameters:
address Contains the Bluetooth device address of the local device,
if status is OK; otherwise is null
Parameters:
status Status of the ICyBleDeviceAddressMgr.SetBdAddress
method execution
Parameters:
status Status of the ICyBleDeviceAddressMgr.SetIdAddress
method execution
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 79 of 198
API Reference
Parameters:
result Contains the resolvable private address of the peer device,
if status is OK; otherwise is null
Parameters:
result Contains the resolvable private address of the local device,
if status is OK; otherwise is null
CyDeviceListCallback
Device list callback Defines callback method from device list APIs
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 80 of 198
API Reference
Detailed Description
Device list callback Defines callback method from device list APIs
Parameters:
device Contains the device added to the whitelist, if status is OK;
Otherwise is null
Parameters:
status Status of ICyBleDeviceList.RemoveDeviceFromWhitelist
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 81 of 198
API Reference
Parameters:
status Status of ICyBleDeviceList.ClearWhitelist
Parameters:
whitelist Contains the devices in the whitelist, if status is OK;
Otherwise is null
Parameters:
bondList Contains the devices in the bond list, if status is OK;
Otherwise is null
Parameters:
device Resolving list device
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 82 of 198
API Reference
Parameters:
status Status of
ICyBleDeviceList.RemoveDeviceFromResolvingList
Parameters:
status Status of ICyBleDeviceList.ClearResolvingList
Parameters:
resolvingList Contains the devices in the resolving list, if status is OK;
Otherwise is null
CyDiscoverAllServicesResult
Properties
□ List< CyGattService > Services [get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 83 of 198
API Reference
Detailed Description
Holds the result of service discovery
Property Documentation
List<CyGattService> Services[get]
CyDiscoverCharacteristicsByUUIDInfo
Properties
□ CyUUID UUID [get]
□ ushort StartHandle [get]
Gets the start handle to begin the discovery
□ ushort EndHandle [get]
Gets the end handle to stop the discovery
Detailed Description
Holds the information necessary to discover characteristics by UUID
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 84 of 198
API Reference
Parameters:
uuid UUID of the characteristic to be discovered
Property Documentation
CyUUID UUID[get]
Gets the UUID of the characteristics to be discovered
ushort StartHandle[get]
ushort EndHandle[get]
CyDiscoverCharacteristicsCallback
Detailed Description
Defines the callback methods for characteristic discovery
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 85 of 198
API Reference
Parameters:
result Characteristics discovered
CyDiscoverCharacteristicsInfo
Properties
□ ushort StartHandle [get]
Gets the starting handle to begin the characteristic discovery
□ ushort EndHandle [get]
Gets the end handle to stop the characteristic discovery
Detailed Description
Holds the information necessary to discover characteristics
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 86 of 198
API Reference
Parameters:
startHandle Start handle This is typically set to a service start handle
Property Documentation
ushort StartHandle[get]
ushort EndHandle[get]
CyDiscoverCharacteristicsResult
Properties
□ List< CyGattCharacteristic > Characteristics [get]
Gets the list of discovered characteristics
Detailed Description
Holds the result of characteristic discovery
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 87 of 198
API Reference
Property Documentation
List<CyGattCharacteristic> Characteristics[get]
CyDiscoverDescriptorsCallback
Detailed Description
Defines the callback methods for descriptor discovery
Parameters:
result Descriptors discovered
CyDiscoverDescriptorsInfo
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 88 of 198
API Reference
Properties
□ ushort StartHandle [get]
Gets the start handle to begin the discovery
□ ushort EndHandle [get]
Gets the end handle to stop the discovery
Detailed Description
Holds the information necessary to discover descriptors
Parameters:
startHandle Start handle This is typically set to the characteristic value
handle + 1
Property Documentation
ushort StartHandle[get]
ushort EndHandle[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 89 of 198
API Reference
CyDiscoverDescriptorsResult
Properties
□ List< CyGattDescriptor > Descriptors [get]
Gets the list of discovered descriptors
Detailed Description
Holds the result of descriptor discovery
Property Documentation
List<CyGattDescriptor> Descriptors[get]
CyDiscoverPrimaryServiceCallback
Detailed Description
Defines the callback methods for primary service discovery
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 90 of 198
API Reference
Parameters:
services Primary services discovered
CyDiscoverPrimaryServicesByUUIDInfo
Properties
□ CyUUID UUID [get]
Gets the UUID of the primary service to be discovered
Detailed Description
Holds the information necessary to discover primary services by UUID
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 91 of 198
API Reference
Parameters:
uuid UUID of the primary service to be discovered
Property Documentation
CyUUID UUID[get]
CyDiscoverPrimaryServicesResult
Properties
□ List< CyGattService > Services [get]
Gets the list of primary services discovered
Detailed Description
Holds the result of primary services discovery
Property Documentation
List<CyGattService> Services[get]
CyDongleInfo
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 92 of 198
API Reference
Public Types
□ enum CySmartDongleType { CY5670, CY5672, CY5677 }Enumeration of supported dongle types
Properties
□ string COMPortName [get]
Gets the COM port name of the CySmart dongle
□ CySmartDongleType DongleType [get]
Gets the dongle type
Detailed Description
Holds the information necessary to get a dongle communicator
enum CySmartDongleType[strong]
Enumerator
CY5670 CySmart BLE dongle (supports BLE v4.1)
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 93 of 198
API Reference
Parameters:
comPortName COM port name of the CySmart dongle
Parameters:
comPortName COM port name of the CySmart dongle
Property Documentation
string COMPortName[get]
CySmartDongleType DongleType[get]
CyEstablishL2CapChannelInfo
Properties
□ ushort RemotePSM [get]
Gets the remote PSM
□ ushort LocalPSM [get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 94 of 198
API Reference
Detailed Description
Holds the information necessary to create a new L2CAP channel
Parameters:
remotePSM Remote PSM
Property Documentation
ushort RemotePSM[get]
ushort LocalPSM[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 95 of 198
API Reference
ushort MTU[get]
ushort MPS[get]
ushort InitialCredits[get]
CyFindIncludedServicesCallback
Detailed Description
Defines the callback methods for find included services API
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 96 of 198
API Reference
CyFindIncludedServicesInfo
Properties
□ ushort StartHandle [get]
Gets the handle from which the discovery needs to be started
□ ushort EndHandle [get]
Gets the attribute handle till which the discovery needs to be executed
Detailed Description
Holds the information necessary to find an included service
Parameters:
startHandle Start handle This is typically the start handle of a primary
service
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 97 of 198
API Reference
Property Documentation
ushort StartHandle[get]
ushort EndHandle[get]
Gets the attribute handle till which the discovery needs to be executed
CyFindIncludedServicesResult
Properties
□ List< CyGattIncludedService > IncludedServices [get]
Gets the included service discovered
Detailed Description
Holds the result of included service discovery
Property Documentation
List<CyGattIncludedService> IncludedServices[get]
CyGattAttribute
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 98 of 198
API Reference
Properties
□ CyUUID UUID [get]
Gets the UUID of the attribute
□ ushort Handle [get]
Gets the attribute handle
□ byte[] Value [get]
Gets the attribute value
Detailed Description
Represents an attribute in the GATT server
Parameters:
uuid Attribute UUID
Property Documentation
CyUUID UUID[get]
ushort Handle[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 99 of 198
API Reference
byte [] Value[get]
CyGattCharacteristic
Properties
□ CyUUID UUID [get]
Gets the characteristic UUID
□ ushort DeclarationHandle [get]
Gets the handle at which the characteristic is declared
□ ushort Handle [get]
Gets the handle to characteristic value
□ CyGattCharacteristicProperty Properties [get]
Gets the characteristic properties
□ CyGattService Service [get, set]
Gets the service which includes this characteristic
□ List< CyGattDescriptor > Descriptors [get]
Gets the list of descriptors associated with this characteristic
Detailed Description
Represents a GATT characteristic
Property Documentation
CyUUID UUID[get]
ushort DeclarationHandle[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 100 of 198
API Reference
ushort Handle[get]
CyGattCharacteristicProperty Properties[get]
List<CyGattDescriptor> Descriptors[get]
CyGattClientCallback
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 101 of 198
API Reference
Parameters:
result Contains the negotiated GATT MTU size, if status is OK;
Otherwise is null
Parameters:
result Contains the discovered services, if status is OK;
Otherwise is null
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 102 of 198
API Reference
Parameters:
info Characteristic that was changed
Parameters:
result Contains the characteristic value, if status is OK;
Otherwise is null
Parameters:
result Contains the characteristic value, if status is OK;
Otherwise is null
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 103 of 198
API Reference
Parameters:
result Contains the value read, if status is OK; Otherwise is null
Parameters:
result Contains the characteristic that was written
status Status of
ICyGattClient.WriteCharacteristicWithoutResponse,
ICyGattClient.WriteCharacteristic,
ICyGattClient.WriteLongCharacteristic or
ICyGattClient.SignedCharacteristicWriteWithoutResponse
Parameters:
status Status of ICyGattClient.ReliableWrite method
This callback is invoked when the peer device reports that the write buffer is full
Parameters:
response Holds the information about the attribute reported by the
peer device and the response to be sent
Use ICyGattClient.SendReliableWriteBufferFullResponse to send the response
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 104 of 198
API Reference
Parameters:
result Contains the descriptor value
Parameters:
result Contains the descriptor that was written
Parameters:
status Status of ICyGattClient.GattStop method execution
CyGattDescriptor
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 105 of 198
API Reference
Properties
□ CyUUID UUID [get]
Gets the characteristic descriptor UUID
□ ushort Handle [get]
Gets the handle to the characteristic descriptor
□ CyGattCharacteristic Characteristic [get, set]
Gets the characteristic which includes this descriptor
Detailed Description
Represents a characteristic descriptor
Property Documentation
CyUUID UUID[get]
ushort Handle[get]
CyGattExchangeMtuInfo
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 106 of 198
API Reference
Properties
□ ushort GattMtu [get]
Gets the GATT MTU size to be used for negotiation
Detailed Description
Holds the information necessary to exchange GATT MTU size
Parameters:
gattMtu GATT MTU size to be negotiated
Property Documentation
ushort GattMtu[get]
CyGattExchangeMtuResult
Properties
□ ushort GattMtuRequested [get]
Gets the GATT MTU size requested
□ ushort NegotiatedGattMtu [get]
Gets the negotiated GATT MTU size
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 107 of 198
API Reference
Detailed Description
Holds the result of GATT MTU exchange
Property Documentation
ushort GattMtuRequested[get]
ushort NegotiatedGattMtu[get]
CyGattIncludedService
Properties
□ ushort IncludedHandle [get]
Gets the handle at which the service is included
□ CyGattService IncludedService [get]
Gets the service which is being included
□ CyGattService Service [get, set]
Gets the service which includes the IncludedService
Detailed Description
Represents an included service
Property Documentation
ushort IncludedHandle[get]
CyGattService IncludedService[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 108 of 198
API Reference
CyGattReadInfo
Properties
□ ushort Handle [get]
Gets the attribute handle
□ ushort Offset [get]
Offset within the attribute value, to begin reading the value This is ignored if the operation is not a long operation
Detailed Description
Holds the information necessary to read an attribute value
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 109 of 198
API Reference
Parameters:
characteristic Characteristic to be read
Parameters:
characteristic Characteristic to be read
Parameters:
descriptor Descriptor to be read
Parameters:
descriptor Descriptor to be read
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 110 of 198
API Reference
Parameters:
handle Attribute handle
Parameters:
handle Attribute handle
offset Offset within the attribute value, to begin reading the value
Property Documentation
ushort Handle[get]
ushort Offset[get]
Offset within the attribute value, to begin reading the value This is ignored if the operation is not a long operation
CyGattReadResult
Properties
□ ushort Handle [get]
Handle to the attribute that was read
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 111 of 198
API Reference
Detailed Description
Holds the result of an attribute read request
Property Documentation
ushort Handle[get]
byte [] Value[get]
ushort Offset[get]
CyGattService
Properties
□ bool IsPrimaryService [get]
Gets whether the service is a primary service or not
□ CyUUID UUID [get, set]
Gets the service UUID
□ ushort StartHandle [get]
Gets the start handle of the service
□ ushort EndHandle [get]
Gets the end handle of the service
□ List< CyGattCharacteristic > Characteristics [get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 112 of 198
API Reference
Detailed Description
Represents a GATT service
Property Documentation
bool IsPrimaryService[get]
ushort StartHandle[get]
ushort EndHandle[get]
List<CyGattCharacteristic> Characteristics[get]
List<CyGattIncludedService> IncludedServices[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 113 of 198
API Reference
CyGattWriteInfo
Properties
□ ushort Handle [get]
Gets the handle of the attribute to be written
□ ushort Offset [get]
Gets the offset within the attribute value to be written This is ignored, if the operation is not a long operation
□ byte[] Value [get]
Gets the value to be written
Detailed Description
Holds the information necessary to write a attribute value
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 114 of 198
API Reference
Parameters:
characteristic Characteristic to be written
Parameters:
characteristic Characteristic to be written
Parameters:
descriptor Descriptor to be written
Parameters:
descriptor Descriptor to be written
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 115 of 198
API Reference
Parameters:
handle Attribute handle to be written
Parameters:
handle Attribute handle to be written
Property Documentation
ushort Handle[get]
ushort Offset[get]
Gets the offset within the attribute value to be written This is ignored, if the operation is not a long operation
byte [] Value[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 116 of 198
API Reference
CyGattWriteResult
Properties
□ ushort Handle [get]
Gets the handle of the attribute that was written
Detailed Description
Holds the information about the completion of an attribute write
Property Documentation
ushort Handle[get]
CyGenerateBdAddressInfo
Properties
□ CyExpandedBdAddrType AddressType [get]
Gets the type of address to be generated
□ byte[] IRK [get]
Gets the 16-byte IRK to be used to generate random resolvable address
Detailed Description
Holds the information required to generate Bluetooth device address
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 117 of 198
API Reference
Creates the information required to generate Bluetooth device address Do not use this constructor to generate random
resolvable address
Parameters:
type Type of address to be generated
Parameters:
irk IRK to be used to generate the random resolvable address
Property Documentation
CyExpandedBdAddrType AddressType[get]
byte [] IRK[get]
CyGenerateBdAddressResult
Properties
□ CyBleBdAddress GeneratedAddress [get]
Gets the generated Bluetooth device address
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 118 of 198
API Reference
Detailed Description
Holds the generated Bluetooth device address
Property Documentation
CyBleBdAddress GeneratedAddress[get]
CyExpandedBdAddrType AddressType[get]
CyGenerateSecureConnectionOobDataInfo
Holds the information necessary to generate OOOB data for secure connection pairing
Properties
□ byte[] Rand [get]
16-byte random number to be used for OOB data generation
Detailed Description
Holds the information necessary to generate OOOB data for secure connection pairing
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 119 of 198
API Reference
Parameters:
rand 16-byte random number to be used for OOB data
generation
Property Documentation
byte [] Rand[get]
CyGetPeerDeviceAuthenticationKeyInfo
Holds the information necessary to get the authentication keys of a peer device
Properties
□ byte DeviceHandle [get]
Gets the device handle of the peer device
Detailed Description
Holds the information necessary to get the authentication keys of a peer device
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 120 of 198
API Reference
Property Documentation
byte DeviceHandle[get]
CyGetPeerDeviceAuthenticationKeyResult
Holds the information necessary to get the authentication keys of a peer device
Properties
□ byte DeviceHandle [get]
Gets the device handle of the peer device
□ CyAuthenticationKeys AuthenticationKeys [get]
Gets the peer device authentication keys
Detailed Description
Holds the information necessary to get the authentication keys of a peer device
Property Documentation
byte DeviceHandle[get]
CyAuthenticationKeys AuthenticationKeys[get]
CyL2CapConnectionResponseInfo
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 121 of 198
API Reference
Holds the L2CAP connection request details and the response to be sent
Properties
□ ushort LocalChannelID [get]
Gets the local channel ID
□ ushort LocalPSM [get]
Gets the local PSM
□ ushort RemoteMTU [get]
Gets the remote MTU
□ ushort RemoteMPS [get]
Gets the remote MPS
□ ushort InitialCreditsForLocalDevice [get]
Gets the initial credits sent by the remote device
□ ushort LocalMTU [get, set]
Gets/Sets the local MTU
□ ushort LocalMPS [get, set]
Gets/Sets the local MPS
□ ushort InitialCreditsToRemoteDevice [get, set]
Gets/Sets the initial credits
□ CyL2CapConnectionResponseCode Response [get, set]
Gets/Sets the response to the request
Detailed Description
Holds the L2CAP connection request details and the response to be sent
Property Documentation
ushort LocalChannelID[get]
ushort LocalPSM[get]
ushort RemoteMTU[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 122 of 198
API Reference
ushort RemoteMPS[get]
ushort InitialCreditsForLocalDevice[get]
CyL2CapDataReceivedInfo
Holds the information about the data received over an L2CAP channel
Properties
□ ushort LocalChannelID [get]
Gets the channel ID of L2CAP channel on which the data was received
□ CyL2CapResultCode Status [get]
Gets the status
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 123 of 198
API Reference
Detailed Description
Holds the information about the data received over an L2CAP channel
Property Documentation
ushort LocalChannelID[get]
Gets the channel ID of L2CAP channel on which the data was received
CyL2CapResultCode Status[get]
byte [] Data[get]
CyL2CapDisconnectConfirmation
Properties
□ ushort LocalChannelID [get]
Gets the channel ID of L2CAP channel that was disconnected
□ CyL2CapResultCode ResultCode [get]
Gets result of the disconnect
Detailed Description
Holds the result of an L2CAP channel disconnect request
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 124 of 198
API Reference
Property Documentation
ushort LocalChannelID[get]
CyL2CapResultCode ResultCode[get]
CyL2CapDisconnectIndicationInfo
Holds the information about the L2CAP channel disconnected by the peer device or by the local
device stack
Properties
□ ushort LocalChannelID [get]
Gets the channel ID of L2CAP channel that was disconnected
□ bool IsDisconnectedByPeerDevice [get]
Gets whether the channel was disconnected by the peer device
□ CyL2CapResultCode Reason [get]
Gets the reason for disconnect This will always be CyL2CapResultCode.SUCCESS, if the disconnect was triggered by the
peer device
Detailed Description
Holds the information about the L2CAP channel disconnected by the peer device or by the local device stack
Property Documentation
ushort LocalChannelID[get]
bool IsDisconnectedByPeerDevice[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 125 of 198
API Reference
CyL2CapResultCode Reason[get]
Gets the reason for disconnect This will always be CyL2CapResultCode.SUCCESS, if the disconnect was triggered by the
peer device
CyL2CapMgrCallback
L2CAP manager callback Defines callback method for L2CAP manager APIs
Detailed Description
L2CAP manager callback Defines callback method for L2CAP manager APIs
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 126 of 198
API Reference
Parameters:
response Contains the details of the channel request and the
response instance
Use ICyL2CapMgr.RespondToChannelRequest method to respond to the request
Reports an L2CAP channel disconnect initiated by the local device stack or by the peer device
Parameters:
info Information about the L2CAP channel that was
disconnected
Parameters:
result Disconnect confirmation
Parameters:
channel Contains the newly created L2CAP channel, if status is OK;
Otherwise is null
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 127 of 198
API Reference
Parameters:
info Information about the received data
Parameters:
info Information about the receive credit low indication
Reports the transmit flow credit received from a peer device, for an L2CAP channel
Parameters:
info Information about the transmit flow credit received
Parameters:
channelID L2CAP channel ID on which the data was sent
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 128 of 198
API Reference
Parameters:
channelID L2CAP channel ID on which the credits were sent
CyL2CapReceiveCreditLowInfo
Properties
□ ushort LocalChannelID [get]
Gets the channel ID of L2CAP channel on which the credit limit has reached the low watermark
□ ushort Credits [get]
Gets the current receive credits
Detailed Description
Holds the information about the receive credit low indication
Property Documentation
ushort LocalChannelID[get]
Gets the channel ID of L2CAP channel on which the credit limit has reached the low watermark
ushort Credits[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 129 of 198
API Reference
CyL2CapSendCreditsInfo
Properties
□ ICyL2CapChannel Channel [get]
Gets the L2CAP channel for which flow control credits need to be sent
□ ushort Credits [get]
Gets the flow control credit to be sent
Detailed Description
Holds the information necessary to send L2CAP flow control credits
Parameters:
channel L2CAP channel for which the credits need to be sent
Property Documentation
ICyL2CapChannel Channel[get]
Gets the L2CAP channel for which flow control credits need to be sent
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 130 of 198
API Reference
ushort Credits[get]
CyL2CapSendDataInfo
Properties
□ ICyL2CapChannel Channel [get]
Gets the L2CAP channel over which the data needs to be sent
□ byte[] Data [get]
Gets the data to be sent
Detailed Description
Holds the information necessary to send data over an L2CAP channel
Parameters:
channel L2CAP channel over which the data needs to be sent
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 131 of 198
API Reference
Property Documentation
ICyL2CapChannel Channel[get]
Gets the L2CAP channel over which the data needs to be sent
byte [] Data[get]
CyL2CapTransmitCreditInfo
Properties
□ ushort LocalChannelID [get]
Gets the channel ID of L2CAP channel for which transmit credits were received
□ ushort Credits [get]
Gets the current available transmit credits
□ CyL2CapResultCode Status [get]
Gets the status
Detailed Description
Holds the transmit flow credits received from a peer device
Property Documentation
ushort LocalChannelID[get]
Gets the channel ID of L2CAP channel for which transmit credits were received
ushort Credits[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 132 of 198
API Reference
CyL2CapResultCode Status[get]
CyNumericComparisonResponse
Holds the information necessary to respond to a secure connection numeric comparison request
Properties
□ uint Passkey [get]
Gets the 6 digit numeric value
□ CyPairingResponseCode Response [get, set]
Gets/Sets the response
Detailed Description
Holds the information necessary to respond to a secure connection numeric comparison request
Property Documentation
uint Passkey[get]
CyOobData
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 133 of 198
API Reference
Properties
□ byte[] OobKey [get]
Gets the 16-byte OOB key
□ byte[] OobData [get]
Gets the 16-byte OOB data
Detailed Description
Holds the OOB data to be set
Parameters:
oobKey 16-byte OOB key to be used
Parameters:
oobKey 16-byte OOB key to be used
Property Documentation
byte [] OobKey[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 134 of 198
API Reference
byte [] OobData[get]
CyPairSettings
Properties
□ CySecurityLevel SecurityLevel [get]
Gets the security level to be used for pairing
□ bool Bonding [get]
Gets whether bonding is enabled or disabled
□ byte EncryptionKeySize [get]
Gets the encryption size
□ CyPairingProperties PairingProperties [get]
Gets the pairing properties
Detailed Description
Holds the settings to be used for pairing
Parameters:
securityLevel Security level
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 135 of 198
API Reference
Property Documentation
CySecurityLevel SecurityLevel[get]
bool Bonding[get]
byte EncryptionKeySize[get]
CyPairingProperties PairingProperties[get]
CyPasskeyDisplayInfo
Properties
□ uint Passkey [get]
Gets the 6 digit passkey to be displayed
Detailed Description
Holds the passkey information to be displayed
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 136 of 198
API Reference
Property Documentation
uint Passkey[get]
CyPasskeyEntryResponse
Properties
□ uint Passkey [get, set]
Gets/Sets the 6 digit passkey
□ bool IsKeyPressNotificationRequired [get]
Gets whether keypress notification is required or not. This is applicable only for secure connection
□ CyPairingResponseCode Response [get, set]
Gets/Sets the response
Detailed Description
Holds the information necessary to respond to a passkey entry request
Property Documentation
bool IsKeyPressNotificationRequired[get]
Gets whether keypress notification is required or not. This is applicable only for secure connection
If true, use ICyBleDevice.SendKeyPressNotification to send the keypress notification
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 137 of 198
API Reference
CyReadCharacteristicByUUIDInfo
Properties
□ CyUUID UUID [get]
UUID of the characteristic to be read
□ ushort StartHandle [get]
Handle from which the search for the characteristic should begin
□ ushort EndHandle [get]
Handle at which the search for the characteristic should end
Detailed Description
Holds the information necessary to discover characteristics by UUID
Parameters:
uuid UUID of the characteristics to be read
startHandle Start handle from which the search for the characteristic
should begin
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 138 of 198
API Reference
Property Documentation
CyUUID UUID[get]
ushort StartHandle[get]
Handle from which the search for the characteristc should begin
ushort EndHandle[get]
CyReadCharacteristicByUUIDResult
Properties
□ CyGattReadResult[] Records [get]
Gets all the characteristics that were read
Detailed Description
Holds the result of read characteristic by UUID
Property Documentation
CyGattReadResult [] Records[get]
CyReadMultipleCharacteristicInfo
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 139 of 198
API Reference
Properties
□ ushort[] Handles [get]
Get the characteristic value handles to be read
Detailed Description
Holds the information necessary to read multiple characteristic
Parameters:
characteristics Array of characteristics to be read
Parameters:
handles Array of characteristic value handles to be read
Property Documentation
ushort [] Handles[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 140 of 198
API Reference
CyReadMultipleCharacteristicResult
Properties
□ byte[] Value [get]
Gets the value returned by the peer device
Detailed Description
Holds the result of multiple characteristic request
Property Documentation
byte [] Value[get]
CyRegisteredPsm
Properties
□ ushort PSM [get]
Gets the registered PSM
□ ushort ReceiveLowWatermark [get]
Gets the receive low watermark value for the PSM
Detailed Description
Represents a registered L2CAP PSM
Property Documentation
ushort PSM[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 141 of 198
API Reference
ushort ReceiveLowWatermark[get]
CyRegisterPsmInfo
Properties
□ ushort PSM [get]
Gets the PSM to be registered
□ ushort ReceiveLowWatermark [get]
Gets the receive low watermark value for the PSM
Detailed Description
Holds the information necessary to register a PSM
Parameters:
psm PSM to be registered
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 142 of 198
API Reference
Property Documentation
ushort PSM[get]
ushort ReceiveLowWatermark[get]
CyReliableWriteInfo
Properties
□ CyGattWriteInfo[] Records [get]
Gets all the characteristics to be written
Detailed Description
Holds the information necessary to perform a reliable write
Parameters:
records Characteristics to be written
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 143 of 198
API Reference
Property Documentation
CyGattWriteInfo [] Records[get]
CyResolvableAddressResult
Properties
□ CyBleBdAddress PeerIdAddress [get]
Gets the identity address of the peer device
□ CyBleBdAddress ResolvableAddress [get]
Gets the resolvable private address
Detailed Description
Holds the local or peer resolvable private address
Property Documentation
CyBleBdAddress PeerIdAddress[get]
CyBleBdAddress ResolvableAddress[get]
CyResolvableAddressTimeoutInfo
Holds the information necessary to set the resolvable address generation timeout
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 144 of 198
API Reference
Properties
□ ushort TimeoutInSeconds [get]
Gets the resolvable address generation timeout in seconds
Detailed Description
Holds the information necessary to set the resolvable address generation timeout
Parameters:
timeoutInSeco Timeout in seconds. Range - 0x0001 to 0xA1B8
nds
Property Documentation
ushort TimeoutInSeconds[get]
CyResolvePeerDeviceInfo
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 145 of 198
API Reference
Properties
□ CyBleBdAddress PeerDeviceAddress [get]
Gets the peer device address that needs to be resolved
Detailed Description
Holds the information necessary to resolve a peer device
Parameters:
peerDeviceAd Address of the peer device This is typically the peer device
dress address in the received advertisement
Property Documentation
CyBleBdAddress PeerDeviceAddress[get]
CyResolvingListDevice
Properties
□ CyBleBdAddress PeerIdAddress [get]
Gets the peer device ID address
□ byte[] LocalIRK [get]
Gets the 16-byte local IRK
□ byte[] PeerIRK [get]
Gets the 16-byte peer IRK
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 146 of 198
API Reference
Detailed Description
Represents a device in the resolving list
Property Documentation
CyBleBdAddress PeerIdAddress[get]
byte [] LocalIRK[get]
byte [] PeerIRK[get]
CyScanCallback
Detailed Description
Defines scan callback methods
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 147 of 198
API Reference
Parameters:
result Scan result
This callback may be called multiple times while the scan is active
Parameters:
scanStatus True if the scan is in-progress; otherwise, False
Reports the ICyBleMgr.StartScan error. This callback will not be called when there is no error
Parameters:
status Status of the ICyBleMgr.StartScan method execution
Reports the ICyBleMgr.StopScan error. This callback will not be called when there is no error
Parameters:
status Status of the ICyBleMgr.StopScan method execution
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 148 of 198
API Reference
CyScanRecord
Properties
□ CyBleAdvEventType AdvertisementType [get]
Gets the advertisement type
□ bool IsDirectedRpaAdvertisement [get]
Gets whether the advertisement is a directed advertisement with RPA used for InitA This is applicable only when Privacy 1.2
is used
□ CyBleBdAddress LocalDeviceAddress [get]
Gets the local Bluetooth device address This is valid only if IsDirectedRpaAdvertisement is True
□ CyBleBdAddress PeerDeviceAddress [get]
Gets the address of the advertising BLE device
□ sbyte RSSI [get]
Gets the RSSI
□ CyAdvertisementData AdvertisementData [get]
Gets the advertisement or scan response data
Detailed Description
Represents an advertisement or scan response of a BLE device
Property Documentation
CyBleAdvEventType AdvertisementType[get]
bool IsDirectedRpaAdvertisement[get]
Gets whether the advertisement is a directed advertisement with RPA used for InitA This is applicable only when Privacy 1.2
is used
CyBleBdAddress LocalDeviceAddress[get]
Gets the local Bluetooth device address This is valid only if IsDirectedRpaAdvertisement is True
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 149 of 198
API Reference
CyBleBdAddress PeerDeviceAddress[get]
sbyte RSSI[get]
CyAdvertisementData AdvertisementData[get]
CyScanResult
Properties
□ List< CyScanRecord > ScanRecords [get]
Gets the scan records
Detailed Description
Holds the scan results
Property Documentation
List<CyScanRecord> ScanRecords[get]
CySecureConnectionOobDataResult
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 150 of 198
API Reference
Properties
□ byte[] OobKey [get]
Gets the 16-byte OOB key
□ byte[] OobData [get]
Gets the generated 16-byte OOB data
Detailed Description
Holds the generated secure connection OOB data
Creates an instance to hold the generated OOB key and data for secure connection
Parameters:
oobKey 16-byte OOB key
Property Documentation
byte [] OobKey[get]
byte [] OobData[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 151 of 198
API Reference
CySecurityMgrCallback
Security manager callback Defines callback method for security manager APIs
Detailed Description
Security manager callback Defines callback method for security manager APIs
Parameters:
result Contains the current local authentication keys, if status is
OK; Otherwise is null
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 152 of 198
API Reference
Parameters:
result Contains the generated authentication keys, if status is
OK; Otherwise is null
Parameters:
status Status of the ICyBleSecurityMgr.SetAuthenticationKeys
method execution
Parameters:
result Contains the peer device authentication keys
status Status of
ICyBleSecurityMgr.GetPeerDeviceAuthenticationKeys
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 153 of 198
API Reference
Parameters:
result Contains the result of the peer device address resolution, if
status is OK; Otherwise is null
Parameters:
result Contains the generated OOB data, if status is OK;
Otherwise is null
status Status of
ICyBleSecurityMgr.GenerateSecureConnectionOobData
method execution
Parameters:
status Status of ICyBleSecurityMgr.GenerateLocalECDHKey
method execution
CySetSuggestedDataLengthInfo
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 154 of 198
API Reference
Properties
□ ushort SuggestedMaxTxOctets [get]
Gets the suggested max. Tx octets
□ ushort SuggestedMaxTxTime [get]
Gets the suggested max. Tx time in µs
Detailed Description
Holds the information necessary to set the suggested data length
Parameters:
suggestedMa Suggested maximum Tx octet
xTxOctets
Property Documentation
ushort SuggestedMaxTxOctets[get]
ushort SuggestedMaxTxTime[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 155 of 198
API Reference
CySmartDongleMgr
Detailed Description
Provides APIs to manage the CySmart dongle
Parameters:
info Information necessary to get the communicator
Returns:
CyApiErr.OK if the communicator was successfully created; otherwise, contains the error
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 156 of 198
API Reference
Close a communicator
Parameters:
communicator Communicator to be closed
Returns:
CyApiErr.OK if the communicator was successfully closed; otherwise, contains the error
Once closed, the communicator instances cannot be used again. Get a new communicator instance by calling the
TryGetCySmartDongleCommunicator method
Returns:
CyTxPowerInfo
Properties
□ CyChannelGroup ChannelGroup [get]
Gets the channel group
□ CyPowerLevel PowerLevel [get]
Gets the power level
Detailed Description
Holds channel power level information
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 157 of 198
API Reference
Parameters:
channelGroup Channel group
Property Documentation
CyChannelGroup ChannelGroup[get]
CyPowerLevel PowerLevel[get]
CyUUID
Represents an UUID
Public Attributes
□ const int UUID_16_LENGTH_IN_BYTES = 2
□ const int UUID_128_LENGTH_IN_BYTES = 16
□ const int UUID16_START_INDEX_IN_UUID128 = 12
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 158 of 198
API Reference
Properties
□ ushort UUID16 [get]
Gets the 16-bit UUID
□ bool IsUUID16Valid [get]
Gets whether the 16-bit UUID representation is valid or not
□ byte[] UUID128 [get]
Gets the 128-bit UUID byte array in little endian
Detailed Description
Represents an UUID
Parameters:
uuid16 16-bit UUID value
Parameters:
uuid128 128-bit UUID bytes in little endian format
Property Documentation
ushort UUID16[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 159 of 198
API Reference
bool IsUUID16Valid[get]
byte [] UUID128[get]
CyWhitelistDevice
Properties
□ CyBleBdAddress DeviceAddress [get]
Gets the device address
Detailed Description
Represents a device in the whitelist
Property Documentation
CyBleBdAddress DeviceAddress[get]
CyWriteBufferFullResponse
Holds the response to be sent when the peer device buffer is full before the complete write
request could be queued
Public Types
□ enum ResponseCode { ABORT, EXECUTE }Response to be sent
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 160 of 198
API Reference
Properties
□ ushort Handle [get]
Gets the attribute handle that was not queued
□ ResponseCode Response [get, set]
Gets/Sets the response to be sent to the peer device
Detailed Description
Holds the response to be sent when the peer device buffer is full before the complete write request could be queued
enum ResponseCode[strong]
Response to be sent
Enumerator
ABORT Abort all queued requests
Property Documentation
ushort Handle[get]
ICyBleDevice
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 161 of 198
API Reference
Properties
□ CyBleBdAddress Address [get]
Gets the address of the remote device
□ ushort Handle [get]
Gets the connection handle
□ ICyGattClient GattClient [get]
Gets the GATT client
□ ICyL2CapMgr L2CapMgr [get]
Gets the L2CAP manager
Detailed Description
Represents a remote device which is in connected state
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 162 of 198
API Reference
cb Device callback
Returns:
CyApiErr.OK if the callback was successfully registered; otherwise, contains the error
Parameters:
enable Enable or disable OOB
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status of this operation is reported via the CyBleDeviceCallback.OnSetOob callback
Parameters:
settings Settings to be used for pairing
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Based on the security settings and device IO capabilities, one of the callback may be invoked to complete the
pairing procedure
1. CyBleDeviceCallback.OnPasskeyEntryRequest
2. CyBleDeviceCallback.OnPasskeyDisplayRequest
3. CyBleDeviceCallback.OnNumericComparisonRequest
Status of the overall pairing procedure is report via the CyBleDeviceCallback.OnPairingCompleted callback
method
Send the key press notification This needs to be called only for secure connection pairing with keypress enabled
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 163 of 198
API Reference
Parameters:
notification Keypress notification
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status of this operation is reported via the CyBleDeviceCallback.OnSendKeyPressNotification callback
Parameters:
response Passkey entry response
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Response instance is received from CyBleDeviceCallback.OnPasskeyEntryRequest callback
Parameters:
response Numeric comparison response
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Response instance is received from CyBleDeviceCallback.OnNumericComparisonRequest callback
Set the data packet length for the current connection This data is then negotiated with the remote device
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 164 of 198
API Reference
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status of the method is reported via the CyBleDeviceCallback.OnSetDataLength. The change in data length
will be reported via the CyBleDeviceCallback.OnDataLengthChanged callback
Parameters:
settings New connection parameter settings to be used
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyBleDeviceCallback.OnUpdateConnectionParameter callback method If the
connection parameter changed, then the change is reported via the
CyBleDeviceCallback.OnConnectionParameterChanged callback method
Send response to connection parameter update request received from peer device
Parameters:
response Response to be sent
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Property Documentation
CyBleBdAddress Address[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 165 of 198
API Reference
ushort Handle[get]
ICyGattClient GattClient[get]
ICyL2CapMgr L2CapMgr[get]
ICyBleDeviceAddressMgr
Device address manager Provides API to generate and set device address
Detailed Description
Device address manager Provides API to generate and set device address
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 166 of 198
API Reference
Parameters:
cb Device address manager callback
Returns:
CyApiErr.OK if the callback was successfully registered; otherwise, contains the error
The status of device address manager APIs are reported via the CyDeviceAddressMgrCallback callback
Get the current Bluetooth device address of the local device (dongle)
Parameters:
addressType Type of address - public or random, to be returned
Returns:
CyApiErr.OK if the callback was successfully registered; otherwise, contains the error
The Bluetooth device address is reported via the registered CyDeviceAddressMgrCallback callback
Parameters:
info Information required to generate Bluetooth device address
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The generated Bluetooth device address is reported via the registered CyDeviceAddressMgrCallback callback
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 167 of 198
API Reference
Parameters:
address Bluetooth device address
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status of this operation is reported via the registered CyDeviceAddressMgrCallback callback
Parameters:
address Identity address
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The ID address should be one of the bluetooth device address, set using SetBdAddress; otherwise, could result in
unexpected behavior.
The status of this operation is reported via the registered CyDeviceAddressMgrCallback callback
Parameters:
peerIdAddr Identity address of the peer device
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Notes: (1) The resolvable private address is reported via the registered CyDeviceAddressMgrCallback callback
(2) This feature is available from BLE version 4.2
Get the resolvable private address of the local device for a peer device
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 168 of 198
API Reference
Parameters:
peerIdAddr Identity address of the peer device
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Notes: (1) The resolvable private address is reported via the registered CyDeviceAddressMgrCallback callback
(2) This feature is available from BLE version 4.2
ICyBleDeviceList
Represents the whitelist, bond list and the resolving list of the local device (dongle)
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 169 of 198
API Reference
Detailed Description
Represents the whitelist, bond list and the resolving list of the local device (dongle)
Parameters:
cb Device list callback
Returns:
CyApiErr.OK if the callback was successfully registered; otherwise, contains the error
Parameters:
address Address of the device to be added to the whitelist
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Result is reported via the CyDeviceListCallback.OnAddDeviceToWhitelist callback method
Parameters:
device Device to be removed from whitelist
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status is reported via the CyDeviceListCallback.OnRemoveDeviceFromWhitelist callback method
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 170 of 198
API Reference
CyApiErr ClearWhitelist ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status is reported via the CyDeviceListCallback.OnClearWhitelist callback method
CyApiErr GetWhitelistDevices ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The whitelist devices are reported via the CyDeviceListCallback.OnGetWhitelistDevices callback method
CyApiErr GetBondListDevices ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The bond list devices are reported via the CyDeviceListCallback.OnGetBondListDevices callback method
Parameters:
info Information necessary to add a device to the resolving list
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status is reported via the CyDeviceListCallback.OnAddDeviceToResolvingList callback method
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 171 of 198
API Reference
Parameters:
device Device to be removed from the resolving list
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status is reported via the CyDeviceListCallback.OnRemoveDeviceFromResolvingList callback method
CyApiErr ClearResolvingList ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status is reported via the CyDeviceListCallback.OnClearResolvingList callback method
CyApiErr GetResolvingListDevices ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The resolving list devices are reported via the CyDeviceListCallback.OnGetResolvingListDevices callback
method
ICyBleMgr
BLE Manager Provides APIs to scan, connect and to perform other GAP central operations
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 172 of 198
API Reference
□ CyApiErr StopScan ()
Stop an ongoing scan
□ CyApiErr Connect (CyConnectInfo info)
Connect to a BLE device Establishes connection with a BLE device
□ CyApiErr CancelConnection (CyBleBdAddress deviceAddress)
Cancels an ongoing connect request with the given device
□ CyApiErr Disconnect (ICyBleDevice device)
Disconnect from a BLE device
□ CyApiErr GetDeviceIoCapabilities ()
Get the current IO capabilities of the local device (dongle)
□ CyApiErr SetDeviceIoCapabilities (CyBleDeviceIoCapabilities ioCapability)
Set the IO capabilities of the local device (dongle)
□ CyApiErr RegisterPsm (CyRegisterPsmInfo info)
Register a L2CAP PSM
□ CyApiErr UnregisterPsm (CyRegisteredPsm psm)
Unregister a previously registered L2CAP PSM
□ CyApiErr GetRSSI ()
Get RSSI of the last received packet
□ CyApiErr SetTxPower (CyTxPowerInfo info)
Set channel transmission power
□ CyApiErr GetTxPower (CyChannelGroup channel)
Get the current channel transmission power
□ CyApiErr SetHostChannelClassification (CyChannelClassificationInfo info)
Set host channel classification
□ CyApiErr GetDefaultDataLength ()
Get default data packet length
□ CyApiErr SetSuggestedDataLength (CySetSuggestedDataLengthInfo info)
Set the default data packet length
□ CyApiErr ConvertDataLengthOctetToTime (CyConvertOctetToTimeInfo info)
Utility method to convert data length octet to time
□ CyApiErr SetResolvableAddressTimeout (CyResolvableAddressTimeoutInfo info)
Set the length of time the controller uses a resolvable private address before a new address is generated
□ CyApiErr SetAddressResolutionControl (CyAddressResolutionControlInfo info)
Enable or disable resolvable address resolution in controller
Properties
□ ICyBleDeviceList DeviceList [get]
Gets the device list Device list includes whitelist, bond list and the resolving list
□ ICyBleSecurityMgr SecurityMgr [get]
Gets the security manager
□ ICyBleDeviceAddressMgr DeviceAddressMgr [get]
Gets the device address manager
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 173 of 198
API Reference
Detailed Description
BLE Manager Provides APIs to scan, connect and to perform other GAP central operations
Parameters:
cb BLE manager callback
Returns:
CyApiErr.OK if the callback was successfully registered; otherwise, contains the error
Start scan The dongle starts scanning for nearby BLE devices. The discovered devices are reported in the CyScanCallback
callback
Parameters:
settings Scan settings
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Scan status is reported via the CyScanCallback callback
CyApiErr StopScan ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Scan status is reported via the CyScanCallback callback registered in ICyBleMgr.StartScan
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 174 of 198
API Reference
Parameters:
info Information necessary to establish a connection
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status of the operation is reported via the registered CyBleMgrCallback callback
Parameters:
deviceAddres Cancel connection with device
s
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status of the operation is reported via the registered CyBleMgrCallback callback
Parameters:
device Device to be disconnected
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status of the operation is reported via the registered CyBleMgrCallback callback
CyApiErr GetDeviceIoCapabilities ()
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 175 of 198
API Reference
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Parameters:
ioCapability IO capabilities to be set
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Parameters:
info Information necessary to register a PSM
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Registered PSM is used to create a L2CAP channel. ICyBleL2CapMgr provides API to create and manage L2CAP
channel communication
Parameters:
psm PSM to be unregistered
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 176 of 198
API Reference
CyApiErr GetRSSI ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The RSSI value is reported via the registered CyBleMgrCallback callback
Parameters:
info Information necessary to set the channel power
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Parameters:
channel Channel group
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Parameters:
info Information necessary to set the host channel classification
Returns:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 177 of 198
API Reference
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
CyApiErr GetDefaultDataLength ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
This feature is available from BLE version 4.2
Parameters:
info Information necessary to set the default data packet length
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
This feature is available from BLE version 4.2
Parameters:
info Information required to convert
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The converted time value is returned via the registered CyBleMgrCallback.OnConvertDataLengthOctetToTime
callback Use the converted time value when setting the suggested data length using SetSuggestedDataLength API
Set the length of time the controller uses a resolvable private address before a new address is generated
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 178 of 198
API Reference
Parameters:
info Information necessary to set the resolvable address
generation timeout
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyBleMgrCallback.OnSetResolvableAddressTimeout callback method This feature
is available from BLE version 4.2
Parameters:
info Information necessary to enable/disable resolvable address
resolution
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyBleMgrCallback.OnSetAddressResolutionControl callback method This feature
is available from BLE version 4.2
Property Documentation
ICyBleDeviceList DeviceList[get]
Gets the device list Device list includes whitelist, bond list and the resolving list
ICyBleSecurityMgr SecurityMgr[get]
ICyBleDeviceAddressMgr DeviceAddressMgr[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 179 of 198
API Reference
ICyBleSecurityMgr
Security Manager Provide APIs to manage authentication keys and OOB data to be used when
pairing with a device
Detailed Description
Security Manager Provide APIs to manage authentication keys and OOB data to be used when pairing with a device
Parameters:
cb Security manager callback
Returns:
CyApiErr.OK if the callback was successfully registered; otherwise, contains the error
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 180 of 198
API Reference
CyApiErr GetAuthenticationKeys ()
Returns:
CyApiErr.OK
The local authentication keys are reported via the CySecurityMgrCallback.OnGetAuthenticationKeys callback
Generate authentication keys Generates new set of LTK, IRK and CSRK
Parameters:
distributeKeys Keys to be distributed and requested
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The generated authentication keys are reported via the CySecurityMgrCallback.OnGenerateAuthenticationKeys
callback
Parameters:
keys Authentication keys
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status of this operation is reported via the CySecurityMgrCallback.OnSetAuthenticationKeys callback
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 181 of 198
API Reference
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Peer device authentication keys are reported via the
CySecurityMgrCallback.OnGetPeerDeviceAuthenticationKeys callback
Resolve peer device address The peer device address needs to be resolved to ensure that the previously bonded data is used
when connecting with a device
Parameters:
info Information necessary to resolve a peer device address
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Notes: (1) This method must be called before connecting to a device (2) This method can be ignored, if address
resolution is enabled in the controller (Privacy 1.2). Refer to ICyBleMgr.SetAddressResolutionControl (3) The
status of this operation is reported via the CySecurityMgrCallback.OnResolvePeerDeviceAddress callback
CyApiErr GenerateLocalECDHKey ()
Returns:
CyApiErr.OK
Notes: (1) The status of this operation is reported via the CySecurityMgrCallback.OnGenerateLocalECDHKey
callback
(2) This feature is available from BLE version 4.2
CyApiErr GenerateSecureConnectionOobData
(CyGenerateSecureConnectionOobDataInfo info)
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 182 of 198
API Reference
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Note: (1) The generated OOB data is reported via the registered
CySecurityMgrCallback.OnGenerateSecureConnectionOobData callback
(2) The local ECDH key is used for secure connection OOB data generation. The ECDH key can be changed /
generated by calling the GenerateLocalECDHKey method
(3) This feature is available from BLE version 4.2
ICyGattClient
This interface defines GATT client APIs to discover, read/write/notify GATT server
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 183 of 198
API Reference
Detailed Description
This interface defines GATT client APIs to discover, read/write/notify GATT server
Parameters:
cb GATT client callback
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 184 of 198
API Reference
Returns:
CyApiErr.OK if the callback was successfully registered; otherwise, contains the error
Parameters:
info Information necessary to exchange GATT MTU
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The negotiated GATT MTU size is reported via the CyGattClientCallback.OnGattMtuExchanged callback
CyApiErr DiscoverAllServices ()
Discover all services, characteristics and descriptors defined in the peer device GATT server
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The discovered services are reported via the ICyGattClientCallback.OnServiceDiscovered
Discover only primary services defined in the peer device GATT server
Parameters:
cb Callback to report the discovered primary services
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 185 of 198
API Reference
Parameters:
info Information necessary to discover primary services of a
specific UUID
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Parameters:
info Information necessary to discover included services
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Parameters:
info Information necessary to discover characteristics
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 186 of 198
API Reference
Parameters:
info Information necessary to discover characteristic of a
specific UUID
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Discover descriptors
Parameters:
info Information necessary to discover descriptors
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Parameters:
info Information necessary to read a characteristic value
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The read value is reported via the CyGattClientCallback.OnCharacteristicRead callback method
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 187 of 198
API Reference
Parameters:
info Information necessary to read value of characteristics with
a specific UUID
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The read value is reported via the CyGattClientCallback.OnCharacteristicReadByUUID callback method
Parameters:
info Information necessary to read a long characteristic value
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The read value is reported via the CyGattClientCallback.OnCharacteristicRead callback method
Parameters:
info Information necessary to read multiple characteristics
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The read value is reported via the CyGattClientCallback.OnReadMultipleCharacteristics callback method
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 188 of 198
API Reference
Parameters:
info Information necessary to write a characteristic without
response
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyGattClientCallback.OnCharacteristicWrite callback method
Parameters:
info Information necessary to write a characteristic value
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyGattClientCallback.OnCharacteristicWrite callback method
Parameters:
info Information necessary to write a long characteristic value
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyGattClientCallback.OnCharacteristicWrite callback method. If the peer device
reports buffer full error, CyGattClientCallback.OnWriteBufferFull callback method will be invoked
Parameters:
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 189 of 198
API Reference
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyGattClientCallback.OnReliableWriteCompleted callback method If the peer
device reports buffer full error, CyGattClientCallback.OnWriteBufferFull callback method will be invoked
Sends the response to write buffer full status reported by the peer device
Parameters:
response Response to be sent
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Parameters:
info Information necessary to signed write characteristic value
without response
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyGattClientCallback.OnCharacteristicWrite callback method
Parameters:
info Information necessary to read a descriptor value
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 190 of 198
API Reference
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The read value is reported via the CyGattClientCallback.OnDescriptorRead callback method
Parameters:
info Information necessary to read a long descriptor value
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The read value is reported via the CyGattClientCallback.OnDescriptorRead callback method
Parameters:
info Information necessary to write a descriptor value
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyGattClientCallback.OnDescriptorWrite callback method
Parameters:
info Information necessary to write a long descriptor value
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyGattClientCallback.OnDescriptorWrite callback method. If the peer device reports
buffer full error, CyGattClientCallback.OnWriteBufferFull callback method will be invoked
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 191 of 198
API Reference
CyApiErr GattStop ()
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The status is reported via the CyGattClientCallback.OnGattStop callback method
ICyL2CapChannel
Properties
□ ushort ChannelID [get]
Gets the channel ID
□ ushort LocalPSM [get]
Gets the local PSM
□ ushort MTU [get]
Gets the channel local MTU
□ ushort MPS [get]
Gets the channel local MPS
□ ushort InitialCredit [get]
Gets the initial credit of the channel
□ ushort RemoteMTU [get]
Gets the remote MTU
□ ushort RemoteMPS [get]
Gets the remote MPS
□ ushort RemoteInitialCredit [get]
Gets the initial credit sent by the remote device
Detailed Description
Represents an L2CAP channel
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 192 of 198
API Reference
Property Documentation
ushort ChannelID[get]
ushort LocalPSM[get]
ushort MTU[get]
ushort MPS[get]
ushort InitialCredit[get]
ushort RemoteMTU[get]
ushort RemoteMPS[get]
ushort RemoteInitialCredit[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 193 of 198
API Reference
ICyL2CapMgr
L2CAP Manager. Provides APIs to manage L2CAP channel creation and removal. Also, provides
APIs to send data and credits.
Detailed Description
L2CAP Manager. Provides APIs to manage L2CAP channel creation and removal. Also, provides APIs to send data
and credits.
Parameters:
cb L2CAP callback
Returns:
CyApiErr.OK if the callback was successfully registered; otherwise, contains the error
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 194 of 198
API Reference
Parameters:
info Information necessary to create a new channel
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
The L2CAP channel is reported via the CyL2CapMgrCallback.OnChannelEstablished callback method
Parameters:
channel L2CAP channel to be disconnected
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status is reported via the CyL2CapMgrCallback.OnDisconnectChannel callback method
Parameters:
response Response to the request
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Response instance is received from the CyL2CapMgrCallback.OnChannelConnectionIndication callback method
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 195 of 198
API Reference
Parameters:
info Information necessary to send data
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status is reported via the CyL2CapMgrCallback.OnSendData callback method
Parameters:
info Information necessary to send credits
Returns:
CyApiErr.OK if the method parameters are correct; otherwise, contains the error
Status is reported via the CyL2CapMgrCallback.OnSendCredits callback method
ICySmartDongleCommunicator
Properties
□ CyDongleID DeviceID [get]
Gets the device ID of the dongle
□ Version BleStackVersion [get]
Gets the BLE stack version of the dongle
□ Version FirmwareVersion [get]
Gets the dongle firmware version
□ Version HardwareVersion [get]
Gets the dongle hardware version
□ ICyBleMgr BleMgr [get]
Gets the BLE manager
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 196 of 198
API Reference
Detailed Description
Provides APIs to communicate with the CySmart dongle
Property Documentation
CyDongleID DeviceID[get]
Version BleStackVersion[get]
Version FirmwareVersion[get]
Version HardwareVersion[get]
ICyBleMgr BleMgr[get]
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 197 of 198
Revision History
CySmart™ API Reference Guide, Doc. No. 002-11435 Rev *A Page 198 of 198