4 Replies Latest reply on Feb 11, 2014 9:34 AM by userc_2132

    Error writing characteristic

      So I am trying to write a temperature characteristic. I am using..

       

      #define HANDLE_SENSOR_TEMP_NOTIFY                    0x7f

          CHARACTERISTIC_UUID128 (0x007e, HANDLE_SENSOR_TEMP_NOTIFY, UUID_CHARACTERISTIC_TEMP,

                                 LEGATTDB_CHAR_PROP_READ | LEGATTDB_CHAR_PROP_NOTIFY | LEGATTDB_CHAR_PROP_INDICATE,

                                 LEGATTDB_PERM_READABLE, 2),

            0x00, 0x00,

       

      then... 

       

      UINT32 thermvolt = adc_readVoltage(THERMISTOR);

       

      BLEPROFILE_DB_PDU db_pdu;

      bleprofile_ReadHandle(HANDLE_SENSOR_TEMP_NOTIFY, &db_pdu);

       

      db_pdu.pdu[0] = thermvolt & 0xFF;

            db_pdu.pdu[1] = (thermvolt >> 8) & 0xFF;

            ble_trace1("pdu0: %d\n", thermvolt & 0xFF);

            ble_trace1("pdu1: %d\n", (thermvolt >> 8) & 0xFF);

      bleprofile_WriteHandle(HANDLE_SENSOR_TEMP_NOTIFY, &db_pdu);

       

      It seems that it works for certain numbers.. but if the number gets to a certain format, I am unable to read it on my smartphone application. E.g.. I can read 3030 (or '0''0').. but I cannot read the ADC reading of 1700 or initialize it to 0xFF, 0xFF..

       

      Any ideas on how to remedy this? Thank you.