wiced_sense sending an uint16 value to mobile phone

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

cross mob
Anonymous
Not applicable

Hello everybody I am using wiced_sense

I create a code :

define uin16 counter;

when accelerometer changes the counter will be counter++;

I want to show the last counter value in my phone.

How can I make this happen.

I simply tried to chnage the version number with my counter value so that I can see the counter instead of the version number in wiced sense app

But it didnt work

Is there a simple way that I can see my counter value from my phone ?

0 Likes
3 Replies
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Information from the wiced_sense app is being received by a specialized app expecting very specific numbers in very specific formats. Additionally, simply changing a variable value won't send the information for you. And the version number information is not something that is sending in the background. Why update a static value?

Rather than trying to alter wiced_sense app, you're probably better off sending and receiving simple values to LightBlue app on your phone.  This will allow you to see the raw values being received by your phone. In that way, you will begin to understand more and more of what is happening.

My blog is Leveraging TAG4 to better understand the WICED Smart Programming Environment​. In order to gain a better understanding of the system, I highly recommend that you read through/implement Project 1 (at the bottom). This project is directed at people in your situation: sending sensor data over a simple BLE connection. After reading, please post any questions you have and I'll be more than happy to answer.

Jacob

Anonymous
Not applicable

jakewtorres​ Thank You very much for your help

It helped me a lot the project.

I got the idea.

I simply changed the battery level with my value like this =

bleprofile_ReadHandle(HANDLE_WICED_SENSE_BATTERY_LEVEL, &db_pdu);

  db_pdu.len = 1;

  db_pdu.pdu[0] = PostureCounter;  // My_Value

  bleprofile_WriteHandle(HANDLE_WICED_SENSE_BATTERY_LEVEL, &db_pdu);

  ble_trace1("Posture Logger  = ", wiced_sense_battery_level_in_percentage);

How can I changed the string name Battery Level 

In ble_uuid.h  file  I simply changed this line  like this =

  <AssignedNumber type="org.bluetooth.service.battery" uuid="180F" name="Posture_Logger" />

But in the app I still getting Battery Level charecter.

How can I change the name of it ?

Regards Yunus...

0 Likes
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

This is an invalid use of the GATT database. This UUID is specifically dedicated for use as the Battery Service per the BLE protocol. For any purposes other than experimentation, you should not be altering services defined by the BLE spec.

In the off chance that your phone will recognize that UUID as anything other than the Battery Service, this could be a result of what your phone is remembering the old GATT database as. You should "Forget Device" in you settings and reboot the phone. Then see if the name changes.

Jacob