Lines Matching refs:ev
63 static int uhid_write(int fd, const struct uhid_event* ev) { in uhid_write() argument
65 OSI_NO_INTR(ret = write(fd, ev, sizeof(*ev))); in uhid_write()
71 } else if (ret != (ssize_t)sizeof(*ev)) { in uhid_write()
73 ret, sizeof(*ev)); in uhid_write()
84 struct uhid_event ev; in uhid_read_event() local
85 memset(&ev, 0, sizeof(ev)); in uhid_read_event()
88 OSI_NO_INTR(ret = read(p_dev->fd, &ev, sizeof(ev))); in uhid_read_event()
99 switch (ev.type) { in uhid_read_event()
117 if (ret < (ssize_t)(sizeof(ev.type) + sizeof(ev.u.output))) { in uhid_read_event()
119 __func__, ret, sizeof(ev.type) + sizeof(ev.u.output)); in uhid_read_event()
124 ev.u.output.rtype, ev.u.output.size); in uhid_read_event()
127 if (ev.u.output.rtype == UHID_FEATURE_REPORT) in uhid_read_event()
128 btif_hh_setreport(p_dev, BTHH_FEATURE_REPORT, ev.u.output.size, in uhid_read_event()
129 ev.u.output.data); in uhid_read_event()
130 else if (ev.u.output.rtype == UHID_OUTPUT_REPORT) in uhid_read_event()
131 btif_hh_setreport(p_dev, BTHH_OUTPUT_REPORT, ev.u.output.size, in uhid_read_event()
132 ev.u.output.data); in uhid_read_event()
135 ev.u.output.rtype); in uhid_read_event()
138 if (ret < (ssize_t)(sizeof(ev.type) + sizeof(ev.u.output_ev))) { in uhid_read_event()
141 sizeof(ev.type) + sizeof(ev.u.output_ev)); in uhid_read_event()
147 if (ret < (ssize_t)(sizeof(ev.type) + sizeof(ev.u.feature))) { in uhid_read_event()
150 __func__, ret, sizeof(ev.type) + sizeof(ev.u.feature)); in uhid_read_event()
153 APPL_TRACE_DEBUG("UHID_FEATURE: Report type = %d", ev.u.feature.rtype); in uhid_read_event()
157 *get_rpt_id = ev.u.feature.id; in uhid_read_event()
160 if (ev.u.feature.rtype == UHID_FEATURE_REPORT) in uhid_read_event()
161 btif_hh_getreport(p_dev, BTHH_FEATURE_REPORT, ev.u.feature.rnum, 0); in uhid_read_event()
164 ev.u.feature.rtype); in uhid_read_event()
168 APPL_TRACE_DEBUG("Invalid event from uhid-dev: %u\n", ev.type); in uhid_read_event()
259 struct uhid_event ev; in bta_hh_co_destroy() local
260 memset(&ev, 0, sizeof(ev)); in bta_hh_co_destroy()
261 ev.type = UHID_DESTROY; in bta_hh_co_destroy()
262 uhid_write(fd, &ev); in bta_hh_co_destroy()
270 struct uhid_event ev; in bta_hh_co_write() local
271 memset(&ev, 0, sizeof(ev)); in bta_hh_co_write()
272 ev.type = UHID_INPUT; in bta_hh_co_write()
273 ev.u.input.size = len; in bta_hh_co_write()
274 if (len > sizeof(ev.u.input.data)) { in bta_hh_co_write()
278 memcpy(ev.u.input.data, rpt, len); in bta_hh_co_write()
280 return uhid_write(fd, &ev); in bta_hh_co_write()
486 struct uhid_event ev; in bta_hh_co_send_hid_info() local
502 memset(&ev, 0, sizeof(ev)); in bta_hh_co_send_hid_info()
503 ev.type = UHID_CREATE; in bta_hh_co_send_hid_info()
504 strlcpy((char*)ev.u.create.name, dev_name, sizeof(ev.u.create.name)); in bta_hh_co_send_hid_info()
505 snprintf((char*)ev.u.create.uniq, sizeof(ev.u.create.uniq), "%s", in bta_hh_co_send_hid_info()
507 ev.u.create.rd_size = dscp_len; in bta_hh_co_send_hid_info()
508 ev.u.create.rd_data = p_dscp; in bta_hh_co_send_hid_info()
509 ev.u.create.bus = BUS_BLUETOOTH; in bta_hh_co_send_hid_info()
510 ev.u.create.vendor = vendor_id; in bta_hh_co_send_hid_info()
511 ev.u.create.product = product_id; in bta_hh_co_send_hid_info()
512 ev.u.create.version = version; in bta_hh_co_send_hid_info()
513 ev.u.create.country = ctry_code; in bta_hh_co_send_hid_info()
514 result = uhid_write(p_dev->fd, &ev); in bta_hh_co_send_hid_info()
556 struct uhid_event ev; in bta_hh_co_get_rpt_rsp() local
577 memset(&ev, 0, sizeof(ev)); in bta_hh_co_get_rpt_rsp()
578 ev.type = UHID_FEATURE_ANSWER; in bta_hh_co_get_rpt_rsp()
579 ev.u.feature_answer.id = *get_rpt_id; in bta_hh_co_get_rpt_rsp()
580 ev.u.feature_answer.err = status; in bta_hh_co_get_rpt_rsp()
581 ev.u.feature_answer.size = len; in bta_hh_co_get_rpt_rsp()
589 memcpy(ev.u.feature_answer.data, p_rpt + GET_RPT_RSP_OFFSET, len); in bta_hh_co_get_rpt_rsp()
590 uhid_write(p_dev->fd, &ev); in bta_hh_co_get_rpt_rsp()