Bluetooth: Host: Add const prefix for UUID
Add const prefix for service uuid and char uuid. Since Service UUID and Char UUID should not change in the service definition, they are most reasonably defined as rodata, also for save some ram footprint. The field `attr->user_data` type is `void *`, as this PR change all Service UUID to rodata, so there must add (void *) to avoid warning. Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
This commit is contained in:
parent
a51af14729
commit
786b9a0ad4
35 changed files with 81 additions and 79 deletions
|
@ -450,7 +450,7 @@ static int add_icon_object(struct mpl_mediaplayer *pl)
|
|||
int ret;
|
||||
struct bt_ots_obj_add_param add_param = {};
|
||||
struct bt_ots_obj_created_desc created_desc = {};
|
||||
struct bt_uuid *icon_type = BT_UUID_OTS_TYPE_MPL_ICON;
|
||||
const struct bt_uuid *icon_type = BT_UUID_OTS_TYPE_MPL_ICON;
|
||||
static char *icon_name = "Icon";
|
||||
|
||||
if (obj.busy) {
|
||||
|
@ -488,7 +488,7 @@ static int add_current_track_segments_object(struct mpl_mediaplayer *pl)
|
|||
int ret;
|
||||
struct bt_ots_obj_add_param add_param = {};
|
||||
struct bt_ots_obj_created_desc created_desc = {};
|
||||
struct bt_uuid *segs_type = BT_UUID_OTS_TYPE_TRACK_SEGMENT;
|
||||
const struct bt_uuid *segs_type = BT_UUID_OTS_TYPE_TRACK_SEGMENT;
|
||||
|
||||
if (obj.busy) {
|
||||
LOG_ERR("Object busy");
|
||||
|
@ -522,7 +522,7 @@ static int add_track_object(struct mpl_track *track)
|
|||
{
|
||||
struct bt_ots_obj_add_param add_param = {};
|
||||
struct bt_ots_obj_created_desc created_desc = {};
|
||||
struct bt_uuid *track_type = BT_UUID_OTS_TYPE_TRACK;
|
||||
const struct bt_uuid *track_type = BT_UUID_OTS_TYPE_TRACK;
|
||||
int ret;
|
||||
|
||||
if (obj.busy) {
|
||||
|
@ -565,7 +565,7 @@ static int add_parent_group_object(struct mpl_mediaplayer *pl)
|
|||
int ret;
|
||||
struct bt_ots_obj_add_param add_param = {};
|
||||
struct bt_ots_obj_created_desc created_desc = {};
|
||||
struct bt_uuid *group_type = BT_UUID_OTS_TYPE_GROUP;
|
||||
const struct bt_uuid *group_type = BT_UUID_OTS_TYPE_GROUP;
|
||||
|
||||
if (obj.busy) {
|
||||
LOG_ERR("Object busy");
|
||||
|
@ -599,7 +599,7 @@ static int add_group_object(struct mpl_group *group)
|
|||
{
|
||||
struct bt_ots_obj_add_param add_param = {};
|
||||
struct bt_ots_obj_created_desc created_desc = {};
|
||||
struct bt_uuid *group_type = BT_UUID_OTS_TYPE_GROUP;
|
||||
const struct bt_uuid *group_type = BT_UUID_OTS_TYPE_GROUP;
|
||||
int ret;
|
||||
|
||||
if (obj.busy) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue