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.

Sending values with Bluetopia on CC2564

Other Parts Discussed in Thread: MSP430F5437A

I have a question about sending Characteristic using CC2564B  Bluetopia protocol stack. I am able to send service GUID but not any characteristic and values. In bluetopia protocol stack we can’t find any data type for characteristic or value.

Please advise asap as we have a demo in 2 days.

thanks,

  • Hello, this is the customer with more info on this issue.

    We are running Bluetooth on the following platform:

    MCU - Texas Instruments MSP430FS437AIPN
    Bluetooth device - CC2564BRVMT
    Bluetooth stack - Bluetopia

    We are trying to creating a profile by setting up the following Service Table:

    Device 
    GUID: 8A19C976-4A09-4F02-A21A-F6D9283E5391
    Advertised local device name:  CARDIUS
    Service description
    GUID: C933D629-9038-4181-AFEE-7FA1AF628980
    Data Control Characteristic:
    GUID: 1FDB7ECE-439B-439E-8996-E4AB1C358071
    Write-Only
    Write a 1 to enable streaming, write a 0 to disable
    Disabled by default
    Streaming Data Characteristic:
    GUID: EBB43C0C-7D56-4867-ACE9-02A5ADF09A57
    Notify only
    Data has MTU (max transmission unit) of 30 bytes.  
    Note: This is to make it easy for iOS development.  We may not be able to do this for Android. This is still under investigation.
    Data is 0x10 for the first 10 bytes, 0x20 for the second 10 bytes and 0x30 for the final 10 bytes
    Notification happens every 10 msec when enabled.


    Our programmers have been struggling with how to properly pack this data into the transmit buffer so that we can receive it using the Light Blue program on an IPAD.

    An error we are receiving is that when we try to transmit the service table we can send two GUID's, e.g. Service Description and any one of the two characteristics, but when we try to transmit the Service description and the two characteristics together, the first characteristic does not display on the Blue Light application.

    We are wondering whether we are using the right function calls to properly set up the characteristics and the properties.

    Specifically, at this point it looks like we need an expert to review what we are doing and to advise the correct C code function calls and parameters to properly set this up.


    Thank you for your assistance on this matter!

  • Hi,

    Could you please first try the default KeyFobDemo app for example, to first make sure that BLE is functional?  http://processors.wiki.ti.com/index.php/CC256x_MSP430_Bluetopia_Basic_KeyFobDemo_APP

    If BLE is functional than you can try the below.

    SPPLE is not a standard Bluetooth Profile. You will have to make sure the app can use the custom UUIDs that are needed to communicate and read and write to the app.

    If you want to test SPPLE communication you can try and use the SPPLE chat application for iPhone. See http://processors.wiki.ti.com/index.php/CC256x_MSP430_Bluetopia_Basic_SPPLEDemo_APP#Connecting_to_an_iPhone_running_SPPLE_Chat_application

  • thanks Sundeep, Please see latest feedback from the customer.

    We saw [in the manual] that it sends out the service table along with its characteristic and value to Lightblue app running on iOS.

    That feature is exactly what we need to implement on our device “be able to send characteristic & value & service UUIDS”.

    Today we looked at the example of Keyfob sample supplied by TI but it does not help at all since it does not send any service UUIDs and Characteristic & Value data out to the client (Lightblue app).

    I also tried to get the firmware source code of the sensor tag device but not allowed to do that.

    Can you help us on this issue ASAP?

     THanks,

  • In the keyfob sample, the device (as server) sends out the 2-byte UUIDs to the client. How can you modify the code so that it will send out 16-byte UUIDs instead.

    Thanks!

  • Sundeep,

    We have another question for you...

    There is a very critical problem with cold boot. The MSP430F5437A is being used. The program runs ok on 5438A development board and also on the real 5437A target board but taking off the power and the battery on that 5437A board, there is a Bluetooth error - 104 (pairability error, low energy supported). This is a result of a cold boot (board is without power for more than 10 seconds).

    OpenStack().

    Bluetooth Stack ID: 1.

    Device Chipset: 4.0.

    BD_ADDR: 0xD03972CD9736

    GAP_LE_Set_Pairability_Mode Failed: -104.

    SetPairable Failed: -104.

     

    The code needs to be reloaded. Do you know what could cause this?

    Thank you,

    Trenton Reed

  • Hi,

    Regarding the error you are facing it is BTPS_ERROR_LOCAL_CONTROLLER_DOES_NOT_SUPPORT_LE.  Please make sure you are having the below patch and the LE patch is getting downloaded  http://processors.wiki.ti.com/index.php/CC256x_MSP430_Bluetopia_Basic_Demo_APPS#CC256XB_Information

    If the Board is without power, when it boots up it need to follow the power up sequence (first three steps from link)  http://processors.wiki.ti.com/index.php/CC256x_Testing_Guide

    and related to the previous post, please see the response I have received internally

    We tried using the UUIDs that you gave us we had no problems getting the service and two characteristics at the same time(images attached with light blue). We also got the same result when we tried to do discover all services with a Bluetopia Client. Can they double check your service table to see if everything is setup properly? Can you also see if you can do a service discovery using the Bluetopia stack as Client to see if you get a different result? 

    7360.sampleservicetable.txt
    
    static BTPSCONST GATT_Primary_Service_128_Entry_t VIDEO_Service_UUID =
    {
       VIDEO_SERVICE_BLUETOOTH_UUID_CONSTANT
    };
    
     /* The Tx Characteristic Declaration.                                */
    static BTPSCONST GATT_Characteristic_Declaration_128_Entry_t Data_Control_Declaration =
    {
       GATT_CHARACTERISTIC_PROPERTIES_NOTIFY,
       DATA_CONTROL_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT
    };
    
    static BTPSCONST GATT_Characteristic_Value_128_Entry_t  Data_Control_Value =
    {
       DATA_CONTROL_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
       0,
       NULL
    };
    
     /* The Tx Characteristic Declaration.                                */
    static BTPSCONST GATT_Characteristic_Declaration_128_Entry_t Streaming_Data_Declaration =
    {
       GATT_CHARACTERISTIC_PROPERTIES_NOTIFY,
       STREAMING_DATA_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT
    };
    
    static BTPSCONST GATT_Characteristic_Value_128_Entry_t  Streaming_Data_Value =
    {
       STREAMING_DATA_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
       0,
       NULL
    };
    
    
       /* Client Characteristic Configuration Descriptor.                   */
    static GATT_Characteristic_Descriptor_16_Entry_t Client_Characteristic_Configuration =
    {
       GATT_CLIENT_CHARACTERISTIC_CONFIGURATION_BLUETOOTH_UUID_CONSTANT,
       GATT_CLIENT_CHARACTERISTIC_CONFIGURATION_LENGTH,
       NULL
    };
    
    BTPSCONST GATT_Service_Attribute_Entry_t VIDEO_Service[] =
    {
    	{GATT_ATTRIBUTE_FLAGS_READABLE,          aetPrimaryService128,            (Byte_t *)&SPPLE_Service_UUID},                  	//0
    	{GATT_ATTRIBUTE_FLAGS_READABLE,          aetCharacteristicDeclaration128, (Byte_t *)&Data_Control_Declaration},			    //1
    	{GATT_ATTRIBUTE_FLAGS_WRITABLE, 		 aetCharacteristicValue128,       (Byte_t *)&Data_Control_Value},					//2
    	{GATT_ATTRIBUTE_FLAGS_READABLE,          aetCharacteristicDeclaration128, (Byte_t *)&Streaming_Data_Declaration},			//3
    	{GATT_ATTRIBUTE_FLAGS_WRITABLE, 		 aetCharacteristicValue128,       (Byte_t *)&Streaming_Data_Value}					//4
    	{GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicDescriptor16,   (Byte_t *)&Client_Characteristic_Configuration}	//5
    	
    };
    	
    	#define VIDEO_SERVICE_ATTRIBUTE_COUNT               (sizeof(VIDEO_Service)/sizeof(GATT_Service_Attribute_Entry_t))
    	
    	#define Data_Control_CHARACTERISTIC_ATTRIBUTE_OFFSET 					2
    	#define Streaming_Data_CHARACTERISTIC_ATTRIBUTE_OFFSET					4
    	#define Streaming_Data_CHARACTERISTIC_CCD_ATTRIBUTE_OFFSET 				5
    	
               
    
    #define VIDEO_SERVICE_BLUETOOTH_UUID_CONSTANT { 0xC9, 0x33, 0xD6, 0x29, 0x90, 0x38, 0x41, 0x81, 0xAF, 0xEE, 0x7F, 0xA1, 0xAF, 0x62, 0x89, 0x80 }
    
    #define DATA_CONTROL_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT { 0x1F, 0xDB, 0x7E, 0xCE, 0x43, 0x9B, 0x43, 0x9E, 0x89, 0x96, 0xE4, 0xAB, 0x1C, 0x35, 0x80, 0x71 }
    
    #define STREAMING_DATA_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT { 0xEB, 0xB4, 0x3C, 0x0C, 0x7D, 0x56, 0x48, 0x67, 0xAC, 0xE9, 0x02, 0xA5, 0xAD, 0xF0, 0x9A, 0x57 }

  • Thank you for your responses Sundeep.

    We are still looking for an answer to the question regarding the keyfob sample source code. The
    SPPLEDemo sample is the one you need to enter the commands from the terminal
    for Bluetooth handshaking or communication. What we want is the communication
    runs between client/server automatically for transferring profile settings
    between them.

    Regards,

    Trenton Reed

  • Hi,

    Do you mean you want to pair one and after that it should automatically pair. If so I hope the below post will help.

    http://e2e.ti.com/support/wireless_connectivity/f/660/p/360569/1267592.aspx

  • Is there a way to define a buffer of 6 bytes in the Characteristic and Value?

  • I found the way to change the data attribute type of the Characteristic and Value. It is working.

  • Hi,

    Good to hear that you were able to send the Characteristic and Value.

    Could you please share the solution here, For the benefit of others who are referring this link.

  • My project requirement is to be able to send the A2D digital data (6 bytes) through the Bluetooth LE notification packets. Therefore, I have to modify the Key Press Characteristic to achieve this requirement. I also modify the ProcessButtons add-function to get called every 2ms instead of every second.

    1. period rate

    // if(BTPS_AddFunctionToScheduler(ProcessButtons, NULL, 1000))

    if(BTPS_AddFunctionToScheduler(ProcessButtons, NULL, 2))

    2. create a buffer with size of 6 in KFS.c

    Byte_t Key_Press_Value[6] = {0x01,0x02,0x03,0x04,0x05,0x06};

    3. modify key press client characteristic descriptor

    /* The Key Pressed Characterist Value. */
    static BTPSCONST GATT_Characteristic_Value_16_Entry_t KFS_Key_Pressed_Value =
    {
    // TI_KFS_KEYPRESSED_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
    // 0,
    // NULL
    TI_KFS_KEYPRESSED_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
    6,
    Key_Press_Value
    };

    int BTPSAPI KFS_Read_Client_Configuration_Response(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int TransactionID, Boolean_t NotificationsEnabled)
    {

       ....

    /* Acquire the specified KFS Instance. */
    if((ServiceInstance = AcquireServiceInstance(BluetoothStackID, &InstanceID)) != NULL)
    {
    /* Format the Read Response. */
    // ValueLength = NON_ALIGNED_WORD_SIZE;
    // ASSIGN_HOST_WORD_TO_LITTLE_ENDIAN_UNALIGNED_WORD(&ClientConfiguration, ((NotificationsEnabled)?GATT_CLIENT_CONFIGURATION_CHARACTERISTIC_NOTIFY_ENABLE:0));
    ValueLength = NON_ALIGNED_WORD_SIZE * 3;

    /* Send the response. */
    // ret_val = GATT_Read_Response(ServiceInstance->BluetoothStackID, TransactionID, (unsigned int)ValueLength, (Byte_t *)&ClientConfiguration);
    ret_val = GATT_Read_Response(ServiceInstance->BluetoothStackID, TransactionID, (unsigned int)ValueLength, (Byte_t *)&ClientConfiguration[0]);

    /* UnLock the previously locked Bluetooth Stack. */
    BSC_UnLockBluetoothStack(ServiceInstance->BluetoothStackID);
    }
    else
    ret_val = KFS_ERROR_INVALID_INSTANCE_ID;
    }
    else
    ret_val = KFS_ERROR_INVALID_PARAMETER;

    ...

    }

    int BTPSAPI KFS_Notify_Key_Press_State(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID, KFS_Key_Pressed_State_t *KeyPressState)
    {

       ...

    if((ServiceInstance = AcquireServiceInstance(BluetoothStackID, &InstanceID)) != NULL)
    {
    /* Format the notification. */
    KeyPressed = 0;
    if(KeyPressState->KeyOnePressed)
    KeyPressed |= TI_KFS_KEY_PRESSED_BUTTON_ONE_PRESSED;

    if(KeyPressState->KeyTwoPressed)
    KeyPressed |= TI_KFS_KEY_PRESSED_BUTTON_TWO_PRESSED;

    // ASSIGN_HOST_BYTE_TO_LITTLE_ENDIAN_UNALIGNED_BYTE(&KeyPressedState, KeyPressed);

    /* Send the notification. */
    // ret_val = GATT_Handle_Value_Notification(ServiceInstance->BluetoothStackID,
    // ServiceInstance->ServiceID,
    // ConnectionID,
    // KFS_KEY_PRESS_CHARACTERISTIC_OFFSET,
    // (unsigned int)NON_ALIGNED_BYTE_SIZE, (Byte_t *)&KeyPressedState);
    ret_val = GATT_Handle_Value_Notification(ServiceInstance->BluetoothStackID,
    ServiceInstance->ServiceID,
    ConnectionID,
    KFS_KEY_PRESS_CHARACTERISTIC_OFFSET,
    (unsigned int)NON_ALIGNED_BYTE_SIZE*6, (Byte_t *)&Key_Press_Value[0]);

    }

  • Hi,

    Thank you very much.