1 Reply Latest reply on Oct 16, 2014 6:48 PM by VictorZ_46

    How to use bleprofile_sendNotification();

      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.??