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.

Adding service record in MSP430 and stonestreetone base application

Other Parts Discussed in Thread: MSP430F5438A

Hi All,

I am developing certain Bluetooth based device, using MSP430F5438A and PAN1325.

I want to add certain service record in my SDP record, for that I am using following API-

BTPSAPI_DECLARATION long BTPSAPI SDP_Create_Service_Record(unsigned int BluetoothStackID, unsigned int NumberServiceClassUUID, SDP_UUID_Entry_t SDP_UUID_Entry[]);

The API returns success but when I try to add the created service record by using API-

BTPSAPI_DECLARATION int BTPSAPI SDP_Delete_Attribute(unsigned int BluetoothStackID, DWord_t Service_Record_Handle, Word_t Attribute_ID);

The API always returns failure. I tried to change the last parameter but the code always fails.

Basically I want add UUIDs of RFCOMM, iAP protocol, ServiceDiscoveryServerServiceClassID, Public browse group.

Can anyone help me?

Thanks in advance,

Sharadanand Karanjkar

  • Hi,

    Just to clarify are you using SDP_Delete_Attribute here? Because to add it you would need to use the SDP_Add_Attribute?

    Thanks,

    Stonestreet One.

  • Hi Stonestreet One,


    I am using SDP_Add_Attribute command.

    Before that I am using SDP_Create_Service_Record and using the returned handle for adding the attributes.

    regards,

    Sharadanand Karanjkar

  • Hi Sharadanand Karanjkar,

    Could you post the actual calls of SDP_Create_Service_Record and SDP_Add_Attribute that you are making?

    Thanks,

    Stonestreet One.

  • Hi Stonestreet One,

    Following is code I am using for adding attribute-

    SDP_UUID_Entry_t SDP_recs[6] ={
        {
            deUUID_128,.UUID_Value.UUID_128 = {                     // RFCOMM UUID
                0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x10, 0x00,
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {                     // L2CAP UUID
                0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {                     // ServiceDiscoveryServerServiceClassID
                0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00,
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {                     // Public Browse group
                0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x00,
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {
                0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,     // Serial port UUID
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {
                0x00, 0x00, 0x00, 0x00, 0xDE, 0xCA, 0xFA, 0xDE,     // iPOD UUID
                0xDE, 0xCA, 0xDE, 0xAF, 0xDE, 0xCA, 0xCA, 0xFF
            }
        }
    };

    sdp_service_record_handle = SDP_Create_Service_Record(BluetoothStackID,6,SDP_recs);
          if (sdp_service_record_handle < 0)
          {
              Display(("\n Failed to get service record handle\n"));
          }

    retval = SDP_Add_Attribute(BluetoothStackID,sdp_service_record_handle,SDP_ATTRIBUTE_ID_SERVICE_RECORD_HANDLE,&elemrnt);
          if (retval!=0)
          {
              Display(("\nAttribute adding failed\r\n"));
          }
    This call fails adding attributes as third parameter might be wrong I do not what should be the value.

    So tried following command instead. This API returns success but I do not see expected results on service discovery. 
          retval = SDP_Add_Raw_Attribute(BluetoothStackID,sdp_service_record_handle,&element);
          if (retval!=0)
          {
              Display(("\nRaw Attribute adding failed\r\n"));
          }

    I hope this information is sufficient for helping me out.

    regards,

    Sharadaanand Karanjkar

  • Hi  All,

    I have found out the solution, here I used following code instead of above.

    static SPP_SDP_Service_Record_t SPP_SDP_Service_record;

    SDP_UUID_Entry_t SDP_recs[6] ={
        {
            deUUID_128,.UUID_Value.UUID_128 = {                     // RFCOMM UUID
                0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x10, 0x00,
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {                     // L2CAP UUID
                0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00,
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {                     // ServiceDiscoveryServerServiceClassID
                0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00,
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {                     // Public Browse group
                0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x00,
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {
                0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00,     // Serial port UUID
                0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
            }
        },
        {
            deUUID_128,.UUID_Value.UUID_128 = {
                0x00, 0x00, 0x00, 0x00, 0xDE, 0xCA, 0xFA, 0xDE,     // iPOD UUID
                0xDE, 0xCA, 0xDE, 0xAF, 0xDE, 0xCA, 0xCA, 0xFF
            }
        }
    };

     SPP_SDP_Service_record.NumberServiceClassUUID = 6;
                      SPP_SDP_Service_record.SDPUUIDEntries = SDP_recs;
                      SPP_SDP_Service_record.ProtocolList = NULL;
    ret_val = SPP_Register_SDP_Record(BluetoothStackID,ServerPortID,&SPP_SDP_Service_record,"SwingTIP",&SPPServerSDPHandle);

    Now I can see particular services when I perform service discovery with my device. Still I have not understood the problem with my earlier code.


    regards,

    Sharadanand Karanjkar