This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Adding Characteristic User Description 0x2901,0x2902

Hi Team,

I am trying to implement Blugiga's cable replacement service in Nordic chip. I have successfully changed required UUIDs for services and characteristics please refer it here

Now unable to do following:

  1. Adding Characteristic User Description 0x2901,0x2902

  2. I need to maintain backward compatibility with current Mobile Application which communicates with bluegiga using following:

Mobile App to Blugiga Opcode: Write Request (0x12) Handle: 0x000a Value: 0200

Opcode: Prepare Write Request (0x16) Offset: 0 Value:38a3cf34fb27d83b8e58db

Blugiga to Mobile App Opcode: Handle Value Indication (0x1d) Handle: 0x0008 Value:010203031

I am modifying ble_uart application which uses different handles and commands to communicate with nordic's uart mobile application.

What to do so that I can make non-nordic Mobile application to work with Nordic soc.

Please help!!!

Regards, Milan

  • //mj uint32_t err_code; ble_gatts_attr_md_t cccd_md; ble_uuid128_t nus_base_uuid_char = NUS_BASE_UUID_CHAR;

    memset(&cccd_md, 0, sizeof(cccd_md));
    
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.write_perm);
    
    cccd_md.vloc = BLE_GATTS_VLOC_STACK;
    //mj
    
    memset(&char_md, 0, sizeof(char_md));
    	char_md.char_props.indicate			 = 1; //mj
    char_md.char_props.write         = 1;
    //char_md.char_props.write_wo_resp = 1; //mj
    char_md.p_char_user_desc         = NULL;
    char_md.p_char_pf                = NULL;
    char_md.p_user_desc_md           = NULL;
    char_md.p_cccd_md                = &cccd_md; //mj NULL earlier
    char_md.p_sccd_md                = NULL;
    

    Still not showing 0x2901 in Mobile Application.

  • Again, 0x2901 is User Description. To add the User Description, the char_md.p_user_desc_md must be set as well. Do the same as you do for CCCD, but use different ble_gatts_attr_md_t instances of course.

  • doing same for char_md.p_user_desc_md stops advertising. LED1 doesn't blink after assigning char_md.p_user_desc_md = &ud_md; //ud_md is different instance

  • What does the call-stack look like when you end up in the app error handler? What error code are you seeing? If the UD writable you must set the wr_aux flag to 1. I believe this is your problem now.

  • I gave you the answer to this on friday, in the Mypage support portal. A quick search in the forum returns this: devzone.nordicsemi.com/.../

    That is the 0x2901.

    Add these lines to your code:

    static char user_desc[] = "name";
    char_md.p_char_user_desc  = (uint8_t *) user_desc;
    char_md.char_user_desc_size = strlen(user_desc);
    char_md.char_user_desc_max_size = strlen(user_desc);
    
Related