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

nrf51-ble-app-lbs communication with S120 Multilink

Hello,

I ran PCA10005 board with nrf51-ble-app-lbs application and programmed PCA10004 with S120 ble_app_multilink_central. I have connection between them (I just changed TARGET_DEV_NAME in central to 'LedButtonDemo'). However, I have no idea how to add functionality to Central to toggle a LED on ble-app-lbs in the way as Master Control Panel does (chosing a UUID 1525 and just send 01 value).. I was searching a lot.. considering sd_ble_gatts_hvx() usage but it's unclear for me.. I suppose I have to invoke somehow BLE_GATTS_EVT_WRITE event in ble-app-lbs.. but don't know how.. Please for advice.

  • Ok, I've done it. If somebody needs I'll share my piece of code:

    static void on_ble_evt(ble_evt_t * p_ble_evt){

    case BLE_GAP_EVT_CONNECTED:

    m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
    				
    gattc_params.flags = BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE;
    gattc_params.handle = 0x0011; // LED service handle
    gattc_params.len = len;
    gattc_params.offset = 0;
    gattc_params.write_op = BLE_GATT_OP_WRITE_CMD;					
    data[0] = (actual_rssi_stat == RSSI_NEAR ? 1 : 0);
    gattc_params.p_value = data;
    			
    sd_ble_gattc_write(m_conn_handle, &gattc_params);
        
        break; 
    

    }

    I don't know if it's 100% correct but works for me

  • Hi ! I have the same problem. Can you tell me what you add more? Because the gattc_params is not yet declare on Multilink example .

    Thanks in advance. Pedro

Related