This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/LAUNCHXL-CC2640R2: Button Service and SimpleKeys Service differences?

Part Number: LAUNCHXL-CC2640R2

Tool/software: Code Composer Studio

Hi,

     I would like to know what is the difference between Button Service and SimpleKeys Service? The Button Service does not notify button press at LightBlue Iphone App, however the SimpleKeys Service, does.

     At BLE Device Monitor, both Button Service and SimpleKeys Service function the same and both notify upon button press. 

Simplekeys Service at Light Blue Iphone App:


Button Service at LightBlue Iphone App: 



As you can see above the button service does not notify the value upon button press. The button service is from Project Zero and the SimpleKeys Service is ported from ble stack 2.2.

Also, the Get Parameter code is different. See, below. The Button Service Get Parameter does not save anything to value.

Simplekeys

bStatus_t SK_GetParameter(uint8 param, void *pValue)
{
  bStatus_t ret = SUCCESS;
  switch (param)
  {
    case SK_KEY_ATTR:
      *((uint8*)pValue) = skKeyPressed;
      break;
      
    default:
      ret = INVALIDPARAMETER;
      break;
  }
  
  return (ret);
}

Button Service.

bStatus_t ButtonService_GetParameter( uint8_t param, uint16_t *len, void *value )
{
  bStatus_t ret = SUCCESS;
  switch ( param )
  {
    default:
      Log_error1("GetParameter: Parameter #%d not valid.", (IArg)param);
      ret = INVALIDPARAMETER;
      break;
  }
  return ret;
}

- kel

  • Hi,

    Did you modify the Project Zero? The Button Service on the screenshot shows a UUID of FFF3. According to button_service.c, both buttons have notify characteristics:

    // Characteristic "BUTTON0" Properties (for declaration)
    static uint8_t bs_BUTTON0Props = GATT_PROP_NOTIFY | GATT_PROP_READ;
    ...
    // Characteristic "BUTTON1" Properties (for declaration)
    static uint8_t bs_BUTTON1Props = GATT_PROP_NOTIFY | GATT_PROP_READ;


    Best wishes
  • Hi Zahid,

    I modify the Project Zero to only have one button functionality(BUTTON0). The button_service.c profile code was generated from Bluetooth Developer Studio to only have on button (BUTTON0). Here is my BUTTON0 properties at button_service.c.

    /* Characteristic "BUTTON0" Properties (for declaration) */
    static uint8_t bs_BUTTON0Props = GATT_PROP_NOTIFY | GATT_PROP_READ;

    Using TI BLE Device Monitor, the BUTTON0 notifies. But using Light Blue Iphone App the BUTTON0 does not notify. Why is that?

    - kel