This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

related to app

Hi All, I am novice in this nordic nrf 51822 programming. I wanted to know the best way to do the following.

  1. I have two different functionalities to be run on eval board. at a time, only one functionality is run [mutually exlusive functionalities]. So the android app running on the mobile will select the functionality on the eval board. I don't want to use the RTOS and want to achieve the above functionality, please let me know how to achieve this [android app controlling WHICH functionality to run]?

Thanks

Parents
  • If I understand correctly, you want the central (phone) to be able to send data to the peripheral (nRF51822) and explicitly set it to run one out of two operations. Similar to setting a boolean flag. Please correct me if my understanding is incorrect.

    I would recommend looking at this application note: www.nordicsemi.com/.../30114525

    When sending this from the central to the peripheral, you will get a BLE_GATTS_EVT_WRITE event in on_ble_evt() function. You can then read out the data by adding another case:

    case BLE_GATTS_EVT_WRITE:
    {            
        ble_gatts_evt_write_t * p_evt_write = &p_ble_evt->evt.gatts_evt.params.write;
        uint8_t buffer[MAX_RECEIVED_SIZE];
        if (p_evt_write->len == MY_DESIRED_LEN)
            /* do something with data, is located in p_evt_write->data*/
            
    } 
    
Reply
  • If I understand correctly, you want the central (phone) to be able to send data to the peripheral (nRF51822) and explicitly set it to run one out of two operations. Similar to setting a boolean flag. Please correct me if my understanding is incorrect.

    I would recommend looking at this application note: www.nordicsemi.com/.../30114525

    When sending this from the central to the peripheral, you will get a BLE_GATTS_EVT_WRITE event in on_ble_evt() function. You can then read out the data by adding another case:

    case BLE_GATTS_EVT_WRITE:
    {            
        ble_gatts_evt_write_t * p_evt_write = &p_ble_evt->evt.gatts_evt.params.write;
        uint8_t buffer[MAX_RECEIVED_SIZE];
        if (p_evt_write->len == MY_DESIRED_LEN)
            /* do something with data, is located in p_evt_write->data*/
            
    } 
    
Children
No Data
Related