Reading a Pin Status to Android Device

2 posts / 0 new
Last post
gauravbvelex
Offline
Last seen:5 years 2 months ago
加入:2015-04-08 11:32
Reading a Pin Status to Android Device

Hi,

I have murata ZY board and I have started BLE development few days back. I am a absolute beginner to Bluetooth technology.

All I need to do is receiving a Pin status to BLE Central app (In this case BLE scanner on Android.)

I went through the Example "ble_app_peripheral" in "DA1458x_SDK".

I am able to turn On/Off the LED by writing '0x01' or '0x00' at characteristics "LED state".

What I figured out that from my BLE scanner if I go to Custom Service and then LED state and then I write "0x01" , below function is called

void user_catch_rest_hndl(ke_msg_id_t const msgid,
void const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)

it then switches to case:

case CUST1_IDX_LED_STATE_VAL:
user_custs1_led_wr_ind_handler(是否msg_param, dest_id, src_id);
break;

where the user_custs1_led_wr_ind_handler turns On/Off the LED.

But I could not find any code related to fetching Button Status.

On similar lines as mentioned above I expect the read to work. When I call Read from my Central Android device it just fetches 0 everytime.

I put breakpoint at all case scenarios in "user_catch_rest_hndl" but none is hit when 'Read' from central device is called.

Could you please guide how do I fetch a pin status to my central android device?

Keywords:
Device:
MT_dialog
Offline
Last seen:5 days 12 hours ago
Staff
加入:2015-06-08 11:34
Hi gauravbvelex,

Hi gauravbvelex,

You dont get any indication to the application that the value from the BLE is written. The reading is performed by the stack and the application can't know when a cental is accessing the values in the database. Other than that the characteristic of the LED is write no response meaning that you can't read the characteristic, you can only write it. If you want to monitor the status of your LED you should change the characteristics properties in read/write in order to read back the value that you 've just wrote to your characteristic. Just take as an example another characteristic with read/write properties to check how its done.

Thanks MT_dialog