Home | History | Annotate | Download | only in src

Lines Matching defs:property

23 #include "btcore/include/property.h"
57 // property's `len` field. We special-case the equivalence of BDNAME
111 void property_free(bt_property_t *property) {
112 property_free_array(property, 1);
126 bool property_is_addr(const bt_property_t *property) {
127 assert(property != NULL);
128 return property->type == BT_PROPERTY_BDADDR;
131 bool property_is_device_class(const bt_property_t *property) {
132 assert(property != NULL);
133 return property->type == BT_PROPERTY_CLASS_OF_DEVICE;
136 bool property_is_device_type(const bt_property_t *property) {
137 assert(property != NULL);
138 return property->type == BT_PROPERTY_TYPE_OF_DEVICE;
141 bool property_is_discovery_timeout(const bt_property_t *property) {
142 assert(property != NULL);
143 return property->type == BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT;
146 bool property_is_name(const bt_property_t *property) {
147 assert(property != NULL);
148 return property->type == BT_PROPERTY_BDNAME;
151 bool property_is_rssi(const bt_property_t *property) {
152 assert(property != NULL);
153 return property->type == BT_PROPERTY_REMOTE_RSSI;
156 bool property_is_scan_mode(const bt_property_t *property) {
157 assert(property != NULL);
158 return property->type == BT_PROPERTY_ADAPTER_SCAN_MODE;
161 bool property_is_uuids(const bt_property_t *property) {
162 assert(property != NULL);
163 return property->type == BT_PROPERTY_UUIDS;
166 // Convenience conversion methods to property values
167 const bt_bdaddr_t *property_as_addr(const bt_property_t *property) {
168 assert(property_is_addr(property));
169 return (const bt_bdaddr_t *)property->val;
172 const bt_device_class_t *property_as_device_class(const bt_property_t *property) {
173 assert(property_is_device_class(property));
174 return (const bt_device_class_t *)property->val;
177 bt_device_type_t property_as_device_type(const bt_property_t *property) {
178 assert(property_is_device_type(property));
179 return *(const bt_device_type_t *)property->val;
182 uint32_t property_as_discovery_timeout(const bt_property_t *property) {
183 assert(property_is_discovery_timeout(property));
184 return *(const uint32_t *)property->val;
187 const bt_bdname_t *property_as_name(const bt_property_t *property) {
188 assert(property_is_name(property));
189 return (const bt_bdname_t *)property->val;
192 int8_t property_as_rssi(const bt_property_t *property) {
193 assert(property_is_rssi(property));
194 return *(const int8_t *)property->val;
197 bt_scan_mode_t property_as_scan_mode(const bt_property_t *property) {
198 assert(property_is_scan_mode(property));
199 return *(const bt_scan_mode_t *)property->val;
202 const bt_uuid_t *property_as_uuids(const bt_property_t *property, size_t *count) {
203 assert(property_is_uuids(property));
204 *count = sizeof(bt_uuid_t) / property->len;
205 return (const bt_uuid_t *)property->val;
209 bt_property_t *property = osi_calloc(sizeof(bt_property_t));
211 property->val = osi_malloc(len);
212 memcpy(property->val, val, len);
214 property->type = type;
215 property->len = len;
217 return property;