Do we have any example for implementing a characteristic with more than 20 bytes? Thanks.
Do we have any example for implementing a characteristic with more than 20 bytes? Thanks.
When you initialize your characteristic then write:
attr_md.vlen = 1; // <- variable attribute length
attr_md.vlen = 0; // <- fixed attribute length
Thanks Martin. Is attribute length to be variable or fixed defined in the central? The spec I have for the peripheral only says length up to 512 bytes. Basically I have to use variable attribute length. But does central care? Or central is going to detect this vlen bit to decide what to do.
Central doesn't know nor care whether the property is fixed or variable length, it's not something reported as a property of the characteristic. The central, when reading, will just read at ever larger offsets until it gets a shorter than MTU packet or a response saying there is no data at that offset.
Sweet, I thought I saw your similar comment somewhere else. LoL. So the softdevice is handling this multiple packet and offsetting logic?
No the central is handling the multi byte packet and offsetting logic by sending repeated ATT calls with different offsets in them. The softdevice just sends back the bytes at that offset, up to the max MTU, or an error message if the characteristic doesn't have bytes past that offset.