How to use bleprofile_sendNotification();

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

cross mob
Anonymous
Not applicable

Hi all,

I define a characteristic and it has notification property:

    PRIMARY_SERVICE_UUID128(HANDLE_SPI_SEND_SERVICE_UUID, UUID_SPI_SEND_SERVICE),

    CHARACTERISTIC_UUID128_WRITABLE(HANDLE_SPI_CHARACTERISTIC_SEND_DATA,                                        HANDLE_SPI_CHARACTERISTIC_SEND_DATA_VALUE,

                UUID_SPI_CHARACTERISTIC_SEND_DATA,

                LEGATTDB_CHAR_PROP_READ | LEGATTDB_CHAR_PROP_NOTIFY,

                LEGATTDB_PERM_READABLE, 14),

        0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, 0x0D,

      CHAR_DESCRIPTOR_UUID16_WRITABLE (HANDLE_SPI_CHARACTERISTIC_SEND_DATA_CLIENT_CONFIGURATION_DESCRIPTOR,

                                            UUID_DESCRIPTOR_CLIENT_CHARACTERISTIC_CONFIGURATION,

                                            LEGATTDB_PERM_READABLE | LEGATTDB_PERM_WRITE_REQ, 2),

        0x00,0x00,


And then, I try to send notification after write a new value to thí characteristic.

                    bleprofile_ReadHandle(HANDLE_SPI_CHARACTERISTIC_SEND_DATA_VALUE, &db_pdu);

                    db_pdu.len = length;

                    memcpy(db_pdu.pdu, &buffer[1],length);

                    bleprofile_WriteHandle(HANDLE_SPI_CHARACTERISTIC_SEND_DATA_VALUE, &db_pdu);

                    bleprofile_sendNotification(HANDLE_SPI_CHARACTERISTIC_SEND_DATA_VALUE, (UINT8 *)db_pdu.pdu, db_pdu.len);

But, on LightBlue app on Ipad, I don't receive any notification, although I pressed Start Notify button.

Please let me know what is my problem?

More over, on LightBlue app, I can press Start Notify button, then this button change to "Stop Notify".

But when I press this button again, it can't not change to Start Notify.??



1 Solution
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

You do not have WRITE properties on your characteristic, so it should not be CHARACTERISTIC_UUID128_WRITABLE but CHARACTERISTIC_UUID128.  Hope it will fix the problem.

View solution in original post

1 Reply
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

You do not have WRITE properties on your characteristic, so it should not be CHARACTERISTIC_UUID128_WRITABLE but CHARACTERISTIC_UUID128.  Hope it will fix the problem.