Can arbitrary UUID is set after starting FW?

6 posts / 0 new
Last post
Teruyuki Nomura
Offline
Last seen:8 months 2 days ago
加入:2016-06-30 08:34
Can arbitrary UUID is set after starting FW?

I wan't to set arbitrary uuid .

I want to change the service uuid, depending on the parts connected to the CPU.
For example, if i2c 9 axis sensor implementation, 0000-0000-0000-0001.
if i2c ADC sensor implementation, 0000-0000-0000-0002.

I tried changing the service uuid and the characteristic uuid of CUSTS1 profile for testing.

Below is the code for testing.

-----------------------------------------------------------------
prf_init_func / prf_utils.c / line1465

uint8_t i=0;
uint8_t j=0;
static att_svc_desc128_t uuid;
while( cust_prf_funcs[i].task_id != TASK_NONE )
{
if( cust_prf_funcs[i].init_func != NULL )
{
for (j=0; j<16; j++) {
cust_prf_funcs[i].att_db[CUST1_IDX_SVC].uuid[j]=j;
cust_prf_funcs[i].att_db[CUST1_IDX_LONG_VALUE_VAL].uuid[j]=j+1;
}
cust_prf_funcs[i++].init_func();
}
else i++;
}

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

However, when the service uuid is changed, it becomes impossible to connect.
The above code was not reflected on the characteristic uuid.

Can arbitrary uuid is set after starting FW?
How to set arbitrary UUID after starting FW?

Thanks,
Nomura.

Keywords:
Device:
MT_dialog
Offline
Last seen:1 month 12 hours ago
Staff
加入:2015-06-08 11:34
Hi Teruyuki Nomura,

Hi Teruyuki Nomura,

For changing the Service UUID and the characteristic UUID you can try to apply what i indicate below,

uint8_t array_test_svc[] = {0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03};
uint8_t array_test_long_char[] = {0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04};

memcpy(cust_prf_funcs[i].att_db[CUST1_IDX_SVC].value, array_test_svc, 16); //This will do the change on the service

// For changing the characteristics value you will have to apply the change in two places
memcpy(cust_prf_funcs[i].att_db[CUST1_IDX_SVC].value + (16*7), array_test_long_char, 16); //Apply the change to the array of the included characteristics of the service
memcpy(cust_prf_funcs[i].att_db[CUST1_IDX_LONG_VALUE_CHAR].value + 3, array_test_long_char, 16); //Apply the change to the characteristic itself

Although this is not tested or supported by dialog and its just a suggestion, but it seems to operate, placed in the app_custs1_create_db() function.

Regarding the numbers that i ve placed in order to place the appropriate offset, the 16*7 is 16 UUID bytes and the number of the characteristic in the service and the +3 offset is the offset of the permissions of the characteristic +2 and the permissions of the characteristic +1.

Thanks MT_dialog

chenpenglai
Offline
Last seen:20 hours 8 min ago
加入:2018-12-24 02:24
it didn't work

hello MT_Dialog

Your suggestion doesn't seem to work

PM_Dialog
Offline
Last seen:9 hours 16 min ago
Staff
加入:2018-02-08 11:03
嗨chenpenglai,

嗨chenpenglai,

Could you please indicate the SDK / BLE Device / project that you are using in order to follow the suggested steps?

Is it DA14580 and SDK5.0.4? In the initial post the DA14580 is tagged? If yes, which project are you using?

I would strongly suggest to create a new forum thread, as this one is old and closed.

Thanks, PM_Dialog

chenpenglai
Offline
Last seen:20 hours 8 min ago
加入:2018-12-24 02:24
Hi PM_Dialog,

Hi PM_Dialog,

yes, I'm using DA14580 and SDK5.0.4

I want to change the service uuid, but I haven't found the way yet...

It's no use me following your advice

PM_Dialog
Offline
Last seen:9 hours 16 min ago
Staff
加入:2018-02-08 11:03
嗨chenpenglai,

嗨chenpenglai,

In order to change the UUID of the Custom 1 Service, please configure the DEF_CUST1_SVC_UUID_128 in user_custs1_def.h file according to your requirement. Please try to create a new forum thread as this one is closed.

Thanks, PM_Dialog