- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi There,
I've been using the EZ-Serial module (PSoC4) for testing my platform and it has been amazing. Of late I've run into a road block while trying to create a custom GATT service and associated characteristics. I use binary mode for transacting and here are the list of commands that I sent and the responses I got.
sending command to add local service -
['0xc0', '0x19', '0x5', '0x1', '0x0', '0x28', '0x1', '0x0', '0x0', '0x0', '0x0', '0x10', '0x0', '0x0L', '0xb1L', '0xcL', '0x20L', '0x0L', '0x8L', '0x9aL', '0x9eL', '0xe2L', '0x11L', '0x15L', '0xa1L', '0x44L', '0x44L', '0x44L', '0x55L']
gatts_create_attr attr response --
['0xc0', '0x6', '0x5', '0x1', '0x10', '0x1', '0x1e', '0x0', '0x8', '0x0', '0x9c']
validity = 0x8 -- Indicates I need a characteristic definition
sending command to add local chr --
['0xc0', '0x19', '0x5', '0x1', '0x3', '0x28', '0x1', '0x0', '0x12', '0x0', '0x0', '0x10', '0x0', '0x1L', '0xb1L', '0xcL', '0x20L', '0x0L', '0x8L', '0x9aL', '0x9eL', '0xe2L', '0x11L', '0x15L', '0xa1L', '0x44L', '0x44L', '0x44L', '0x55L']
gatts_create_attr attr response --
['0xc0', '0x6', '0x5', '0x1', '0x10', '0x1', '0x1e', '0x0', '0xd', '0x0', '0xa1']
validity = 0xd -- Indicates invalid attribute length
sending command to add local chr value attr --
['0xc0', '0xb', '0x5', '0x1', '0x1', '0x0', '0x1', '0x1', '0x12', '0x14', '0x0', '0x0', '0x0', '0x0', '0x0']
gatts_create_attr attr response --
['0xc0', '0x6', '0x5', '0x1', '0x10', '0x1', '0x1e', '0x0', '0x8', '0x0', '0x9c']
validity = 0x8
sending command to add local chr cccd attr --
['0xc0', '0xb', '0x5', '0x1', '0x2', '0x29', '0x1', '0x1', '0xa', '0x2', '0x0', '0x0', '0x0', '0x0', '0x0']
gatts_create_attr attr response --
['0xc0', '0x6', '0x5', '0x1', '0x10', '0x1', '0x1e', '0x0', '0x8', '0x0', '0x9c']
validity = 0x8
sending command to add local chr (second characteristic) --
['0xc0', '0x19', '0x5', '0x1', '0x3', '0x28', '0x1', '0x0', '0x6', '0x0', '0x0', '0x10', '0x0', '0x2L', '0xb1L', '0xcL', '0x20L', '0x0L', '0x8L', '0x9aL', '0x9eL', '0xe2L', '0x11L', '0x15L', '0xa1L', '0x44L', '0x44L', '0x44L', '0x55L']
gatts_create_attr attr response --
['0xc0', '0x6', '0x5', '0x1', '0x10', '0x1', '0x1e', '0x0', '0xd', '0x0', '0xa1']
validity = 0xd
sending command to add local chr value attr --
['0xc0', '0xb', '0x5', '0x1', '0x1', '0x0', '0x1', '0x1', '0x6', '0x14', '0x0', '0x0', '0x0', '0x0', '0x0']
gatts_create_attr attr response --
['0xc0', '0x6', '0x5', '0x1', '0x10', '0x1', '0x1e', '0x0', '0x8', '0x0', '0x9c']
validity = 0x8
-----
As you can see, I'm trying to follow pretty much the same template that the dump_db command tells me to, but still looks like somewhere the system is not happy with what I'm sending. The error on invalid attribute length while defining a new characteristic also occurs if I use the /CAC command (text mode).
My requirements -- create one service and two characteristics. On one characteristic, I want to send out notifications and want to receive data from a connected client on the other.
It will be great if you can help me resolve this issue.
Thanks.
Saranyan.
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The root cause is the parameter l is not set in customer’s binary command data.
Please do following in text mode or binary mode and refer attached picture by CySmart.
/cac,t=2800,r=1,w=0,c=0,l=0010,d=0000b10c2000089a9ee21115a1444444
[C0 19 05 01 00 28 01 00 00 10 00 10 00 00 00 B1 0C 20 00 08 9A 9E E2 11 15 A1 44 44 44 53]
/cac,t=2803,r=1,w=0,c=12,l=0010,d=0100b10c2000089a9ee21115a1444444
[C0 19 05 01 03 28 01 00 12 10 00 10 00 01 00 B1 0C 20 00 08 9A 9E E2 11 15 A1 44 44 44 69]
/cac,t=0000,r=0,w=1,c=12,l=0014,d=
[C0 09 05 01 00 00 00 01 12 14 00 00 00 8F]
/cac,t=2900,r=1,w=1,c=a,l=0002,d=
[C0 09 05 01 00 29 01 01 0A 02 00 00 00 9F]
/cac,t=2803,r=1,w=0,c=12,l=0010,d=0200b10c2000089a9ee21115a1444444
[C0 19 05 01 03 28 01 00 12 10 00 10 00 02 00 B1 0C 20 00 08 9A 9E E2 11 15 A1 44 44 44 6A]
/cac,t=0000,r=0,w=1,c=6,l=0014,d=
[C0 09 05 01 00 00 00 01 06 14 00 00 00 83]
/cac,t=2900,r=1,w=1,c=a,l=0002,d=
[C0 09 05 01 00 29 01 01 0A 02 00 00 00 9F]