The app_diss_task.c functiondiss_create_db_cfm_handler()that comes with the SDK does not include code to set the serial number. So I figured I would add it because we need it. So, I added some boiler plate code along with the other snippets that look a lot like this one.
But my client code doesn't see a serial number, nor does it show up on BlueLoupe (although I don't know if it ignores the serial number). I should add that my message does get dispatched to the task and the DISS_SET_CHAR_VAL_REQ message does get executed without error.
There is clearly something I'm missing... perhaps some help from the gallery?
thanks,
marco
// Set the serial number in the DB. APP_DIS_SERIAL_NUMBER = "149-235"
{
len = strlen(APP_DIS_SERIAL_NUMBER);
struct diss_set_char_val_req *req_id = KE_MSG_ALLOC_DYN(DISS_SET_CHAR_VAL_REQ, TASK_DISS, TASK_APP, diss_set_char_val_req, len);
// Fill in the parameter structure
req_id->char_code = DIS_SERIAL_NB_STR_CHAR;
req_id->val_len = len;
memcpy(&req_id->val[0], APP_DIS_SERIAL_NUMBER, len);
// Send the message
ke_msg_send(req_id);
}
I see that there is an APP_DIS_FEATURES that needs to be updated with with
| DIS_SERIAL_NB_STR_CHAR_SUP
but that didn't seem to help either.
Apparently, adding the flag to APP_DIS_FEATURES did the trick as my own app is able to read the serial number. Apparently BlueLoupe doesn't display it... I had thought it would display all available information.
Hi marcdog
Thanks for sharing.
Thanks MT_dialog