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.

CC2640R2F: SDKv4.40: Bluetooth Service Generator uint16_t len?

Part Number: CC2640R2F

Hi,

I recently used the custom Bluetooth Service Generator at Simplelink Academy CC2640R2F SDKv4.40. Why is the size of len uint16_t, at earlier versions this was uint8_t..

extern bStatus_t XXXXservice_SetParameter(uint8_t param, uint16_t len, void *value);
extern bStatus_t XXXXservice_GetParameter(uint8_t param, uint16_t *len, void *value)
typedef void (*xxxxserviceChange_t)(uint16_t connHandle, uint16_t svcUuid, uint8_t paramID, uint16_t len, uint8_t *pValue);

-kel

  • Hi,

    This change has been introduced in SDK 4.10.

    Actually, we haven't change the size of any parameter. We have only added one parameter (uint16_t svcUuid).

    -typedef void (*sunlightServiceChange_t)(uint16_t connHandle, uint8_t paramID, uint16_t len, uint8_t *pValue);
    +typedef void (*sunlightServiceChange_t)(uint16_t connHandle, uint16_t svcUuid, uint8_t paramID, uint16_t len, uint8_t *pValue);

    I hope this will help,

    Best regards,

  • Actually, we haven't change the size of any parameter

    For the SetParameter and GetParameter C functions before the len was uint8_t. 

    Just want to add, at the GetParameter generated code uint16_t *len. Is this even correct. Actually the len does not serve any purpose. 

    bStatus_t xxxxservice_GetParameter( uint8_t param, uint16_t *len, void *value )
    {
      bStatus_t ret = SUCCESS;
      switch ( param )
      {
        case xxxxSERVICE_OFFSETCHAR_ID:
          memcpy(value, xxxxservice_OffsetCharVal, xxxxSERVICE_OFFSETCHAR_LEN);
          break;
    
        case xxxxSERVICE_TOTALTIMECHAR_ID:
          memcpy(value, xxxxservice_TotalTimeCharVal, xxxxSERVICE_TOTALTIMECHAR_LEN);
          break;
    
        case xxxxSERVICE_INFOCHAR_ID:
          memcpy(value, xxxxservice_InfoCharVal, xxxxSERVICE_INFOCHAR_LEN);
          break;
    
        case xxxxSERVICE_ONOFFRECCHAR_ID:
          memcpy(value, xxxxservice_OnOffRecCharVal, xxxxSERVICE_ONOFFRECCHAR_LEN);
          break;
    
        default:
          ret = INVALIDPARAMETER;
          break;
      }
      return ret;
    }

    -kel

  • Hi again,

    I am not sure we are referring to the same lab. From what I an see the parameter len for the get and set parameter function has been a uint16_t for a long time.

    Anyway, this does not change much - I mean as long as you are not mixing both implementations.

    Regards,

  • I am not sure we are referring to the same lab. From what I an see the parameter len for the get and set parameter function has been a uint16_t for a long time.

    No explanation whether it is correct or not.

    Whatever, I will just modify it accordingly.

    -kel