Lines Matching refs:p_buf
51 BT_HDR* p_buf = in attp_build_mtu_cmd() local
54 p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_mtu_cmd()
58 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_mtu_cmd()
59 p_buf->len = GATT_HDR_SIZE; /* opcode + 2 bytes mtu */ in attp_build_mtu_cmd()
61 return p_buf; in attp_build_mtu_cmd()
73 BT_HDR* p_buf = (BT_HDR*)osi_malloc(GATT_DATA_BUF_SIZE); in attp_build_exec_write_cmd() local
76 p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_exec_write_cmd()
78 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_exec_write_cmd()
79 p_buf->len = GATT_OP_CODE_SIZE; in attp_build_exec_write_cmd()
86 p_buf->len += 1; in attp_build_exec_write_cmd()
89 return p_buf; in attp_build_exec_write_cmd()
104 BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + L2CAP_MIN_OFFSET + 5); in attp_build_err_cmd() local
106 p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_err_cmd()
112 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_err_cmd()
115 p_buf->len = GATT_HDR_SIZE + 1 + 1; in attp_build_err_cmd()
117 return p_buf; in attp_build_err_cmd()
133 BT_HDR* p_buf = in attp_build_browse_cmd() local
136 uint8_t* p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_browse_cmd()
138 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_browse_cmd()
139 p_buf->len = GATT_OP_CODE_SIZE + 4; in attp_build_browse_cmd()
144 p_buf->len += gatt_build_uuid_to_stream(&p, uuid); in attp_build_browse_cmd()
146 return p_buf; in attp_build_browse_cmd()
162 BT_HDR* p_buf = in attp_build_read_by_type_value_cmd() local
165 p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_read_by_type_value_cmd()
166 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_read_by_type_value_cmd()
167 p_buf->len = 5; /* opcode + s_handle + e_handle */ in attp_build_read_by_type_value_cmd()
173 p_buf->len += gatt_build_uuid_to_stream(&p, p_value_type->uuid); in attp_build_read_by_type_value_cmd()
175 if (p_value_type->value_len + p_buf->len > payload_size) in attp_build_read_by_type_value_cmd()
176 len = payload_size - p_buf->len; in attp_build_read_by_type_value_cmd()
179 p_buf->len += len; in attp_build_read_by_type_value_cmd()
181 return p_buf; in attp_build_read_by_type_value_cmd()
197 BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + num_handle * 2 + 1 + in attp_build_read_multi_cmd() local
200 p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_read_multi_cmd()
201 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_read_multi_cmd()
202 p_buf->len = 1; in attp_build_read_multi_cmd()
206 for (i = 0; i < num_handle && p_buf->len + 2 <= payload_size; i++) { in attp_build_read_multi_cmd()
208 p_buf->len += 2; in attp_build_read_multi_cmd()
211 return p_buf; in attp_build_read_multi_cmd()
225 BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + 5 + L2CAP_MIN_OFFSET); in attp_build_handle_cmd() local
227 p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_handle_cmd()
228 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_handle_cmd()
231 p_buf->len = 1; in attp_build_handle_cmd()
234 p_buf->len += 2; in attp_build_handle_cmd()
238 p_buf->len += 2; in attp_build_handle_cmd()
241 return p_buf; in attp_build_handle_cmd()
255 BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR) + 1 + L2CAP_MIN_OFFSET); in attp_build_opcode_cmd() local
257 p = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_opcode_cmd()
258 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_opcode_cmd()
261 p_buf->len = 1; in attp_build_opcode_cmd()
263 return p_buf; in attp_build_opcode_cmd()
279 BT_HDR* p_buf = in attp_build_value_cmd() local
282 p = pp = (uint8_t*)(p_buf + 1) + L2CAP_MIN_OFFSET; in attp_build_value_cmd()
284 p_buf->offset = L2CAP_MIN_OFFSET; in attp_build_value_cmd()
285 p_buf->len = 1; in attp_build_value_cmd()
291 p_buf->len += 1; in attp_build_value_cmd()
295 p_buf->len += 2; in attp_build_value_cmd()
300 p_buf->len += 2; in attp_build_value_cmd()
305 if (payload_size - p_buf->len < len) { in attp_build_value_cmd()
306 len = payload_size - p_buf->len; in attp_build_value_cmd()
315 p_buf->len += len; in attp_build_value_cmd()
318 return p_buf; in attp_build_value_cmd()