EZ-Serial Creating New GATT Service and associated characteristics
SaranyanRajagopalan Nov 6, 2017 5:35 AMHi 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.