CYSPP : Custom GAP Perif Advertise

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Yashu
Level 4
Level 4
25 sign-ins First solution authored 25 replies posted

I can't seem to get the Pioneer Kit to start advertising the users manual custom GAP parameters. Unit works with preconfigured defaults on iOS w/ CySmart v1.1.1.57, but kit refuses to activate new advertise. Kit is not connected to CySmart during the /AX to /A command transition.

   

/AX
@R,0009,/AX,0000
@E,000E,ASC,S=00,R=00
SAP,F=1
@R,0009,SAP,0000
SAD,D=020106060209180D18
@R,0009,SAD,0000
SSRD,D=0708576964676574
@R,000A,SSRD,0000
/A,M=2,T=2,I=64,C=7,F=0,O=1E
@R,0008,/A,0000

0 Likes
1 Solution
Anonymous
Not applicable

Good catch on the Length value in Table 3-8. You are correct that this should be 5 bytes instead of 3.

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

Hello Yashu,

   

The main issue you are seeing here is due to a documentation error in the "Example 1" listing in Section 3.4.3 of the Rev. *C EZ-Serial User Guide (latest available online as of this moment). The bit value 0x01 for the "flags" value on the SAP command actually configures automatic advertisement on boot/disconnect, while the bit value 0x02 is required to enable custom advertisement content. If you use the command "SAP,F=2" instead of the one shown in the document, EZ-Serial will correctly use custom content. The bitfield values shown in Section 7.2.4.23 are correct.

   

It also appears that you have combined this example snippet with the "Example 2" listing in Section 3.4.1, where the actual advertisement parameters (not the content) are changed. This is not necessary in order to use custom advertisement data; you can simply use "/A" command with no other arguments. However, your output highlights a different issue that was recently discovered: the stack API command called internally by the "gap_start_adv" API command has at least one outcome which returns no error but which apparently does not trigger the start of advertising. This issue is currently being investigated, but it can be avoided by using argument combinations that always fall within correct bounds and including the correct "Flags" field in advertising payload data where applicable.

   

The User Guide will be updated to clearly describe all valid bounds and to show examples which only fall within these limits. The firmware itself will also be updated to validate all command arguments even if the underlying stack API call does not. This will be part of the upcoming v1.1 release.

   

In summary, try the following:

   

/AX
@R,0009,/AX,0000
@E,000E,ASC,S=00,R=00
SAP,F=2
@R,0009,SAP,0000
SAD,D=020106060209180D18
@R,0009,SAD,0000
SSRD,D=0708576964676574
@R,000A,SSRD,0000
/A
@R,0008,/A,0000
@E,000E,ASC,S=01,R=03

Yashu
Level 4
Level 4
25 sign-ins First solution authored 25 replies posted

Jeff. I will try. I'm novice so far and wasn't sure what settings might be culprit.

   

I also think there is typo in Table 3-8 : 2nd line : Field Descrip ... should read "Length: 5 bytes".

   

Thanks. John.

0 Likes
Anonymous
Not applicable

Good catch on the Length value in Table 3-8. You are correct that this should be 5 bytes instead of 3.

0 Likes