1 2 Previous Next 16 Replies Latest reply on Apr 7, 2015 5:43 PM by user_78878863

    Sending an int16 Array via BLE Notification

    content.librarian

      Sorry to open a new question while I still have one open ("Did I Fry my Op Amps?"), but I have to figure out quite a few things in a relatively short period of time.

         

       

         

      I want to send an array of three int16 values from my PSoC device to a GATT client via a notification. I will eventually want to update these values in the GATT DB too, for client reads, but I'm just trying to get the notifications working for now.

         

       

         

      All the examples I've seen so far only send a single uint8 value over notifications (although I have seen some code for writing a uint8 array to the GATT DB), but when I try to modify these to work with my int16 array, I always get the following warning:

         

       

         

      incompatible pointer types assigning to 'uint8*'  (aka 'unsigned char *') from 'int16 (*)[3]'

         

       

         

      I've dug around in the BLE generated code and API docs, but I haven't yet found the solution to this issue. I'm pretty sure it has to do with my poor understanding of pointers (*), addresses (&), handles and so forth. I thought I was setting the type of data in the custom characteristic window of the BLE component, but I now see that I was only changing the data format of "New field."

         

       

         

      I don't really have a project complete enough to post yet, but here is a  snippet of code where I am getting the above warning. Any thoughts on how to accomplish what I am trying to do would be most helpful.

         

       

         

      Thanks,

         

      Don

         

       

         

       

         

              CYBLE_GATTS_HANDLE_VALUE_NTF_T      notificationHandle;

         

          

         

              if (weightsNotification & 0x01) {

         

       

         

                  // update notification with new data

         

                  notificationHandle.attrHandle = WEIGHTS_CHAR_HANDLE;

         

                  notificationHandle.value.val = &weightsArray;

         

                  notificationHandle.value.len = WEIGHTS_CHAR_DATA_LEN;

         

       

         

                  // Report data to BLE component for sending data by notifications

         

                  CyBle_GattsNotification(cyBle_connHandle, &notificationHandle);

         

              }

         
              
        1 2 Previous Next