User's Guide

Table Of Contents
Getting Started
EZ-Serial BLE Firmware Platform User Guide, Doc. No. 002-11259 Rev. *E 22
WARNING: EZ-Serial will only incorporate the CYSPP peripheral connection key into the advertising
packet if you have not enable user-defined advertisement content. If you have configured user-defined
advertisement content instead as described in Section 3.4.3 (How to Customize Advertisement and
Scan Response Data), then changing this value will have no effect. You must ensure that your user-
defined advertisement packet contains an equivalent field in order to allow scanning devices to filter
properly.
Example 1: Update CYSPP peripheral key to 0x11223344
Direction Content Effect
TX
.CYSPPSP,L=11223344
Apply new CYSPP configuration
RX
@R,000E,.CYSPPSP,0000
Response indicates success
2.4.5.7 Using the CYSPP Central Connection Key and Mask
The CYSPP central connection key affects the scanning operation that occurs when CYSPP is active in the central role
and has not yet connected to a remote peer. The central connection key has two parts:
1. remote_keythe value used for comparison with the peripheral key from the advertisement packet
2. remote_mask the bitmask used to strip away any irrelevant bits from the peripheral key before comparison
In order for EZ-Serial to initiate a connection to a CYSPP peripheral device, the “remote_key value must match with
advertised peripheral connection key after a logical AND operation with theremote_mask” value. A mask with all bits set
(“FFFFFFFF”) will require an exact match between the two keys, while a mask with no bits set (“00000000) will match
any device. The factory default configuration is the all-zero mask, so any CYSPP-capable peer will match. The mask
values between these two extremes provide the option to connect only to devices within specific segments of the
connection key space, much like an IP-based network. Table 2-7 below provides examples of each case.
Table 2-7. Connection Key and Mask Examples
Remote Key Remote Mask Key & Mask Result
11223344
FFFFFFFF
11223344
Connect to a device whose key is exactly “
11223344
55667788
FFFFFF00
55667700
Connect to any device whose key begins with “
556677
12345789
FFFF0000
12340000
Connect to any device whose key begins with “
1234
18F7A9CC
FFFF00FF
18F700CC
Connect to any device whose key begins with “
18F7
” and ends with “
CC
Any
00000000
00000000
Connect to any device
Use the p_cyspp_set_parameters (.CYSPPSP, ID=10/3) API command and enter the desired 32-bit values for the
remote_key” and “remote_mask” arguments to apply a new central connection key and mask. Changes to these values
will take effect immediately, even if the module is already scanning in the CYSPP central role.
NOTE: If an advertising peripheral device is broadcasting the CYSPP service UUID but does not also
have a Manufacturer Data field containing a connection key in the same advertisement packet, the
value “0” will be substituted for an actual key for the purpose of filtering on the scanning device.
Example 1: Update CYSPP central key to 0x11223344 and require exact matching
Direction Content Effect
TX
.CYSPPSP,R=11223344,M=FFFFFFFF
Apply new CYSPP configuration
RX
@R,000E,.CYSPPSP,0000
Response indicates success