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.

RE: LP-CC1352P7: Data streamer example code for LP-CC1352P7

Other Parts Discussed in Thread: CC1352P7, CC2650, CC2340R5

Hello Arthur,

I have ported the simple serial socket client example code to CC1352P7 from your given link of github. All compilation errors are solved except some warnings.

I can see the uart terminal printing "Info: Done Initializing".

I have changed the required UUIDs as per required serial client code.

I am confused with how i can connect CC1352p7 with CC2650 (BLE peripheral) with manufacturer ID.

Please help me with this

Thank you,

Dnyaneshvar Salve

  • hello Arther,

    can you please help me to set manufacturer specific data in cc2650 so that i can connect CC1352P7 to it

  • Hello,

    I have changed the code and now able to connect to the BLE peripheral CC2650.

    static void SimpleSerialSocketClient_processAppMsg(ssscEvt_t *pMsg)
    {
        bool safeToDealloc = TRUE;
        // Specify the address 84:C6:92:F3:E7:B0
    //    uint8_t targetAddress[B_ADDR_LEN] = {0x84, 0xC6, 0x92, 0xF3, 0xE7, 0xB0};//
        uint8_t targetAddress[B_ADDR_LEN] = {0xB0, 0xE7, 0xF3, 0x92, 0xC6, 0x84};//
    
        switch (pMsg->hdr.event)
        {
        case SSSC_EVT_ADV_REPORT:
        {
    
            target_addr_matched = 0;
            GapScan_Evt_AdvRpt_t *pAdvRpt = (GapScan_Evt_AdvRpt_t*) (pMsg->pData);
    //        if (SimpleSerialSocketClient_findSerialStreamServer(
    //                SimpleStreamServerUUID, serverManufData,
    //                sizeof(serverManufData), pAdvRpt->pData, pAdvRpt->dataLen))
    
            for (int i = 0; i < B_ADDR_LEN; ++i) {
                    if ((pAdvRpt->addr[i]) == (targetAddress[i])) {
                        target_addr_matched++;
                    }
                    else
                    {
                        unmatched++;
                        return;
                    }
                }
            if(target_addr_matched==B_ADDR_LEN)
            {
                // We found our device
                scanningStarted = FALSE;
    
                // Disable scanning
                GapScan_disable("");
    
                // Establish a connection to the device
                GapInit_connect(pAdvRpt->addrType & MASK_ADDRTYPE_ID, pAdvRpt->addr,
                                INIT_PHY_1M, 0);
            }
    
            // Free report payload data
            if (pAdvRpt->pData != NULL)
            {
                ICall_free(pAdvRpt->pData);
            }
    
            break;
        }

    i am checking the ble address of peripheral and if desired address device is found then connects to it.

           for (int i = 0; i < B_ADDR_LEN; ++i) {
                    if ((pAdvRpt->addr[i]) == (targetAddress[i])) {
                        target_addr_matched++;
                    }
                    else
                    {
                        unmatched++;
                        return;
                    }
                }

    Now, I am getting this on Terminal,

    but I dont see anything printed on terminal window when I type.

    I think as per the readme on github, i need to enable the notification.

    Please help me with this.

    thank you,

    Dnyaneshvar Salve

  • Hi,

    The data inputted in the terminal won't be displayed. Only the data received by the device over BLE will be displayed.

    Best regards,

  • hello,

    I am not receiving any data at the cc2650 end as well

  • hello?

    (3 April 12:30 pm IST)

  • hello clement?

    This issue is open from many days.

    Please dont post one liner vague answer and hide.

    If you really want to help, please share the timing when you are available or direct me in the better direction

    (3 April 12:47 pm IST)

    Dnyaneshvar Salve

  • Hi,

    Thank you for your patience. Support is delayed because of the confusions on the device part numbers being used.

    Based on the log provided, I understand you manage to establish a Bluetooth connection between the devices. However, based on your description, notification reception is not enabled. Is it correct?

    Notifications should be enabled by the client (also Bluetooth central for this example). Can you confirm this operations is successfully done on the central side?
    Notifications should be enabled by writing to the CCCD characteristic associated to the characteristic you wish to receive notifications from.

    • Ensure the GATT_WriteNoRsp() function executes properly
    • Ensure the GATT write is done on the proper attribute handle - can be checked by retrieving the GATT table of the server using host_test + BTool for example
    • Replace the CC2650 by a phone running SIMPLELINK-CONNECT-SW-MOBILE-APP to check if you can successfully enable notifications
    • Check on the server side if the GATT write to turn on notifications is properly received
    • Use a Bluetooth sniffer to see if other issues may be at played

    I hope this will help,

    Best regards,

  • Hi,

    I found out that CC1352 is not able to discover the ble simple service on CC2650

    I have changed the service uuid in simple_stream_profile_client.h and bcomdef.h as shown in attached image.

    It is showing "SIMPLE_DISCOVERY_UNSUCCESSFUL"

  • Hi, 

    Interesting. For sanity, can you please check the same has been updated on both devices?

    Have you implemented other changes except this one? 
    Again, to fully confirm the issue is /is not on the CC2650, I would recommend to use a phone to verify the GATT table of the CC2650 contains the expected elements. 

    Best regards, 

  • hi,

    Yes I have confirmed that CC2650 is able to sent notification on lightblue android application. I have changed characteristic 5 on CC2650 as 1 bytes (same as characteristic 4).

    So, this is not about (at least at this moment) enabling notifications.

    Yes, CC2650 have the required service and characteristics as well with defined UUID.

  • any more clue to debug more?

  • Hi, 

    Great to see the CC2650 works the way you want.  Now, let’s focus the efforts on the CC1352P7. 
    Maybe you could start with stepping in the code while performing the GATT table discovery. This could help you understand how the CC1352P7 “sees” the table. 
    Best regards, 

  • Hi,                                   (10 April 2024, 01:30 IST)

    i think CC1352 is able to find the service UUID but some conditions in code are not met. 

    as per the screenshot,

    in function uint32_t SimpleServiceDiscovery_discoverService(uint16_t connHandle, ICall_EntityID entity,
    simpleService_t *service, gattMsgEvent_t *pMsg) 

    in Case,

    case BLE_DISC_STATE_SVC:
    {
    // Service found, store handles
    if (pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP &&
    pMsg->msg.findByTypeValueRsp.numInfo > 0)
    {
    service->startHandle = ATT_ATTR_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
    service->endHandle = ATT_GRP_END_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
    // char * uart_msg_str = "Service found, store handles\n\r";
    // UART2_write(uartHandle, uart_msg_str, strlen(uart_msg_str), NULL);
    }

    this "if" condition is not being satisfied.

    and control directly try to exit the function with last line

    return retVal;

     

  • IT'S BEEN 13 DAYS , THIS PROBLEM IS POSTED HERE.

    BUT STILL NO RELIABLE ANSWERS WHICH CAN ACTUALLY LEAD TO SOLVE THE PROBLEM.

  • Hi,

    in my modified ported code, "Number of handles information" found is Zero,

    and in the unmodified simple_central_LP_CC1352P7_4_tirtos7_ticlang code "Number of handles information" found is ONE,

  • Clément ???                        (12 April 12:50 pm IST)

  • Hi Dnyaneshvar,

    Do you have a sniffer log of the service discovery process?

    You can use another TI LaunchPad with the Packet Sniffer software:

    https://www.ti.com/tool/download/PACKET-SNIFFER-2/1.9.0

    Cheers,

    Marie H

  • Hi Marie H,

    Pleas see the attached image for sniffer log of BLE connection.

  • Also I followed the instruction on https://software-dl.ti.com/lprf/simplelink_academy/modules/ble_01_basic/ble_01_basic.html and scanned for the attribute table of CC2650. Attching the screenshot for more inforamtion.

  • Hi Dnyaneshvar,

    Can you post the whole sniffer log? I want to look at the service discovery exchange. (If you don't want to post it here on the forum you can send it to me over PM.)

    Cheers,

    Marie H

  • Hello Marie H,

    I have shared one sniffer log on personal message.

    when BLE peripheral device advertises, we can see the service UUID in the sniffer log.

    is that sufficient? or need more inputs from me?

    thank you,

    Dnyaneshvar Salve

  • I have also sent a personal message of a sniffer log which logs information when CC1352 sends a connection request to CC2650.

    But I dont see any service UUID information in that log

  • Hi Dnyaneshvar,

    Thanks for sending the logs, but it's not exactly what we need.

    If I understand your issue correctly, you're getting a BLE_DISC_STATE_SVC event but the pMsg fields are empty. I.e. something is wrong with service discovery.

    Service discovery is a process that happens after the devices have connected. (You're correct that the device can have one or more service UUID in the advertisement packet, but that information is not carried over to the service discovery process. The central device has to start from scratch.) If you capture a successful service discovery process on your sniffer log, you will se that the central is requesting service handles and the peripheral is sending them over. Based on this the central builds a service table like the one in the screen shot you sent.

    If you're having trouble capturing the connection on the sniffer log, it can help to modify advertising to only use one channel, and then make sure the sniffer is sniffing on the same channel. 

    Cheers,

    Marie H

  • Hello Marie H,

    If you're having trouble capturing the connection on the sniffer log, it can help to modify advertising to only use one channel, and then make sure the sniffer is sniffing on the same channel. - 

    Does this means that i need to configure my peripheral to advertise on specific channel and also to set sniffer to look for this specific adv channel?

    if so if possible can you please help me to do this

    thank you

    Dnyaneshvar Salve

  • Hi Dnyaneshvar,

    1. Instructions for changing the Advertising channel map are gien in this SimpleLink Academy. You have to update the advChannelMap.

    https://dev.ti.com/tirex/explore/node?node=A__AKZ9pF.Uwg1ra8sjP2oUSw__com.ti.SIMPLELINK_ACADEMY_CC2640R2SDK__7unKOT8__LATEST&placeholder=true 

    2. I think the sniffer uses channel 37 by default. So if you use this one on your peripheral they will use the same channel.

    3. You can see how to set up the sniffer to follow a connection in the User's Guide, scroll down to Packet Sniffer, SmartRF Sniffer Agent Setup.

    https://dev.ti.com/tirex/content/simplelink_cc13xx_cc26xx_sdk_7_40_00_77/docs/ble5stack/ble_user_guide/html/ble-stack-5.x-guide/debugging-index.html

    Cheers,

    Marie H

  • Hello Marie H,

    Thank you for your help.

    I have set the CC2650 to advertise on channel no 37 as per the instructions given in provided link and also verified that CC2650 uses channel no 37 to advertise it data using the sniffer.

    Yes, sniffer by default uses the channel no. 37.

    There is no change in the sniffer results.

    I even tried to connect the CC2650 (BLE peripheral) with LightBlue android application and sent some data to CC2650.

    But came to know that I don't get any sniffer information after both BLE central and peripheral gets connected to each other.

    attaching the screenshot.

    in screenshot after the connection, there is is no information about the BLE communication between this ble devices after connection is established.

    I am sending a personal message containing the whole sniffer log for details.

    May be the sniffer is not capturing the data after BLE connection is established.

    (We have many ble devices (CC2650 and other) in office and I dont see none of them exchanging data on sniffer log, only ADV and SCAN RSP)

    ----------------------------------------------------------------------------------------------------------

    Apart from this I wanted to share some information with you.

    On the below link of github, there is a note about limitation of project.

    It about different project CC2340R5 (SDK7.40). link given below,

    https://github.com/TexasInstruments/ble_examples/blob/simplelink_low_power_f3_sdk-7.40/examples/rtos/LP_EM_CC2340R5/ble5stack/basic_ble_GATT_client/README.md .

    But when i tried to co-relate it with my current problem and came to know about the initialized structure variable streamServiceHandle with .numChars = 2, in file simple_serial_socket_client.c (screenshot attached).

    But in my BLE peripheral application it has 21 characteristics.

    This structure is used in 

    Function uint32_t SimpleServiceDiscovery_discoverService(uint16_t connHandle, ICall_EntityID entity,
    simpleService_t *service, gattMsgEvent_t *pMsg)
    {

    in file simple_service_discovery.c for service discovery related functions.

    Does this has anything related to my problem?

    thank you,

    Dnyaneshvar Salve

  • Hello Marie H,

    I have update.

    I took reference of Project "simple_central_LP_CC1352P7_4_tirtos7_ticlang".

    and made some changes in simple_service_discovery.c file. (16 bit UUID is required instead of 128 bit)

    As I changed service->uuid.uuid, to uuid and service->uuid.len to ATT_BT_UUID_SIZE.

    I started to discover simple service successfully.

    (Please refer the screenshot attached).

    But still when I type something on console, i am not receiving anything on BLE peripheral side (CC2650)

    regards,

    Dnyaneshvar Salve

  • Hi Dnyaneshvar,

    That's good to hear.

    Can you clarify what program you're running on the CC2650 LaunchPad? The github documentation you linked is for CC2340, not CC2650.

    Cheers,

    Marie H

  • Hello Marie H,

    on CC2650 I am using Simple BLE peripheral example code.

    we have increased the size of characteristic 5 to receive 244 bytes data.

    it is our production code and we are using from past 2 years. CC2650 code does not have issues.

    thank you

    Dnyaneshvar Salve

  • one more update Marie H,

    I have started receiving data on my CC2650 ble peripheral.

    I did some more changes in central side code, will be sharing here soon.

    regards,

    Dnyaneshvar Salve

  • Hello Marie H,

    sharing code changes for other peoples (also for future me)

    file name  - simple_stream_profile_client.c

    added this code since I am using CC2650 with 5 characteristic in its simple service

    
    // SimpleStreamClient Service UUID
    //CONST uint8_t SimpleStreamServerUUID[ATT_UUID_SIZE] =
    //{
    // TI_BASE_UUID_128(SIMPLESTREAMSERVER_SERV_UUID)
    //};
    //
    //// DataIn UUID
    //CONST uint8_t SimpleStreamServer_DataInUUID[ATT_UUID_SIZE] =
    //{
    //
    //  TI_BASE_UUID_128(SIMPLESTREAMSERVER_DATAIN_UUID)
    //};
    //// DataOut UUID
    //CONST uint8_t SimpleStreamServer_DataOutUUID[ATT_UUID_SIZE] =
    //{
    //  TI_BASE_UUID_128(SIMPLESTREAMSERVER_DATAOUT_UUID)
    //};
    
    
    #define TI_BASE_UUID_16( uuid )  LO_UINT16( uuid ),HI_UINT16( uuid )
    
    CONST uint8_t SimpleStreamServerUUID[ATT_BT_UUID_SIZE] =
    {
     TI_BASE_UUID_16(SIMPLESTREAMSERVER_SERV_UUID)
    };
    
    // DataIn UUID
    CONST uint8_t SimpleStreamServer_DataInUUID[ATT_BT_UUID_SIZE] =
    {
    
      TI_BASE_UUID_16(SIMPLESTREAMSERVER_DATAIN_UUID)
    };
    // DataOut UUID
    CONST uint8_t SimpleStreamServer_DataOutUUID[ATT_BT_UUID_SIZE] =
    {
      TI_BASE_UUID_16(SIMPLESTREAMSERVER_DATAOUT_UUID)
    };
    
    
    //  EXTRA CHARACTERISTIC FOR TESTING
    CONST uint8_t SimpleStreamServer_DataOutUUID2[ATT_BT_UUID_SIZE] =
    {
      TI_BASE_UUID_16(SIMPLESTREAMSERVER_DATAOUT_UUID2)
    };
    
    CONST uint8_t SimpleStreamServer_DataOutUUID3[ATT_BT_UUID_SIZE] =
    {
      TI_BASE_UUID_16(SIMPLESTREAMSERVER_DATAOUT_UUID3)
    };
    
    CONST uint8_t SimpleStreamServer_DataOutUUID4[ATT_BT_UUID_SIZE] =
    {
      TI_BASE_UUID_16(SIMPLESTREAMSERVER_DATAOUT_UUID4)
    };
    
    /*********************************************************************
     * LOCAL VARIABLES
     */
    
    // Data queue to hold the outgoing data
    static List_List streamOutQueue;
    
    static uint16_t heapHeadroom = 0;
    
    /*********************************************************************
    * Service Discovery Table
    */
    //simpleService_t streamServiceHandle =
    //{
    //  // Set Simple Stream Server service UUID
    //  .uuid = { ATT_UUID_SIZE, SimpleStreamServerUUID},
    //  .startHandle = GATT_INVALID_HANDLE,
    //  .endHandle   = GATT_INVALID_HANDLE,
    //  .numChars = 2,
    //  .chars =
    //    {
    //      // Set DataIn UUID
    //      {
    //        .uuid = { ATT_UUID_SIZE, SimpleStreamServer_DataInUUID},
    //        .handle = GATT_INVALID_HANDLE,
    //        .cccdHandle = GATT_INVALID_HANDLE,
    //      },
    //      // Set DataOut UUID
    //      {
    //        .uuid = { ATT_UUID_SIZE, SimpleStreamServer_DataOutUUID},
    //        .handle = GATT_INVALID_HANDLE,
    //        .cccdHandle = GATT_INVALID_HANDLE,
    //      }
    //    },
    //};
    simpleService_t streamServiceHandle =
    {
      // Set Simple Stream Server service UUID
      .uuid = { ATT_BT_UUID_SIZE, SimpleStreamServerUUID},
      .startHandle = GATT_INVALID_HANDLE,
      .endHandle   = GATT_INVALID_HANDLE,
      .numChars = 5,
      .chars =
        {
         {
           .uuid = { ATT_BT_UUID_SIZE, SimpleStreamServer_DataInUUID},
           .handle = GATT_INVALID_HANDLE,
           .cccdHandle = GATT_INVALID_HANDLE,
         },
         {
           .uuid = { ATT_BT_UUID_SIZE, SimpleStreamServer_DataOutUUID},
           .handle = GATT_INVALID_HANDLE,
           .cccdHandle = GATT_INVALID_HANDLE,
         },
         {
           .uuid = { ATT_BT_UUID_SIZE, SimpleStreamServer_DataOutUUID3},
           .handle = GATT_INVALID_HANDLE,
           .cccdHandle = GATT_INVALID_HANDLE,
         },
         {
           .uuid = { ATT_BT_UUID_SIZE, SimpleStreamServer_DataOutUUID4},
           .handle = GATT_INVALID_HANDLE,
           .cccdHandle = GATT_INVALID_HANDLE,
         },
         // Set DataIn UUID
         {
           .uuid = { ATT_BT_UUID_SIZE, SimpleStreamServer_DataOutUUID2},
           .handle = GATT_INVALID_HANDLE,
           .cccdHandle = GATT_INVALID_HANDLE,
         },
        },
    };

    and ,

    File name - simple_service_discovery.c  below (Actually doesn't have any changes now, but added since i have added many comments for better understanding of code)

    /**********************************************************************************************
     * Filename:       simple_service_discovery.c
     *
     * Description:    This file contains the implementation of the simple service discovery API.
     *
     * Copyright (c) 2018-2023, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     *************************************************************************************************/
    
    /*********************************************************************
     * INCLUDES
     */
    #include <string.h>
    
    #include "simple_service_discovery.h"
    #include "icall_ble_api.h"
    #include <ti/drivers/UART2.h>
    extern UART2_Handle uartHandle;
    
    /*********************************************************************
     * DEFINES
     */
    
    /*********************************************************************
     * MACROS
     */
    
    /*********************************************************************
     * CONSTANTS
     */
    
    /*********************************************************************
     * ENUMS
     */
    
    // Discovery states
    typedef enum
    {
        BLE_DISC_STATE_IDLE, BLE_DISC_STATE_SVC,                // Service discovery
        BLE_DISC_STATE_CHAR                 // Characteristic discovery
    } discStates_t;
    
    // Parsing info response states
    typedef enum
    {
        BLE_INFO_RSP_IDLE,                 // Looking for characteristic UUID
        BLE_INFO_RSP_DESC,                 // Looking for char. descriptor UUID
        BLE_INFO_RSP_CCCD,           // Looking for client char. configuration UUID
    } parseState_t;
    
    /*********************************************************************
     * GLOBAL VARIABLES
     */
    
    /*********************************************************************
     * LOCAL VARIABLES
     */
    
    // State of the discovery process
    static discStates_t discoveryState = BLE_DISC_STATE_IDLE;
    
    // Parsing info response state
    static parseState_t findInforRspState = BLE_INFO_RSP_IDLE;
    
    /*********************************************************************
     * LOCAL FUNCTIONS
     */
    static void SimpleServiceDiscovery_processFindInfoRsp(attFindInfoRsp_t rsp,
                                                          simpleService_t *service);
    
    /*********************************************************************
     * PUBLIC FUNCTIONS
     */
    
    /*********************************************************************
     * @fn      SimpleServiceDiscovery_discoverService
     *
     * @brief   Perform discovery of the given simpleService_t structure.
     *          This function is to be called inside the GATT discovery event
     *          callback to process the service discovery.
     *
     * @param   connHandle    - connection handle
     *          entity        - ICall entity of the calling task
     *          *service      - pointer to the service struct
     *          *pMsg         - pointer to the received gattMsgEvent_t
     *
     * @return  SIMPLE_DISCOVERY_SUCCESSFUL, SIMPLE_DISCOVERY_FINDING_SERVICE,
     *          SIMPLE_DISCOVERY_FINDING_CHAR or SIMPLE_DISCOVERY_UNSUCCESSFUL.
     */
    //uint32_t SimpleServiceDiscovery_discoverService(uint16_t connHandle,
    //                                                ICall_EntityID entity,
    //                                                simpleService_t *service,
    //                                                gattMsgEvent_t *pMsg)
    //{
    //    uint32_t retVal = 0;
    //
    //    switch (discoveryState)
    //    {
    //    case BLE_DISC_STATE_IDLE:
    //    {
    //        discoveryState = BLE_DISC_STATE_SVC;
    //
    //        // Discovery the service
    //        GATT_DiscPrimaryServiceByUUID(connHandle, service->uuid.uuid, service->uuid.len, entity);
    //
    //        retVal = SIMPLE_DISCOVERY_FINDING_SERVICE;
    //        break;
    //    }
    //    case BLE_DISC_STATE_SVC:
    //    {
    //        // Service found, store handles
    //        if (pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP &&
    //            pMsg->msg.findByTypeValueRsp.numInfo > 0)
    //        {
    //            service->startHandle = ATT_ATTR_HANDLE(
    //                    pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
    //            service->endHandle = ATT_GRP_END_HANDLE(
    //                    pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
    //        }
    //
    //        // If procedure complete
    //        if (((pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP)
    //                && (pMsg->hdr.status == bleProcedureComplete))
    //                || (pMsg->method == ATT_ERROR_RSP))
    //        {
    //            if (service->startHandle != 0)
    //            {
    //                discoveryState = BLE_DISC_STATE_CHAR;
    //                GATT_DiscAllCharDescs(connHandle, service->startHandle,
    //                                      service->endHandle, entity);
    //                retVal = SIMPLE_DISCOVERY_FINDING_CHAR;
    //            }
    //            else
    //            {
    //                discoveryState = BLE_DISC_STATE_IDLE;
    //                retVal = SIMPLE_DISCOVERY_UNSUCCESSFUL;
    //            }
    //        }
    //        break;
    //    }
    //    case BLE_DISC_STATE_CHAR:
    //    {
    //        // Characteristic found, store handle
    //        if (pMsg->method == ATT_FIND_INFO_RSP)
    //        {
    //
    //            if (pMsg->msg.findInfoRsp.numInfo > 0)
    //            {
    //                SimpleServiceDiscovery_processFindInfoRsp(pMsg->msg.findInfoRsp,
    //                                                          service);
    //            }
    //
    //            if (pMsg->hdr.status == bleProcedureComplete)
    //            {
    //                discoveryState = BLE_DISC_STATE_IDLE;
    //                retVal = SIMPLE_DISCOVERY_SUCCESSFUL;
    //            }
    //        }
    //        break;
    //    }
    //    default:
    //        break;
    //    }
    //
    //    return retVal;
    //}
    
    uint32_t SimpleServiceDiscovery_discoverService(uint16_t connHandle,
                                                    ICall_EntityID entity,
                                                    simpleService_t *service,
                                                    gattMsgEvent_t *pMsg)
    {
        uint32_t retVal = 0;
    
        switch (discoveryState)
        {
        case BLE_DISC_STATE_IDLE:
        {
            discoveryState = BLE_DISC_STATE_SVC;
    
    #define SIMPLEPROFILE_SERV_UUID               0xFFF0
            uint8_t uuid[ATT_BT_UUID_SIZE] = { LO_UINT16(SIMPLEPROFILE_SERV_UUID),
                                               HI_UINT16(SIMPLEPROFILE_SERV_UUID) };
            // Discovery the service
            GATT_DiscPrimaryServiceByUUID(connHandle, service->uuid.uuid, service->uuid.len, entity);   // THIS WILL ALSO WORK NOW SINCE I HAVE INITIALISED THE simpleService_t streamServiceHandle STRUCTURE WITH REQUIRED FIELDS SAME AS 16 BIT uuid
    //        GATT_DiscPrimaryServiceByUUID(connHandle, uuid, ATT_BT_UUID_SIZE, entity);  //Send 16 bit UUID, NOT 128BIT - IT WILL FAIL 128BIT UUID
            retVal = SIMPLE_DISCOVERY_FINDING_SERVICE;
            break;
        }
        case BLE_DISC_STATE_SVC:
        {
            // Service found, store handles
            if (pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP &&
                pMsg->msg.findByTypeValueRsp.numInfo > 0)
            {
                service->startHandle = ATT_ATTR_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
                service->endHandle = ATT_GRP_END_HANDLE(pMsg->msg.findByTypeValueRsp.pHandlesInfo, 0);
            }
    
            // If procedure complete
            if (((pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP)&&
                    (pMsg->hdr.status == bleProcedureComplete))
                    || (pMsg->method == ATT_ERROR_RSP))
            {
                if (service->startHandle != 0)
                {
    //                #define SIMPLEPROFILE_CHAR5_UUID            0xFFF5
                    // Discover characteristic
                    discoveryState = BLE_DISC_STATE_CHAR;
    
                    GATT_DiscAllCharDescs(connHandle, service->startHandle,
                                          service->endHandle, entity);
    
                    retVal = SIMPLE_DISCOVERY_FINDING_CHAR;
                    UART2_write(uartHandle, "SIMPLE_DISCOVERY_SUCCESSFUL\r\n",29, NULL);
                }
                else
                {
                    char print_str[] = "SIMPLE_DISCOVERY Failed \r\n";
                    UART2_write(uartHandle,print_str, strlen(print_str), NULL);
    
                    discoveryState = BLE_DISC_STATE_IDLE;
                    retVal = SIMPLE_DISCOVERY_UNSUCCESSFUL;
                }
            }
            break;
        }
        case BLE_DISC_STATE_CHAR:
        {
    //        char print_str[] = "Looking for characteristics 5 \r\n";
    //        UART2_write(uartHandle,print_str, strlen(print_str), NULL);
    
            // Characteristic found, store handle
            if (pMsg->method == ATT_FIND_INFO_RSP)
            {
                if (pMsg->msg.findInfoRsp.numInfo > 0)
                {
                    SimpleServiceDiscovery_processFindInfoRsp(pMsg->msg.findInfoRsp,
                                                              service);
                }
    
                if (pMsg->hdr.status == bleProcedureComplete)
                {
                    discoveryState = BLE_DISC_STATE_IDLE;
                    retVal = SIMPLE_DISCOVERY_SUCCESSFUL;
                    UART2_write(uartHandle, "Simple Svc Found\r\n", 18, NULL);
                }
            }
            break;
        }
        default:
            break;
        }
    
        return retVal;
    }
    
    /*********************************************************************
     * @fn      SimpleSerialBridgeClient_processFindInfoRsp
     *
     * @brief   Process a ATT findInfoRsp and populates a simple service struct
     *
     * @param   rsp     - findInfoRsp msg.
     * @param   service - service struct to populate.
     *
     * @return  void
     */
    static void SimpleServiceDiscovery_processFindInfoRsp(attFindInfoRsp_t rsp,
                                                          simpleService_t *service)
    {
        static uint8_t lastCharIndex;
        uint8_t i = 0;
        uint8_t uuidLength =
                (rsp.format == ATT_HANDLE_BT_UUID_TYPE) ?
                        ATT_BT_UUID_SIZE : ATT_UUID_SIZE;//rsp.format = ATT_BT_UUID_SIZE = 2
    //clear
        uint8_t *pPair = rsp.pInfo; //This pointer has all the information of available handles and their UUIDs, we have 18 (rsp.numInfo = 18) handles so [18 * 2 (2byte handle size) * 2 (2 byte UUID size)] = 72
        //if we see this rsp.pInfo variable in expression window and select see as array with size 72, we can see all the handles and their UUIDs
        uint8_t pairSize = 2 + uuidLength;  //2 + 2  = 4 //pairSize  = 4, Reason - handle is 2 bytes and here UUID is also 2 bytes so 4 bytes
    
        //Below while pointer is searching for the des
        while (pPair != (rsp.pInfo + (pairSize * rsp.numInfo)))//rsp.numInfo is no. of handles found in the given service, we have (rsp.numInfo = 18)18 handles in out simple service
        {
            switch (findInforRspState)
            {
            case BLE_INFO_RSP_IDLE:
            {
                // We are looking for a characteristic declaration   ie. 0x2803 which is characteristic declaration UUID
                if (!memcmp(characterUUID, &pPair[2], ATT_BT_UUID_SIZE))
                {
                    // We found it, move to state 2
                    findInforRspState = BLE_INFO_RSP_DESC;
    //                char print_str[] = "char decl UUID match\r\n";
    //                UART2_write(uartHandle,print_str, strlen(print_str), NULL);
                }
                else
                {
    //                char print_str[] = "char decl diffnt\r\n";
    //                UART2_write(uartHandle,print_str, strlen(print_str), NULL);
                }
    
                break;
            }
                // We look for specific characteristics
            case BLE_INFO_RSP_DESC:
            {
    
                for (i = 0; i < service->numChars; i++)
                {
                    // Is it this one?
                    if ((service->chars[i].uuid.len == uuidLength)
                            && (!memcmp(service->chars[i].uuid.uuid, &pPair[2],
                                        uuidLength)))
                    {
                        // We found it, save the handle
                        service->chars[i].handle = BUILD_UINT16(pPair[0], pPair[1]);
                        lastCharIndex = i;
                        // Look for a cccd
                        findInforRspState = BLE_INFO_RSP_CCCD;
    
                        break;
                    }
                }
    
                break;
            }
            case BLE_INFO_RSP_CCCD:
            {
                // Is there a CCCD belonging to this characteristic?
                if (!memcmp(clientCharCfgUUID, &pPair[2], ATT_BT_UUID_SIZE))
                {
                    // We found it, save the handle
                    service->chars[lastCharIndex].cccdHandle = BUILD_UINT16(
                            pPair[0], pPair[1]);
                    // Go back to looking for a new characteristic
                    findInforRspState = BLE_INFO_RSP_IDLE;
                }
                // Found new characteristic!
                else if (!memcmp(characterUUID, &pPair[2], ATT_BT_UUID_SIZE))
                {
                    findInforRspState = BLE_INFO_RSP_DESC;
                }
    
                break;
            }
            default:
                break;
            }
    
            // Move pointer to next pair    //if desired handle is not found move pointer to the next pair
            pPair += pairSize;
        }
    }
    

    File name  - simple_stream_profile_client.h

    /*********************************************************************
    * CONSTANTS
    */
    // Service UUID
    //#define SIMPLESTREAMSERVER_SERV_UUID 0xC0C0
    #define SIMPLESTREAMSERVER_SERV_UUID 0xFFF0
    
    //  Characteristic UUIDs
    //#define SIMPLESTREAMSERVER_DATAIN_UUID 0xC0C1
    #define SIMPLESTREAMSERVER_DATAIN_UUID 0xFFF5
    
    //#define SIMPLESTREAMSERVER_DATAOUT_UUID 0xC0C2
    #define SIMPLESTREAMSERVER_DATAOUT_UUID 0xFFF1
    
    #define SIMPLESTREAMSERVER_DATAOUT_UUID2 0xFFF2
    #define SIMPLESTREAMSERVER_DATAOUT_UUID3 0xFFF3
    #define SIMPLESTREAMSERVER_DATAOUT_UUID4 0xFFF4
    
    // Server profile UUIDs
    //extern const uint8_t SimpleStreamServerUUID[ATT_UUID_SIZE];
    //extern const uint8_t SimpleStreamServer_DataInUUID[ATT_UUID_SIZE];
    //extern const uint8_t SimpleStreamServer_DataOutUUID[ATT_UUID_SIZE];
    
    extern const uint8_t SimpleStreamServerUUID[ATT_BT_UUID_SIZE];
    extern const uint8_t SimpleStreamServer_DataInUUID[ATT_BT_UUID_SIZE];
    extern const uint8_t SimpleStreamServer_DataOutUUID[ATT_BT_UUID_SIZE];
    
    extern const uint8_t SimpleStreamServer_DataOutUUID2[ATT_BT_UUID_SIZE];
    extern const uint8_t SimpleStreamServer_DataOutUUID3[ATT_BT_UUID_SIZE];
    extern const uint8_t SimpleStreamServer_DataOutUUID4[ATT_BT_UUID_SIZE];
    

    One thing to note here is that had set 

    Data IN UUID  with 0xFFF1 and Data Out 0xFFF5,

    as name suggests Data out means this uuid will be used for sending the data, but here is the catch, Data In UUID is used for sending (Transmitting) the data to BLE peripheral..

    Also changes shared in previous posts are also required to connect to the BLE peripheral device with given MAC id (Hard coded) instead of looking for manufacturer data.

    regards,

    Dnyaneshvar Salve