#include "src/shared/queue.h"
#include "src/shared/util.h"
-#define MAX_ADV_DATA_LEN 31
-
struct bt_ad {
int ref_count;
char *name;
len = 2 + strlen(name);
- if (len > MAX_ADV_DATA_LEN - *pos)
- len = MAX_ADV_DATA_LEN - *pos;
+ if (len > BT_AD_MAX_DATA_LEN - *pos)
+ len = BT_AD_MAX_DATA_LEN - *pos;
return len;
}
return;
len = strlen(name);
- if (len > MAX_ADV_DATA_LEN - (*pos + 2)) {
+ if (len > BT_AD_MAX_DATA_LEN - (*pos + 2)) {
type = BT_AD_NAME_SHORT;
- len = MAX_ADV_DATA_LEN - (*pos + 2);
+ len = BT_AD_MAX_DATA_LEN - (*pos + 2);
}
buf[(*pos)++] = len + 1;
*length = calculate_length(ad);
- if (*length > MAX_ADV_DATA_LEN)
+ if (*length > BT_AD_MAX_DATA_LEN)
return NULL;
adv_data = malloc0(*length);
if (!ad)
return false;
- if (len > (MAX_ADV_DATA_LEN - 2 - sizeof(uint16_t)))
+ if (len > (BT_AD_MAX_DATA_LEN - 2 - sizeof(uint16_t)))
return false;
new_data = queue_find(ad->manufacturer_data, manufacturer_id_data_match,
if (!ad)
return false;
- if (len > (MAX_ADV_DATA_LEN - 2 - (size_t)bt_uuid_len(uuid)))
+ if (len > (BT_AD_MAX_DATA_LEN - 2 - (size_t)bt_uuid_len(uuid)))
return false;
new_data = queue_find(ad->service_data, service_uuid_match, uuid);
if (!ad)
return false;
- if (len > (MAX_ADV_DATA_LEN - 2))
+ if (len > (BT_AD_MAX_DATA_LEN - 2))
return false;
for (i = 0; i < sizeof(type_blacklist); i++) {