Lines Matching defs:buf

168   char *buf;
187 buf = (char *)malloc(len);
188 if (buf == NULL)
194 g_manufacturer_str.str = buf;
197 *buf = len;
198 *(buf + 1) = UDESC_STRING;
199 (void)memcpy_s(buf + DFU_STRING_HEAD_LEN, (size_t)str_des->len, str_des->str, (size_t)str_des->len);
204 char *buf;
223 buf = (char *)malloc(len);
224 if (buf == NULL)
230 g_serial_number_str.str = buf;
233 *buf = len;
234 *(buf + 1) = UDESC_STRING;
235 (void)memcpy_s(buf + DFU_STRING_HEAD_LEN, (size_t)str_des->len, str_des->str, (size_t)str_des->len);
240 char *buf;
259 buf = (char *)malloc(len);
260 if (buf == NULL)
266 g_product_str.str = buf;
269 *buf = len;
270 *(buf + 1) = UDESC_STRING;
271 (void)memcpy_s(buf + DFU_STRING_HEAD_LEN, (size_t)str_des->len, str_des->str, (size_t)str_des->len);
289 uint8_t *buf = req->buf;
291 buf[0] = g_flash_upgrade_state; /* The 0 bit is valid */
330 static int dfu_ram_read(uint8_t *buf, uint32_t len)
336 if (buf == NULL || entity == NULL)
349 ret = memcpy_s(buf, len, (const void *)((uint8_t *)entity->ram_addr + offset), len);
362 static int dfu_ram_write(const uint8_t *buf, uint32_t len)
368 if (buf == NULL || entity == NULL)
381 ret = memcpy_s((void *)((uint8_t *)entity->ram_addr + offset), entity->ram_size - offset, buf, len);
471 ret = usb_dfu_write(usb_dfu_get_entity(0), req->buf, (int)req->len, dev->seq_num);
537 struct dfu_getstatus_response_s *status = (struct dfu_getstatus_response_s *)ctrlreq->buf;
566 uint8_t *state = ctrlreq->buf;
616 return usb_dfu_read(usb_dfu_get_entity(0), ctrlreq->buf, (int)ctrlreq->len, dev->seq_num);
1124 int usb_dfu_read(struct usb_dfu_entity *dfu, void *buf, int size, uint32_t blk_seq_num)
1128 if (dfu == NULL || buf == NULL)
1139 ret = dfu->dfu_read(buf, size);
1154 int usb_dfu_write(struct usb_dfu_entity *dfu, void *buf, int size, uint32_t blk_seq_num)
1158 if (dfu == NULL || buf == NULL)
1170 ret = dfu->dfu_write(buf, size);
1180 void usbdev_dfu_mkdevdesc(uint8_t *buf)
1182 errno_t ret = memcpy_s(buf, USB_COMP_EP0_BUFSIZ, &g_dfu_device_desc, sizeof(g_dfu_device_desc));
1190 int usbdev_dfu_mkstrdesc(uint8_t id, uint8_t *buf)
1201 ret = memcpy_s(buf, USB_COMP_EP0_BUFSIZ, str, str[0]);