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()
167 if (ret < (ssize_t)(sizeof(ev.type) + sizeof(ev.u.set_report))) { in uhid_read_event()
169 __func__, ret, sizeof(ev.type) + sizeof(ev.u.set_report)); in uhid_read_event()
174 , ev.u.set_report.rtype, ev.u.set_report.size); in uhid_read_event()
176 if (ev.u.set_report.rtype == UHID_FEATURE_REPORT) in uhid_read_event()
178 ev.u.set_report.size, ev.u.set_report.data); in uhid_read_event()
179 else if (ev.u.set_report.rtype == UHID_OUTPUT_REPORT) in uhid_read_event()
181 ev.u.set_report.size, ev.u.set_report.data); in uhid_read_event()
182 else if(ev.u.set_report.rtype == UHID_INPUT_REPORT) in uhid_read_event()
184 ev.u.set_report.size, ev.u.set_report.data); in uhid_read_event()
187 , __func__, ev.u.set_report.rtype); in uhid_read_event()
190 APPL_TRACE_DEBUG("Invalid event from uhid-dev: %u\n", ev.type); in uhid_read_event()
281 struct uhid_event ev; in bta_hh_co_destroy() local
282 memset(&ev, 0, sizeof(ev)); in bta_hh_co_destroy()
283 ev.type = UHID_DESTROY; in bta_hh_co_destroy()
284 uhid_write(fd, &ev); in bta_hh_co_destroy()
292 struct uhid_event ev; in bta_hh_co_write() local
293 memset(&ev, 0, sizeof(ev)); in bta_hh_co_write()
294 ev.type = UHID_INPUT; in bta_hh_co_write()
295 ev.u.input.size = len; in bta_hh_co_write()
296 if (len > sizeof(ev.u.input.data)) { in bta_hh_co_write()
300 memcpy(ev.u.input.data, rpt, len); in bta_hh_co_write()
302 return uhid_write(fd, &ev); in bta_hh_co_write()
508 struct uhid_event ev; in bta_hh_co_send_hid_info() local
524 memset(&ev, 0, sizeof(ev)); in bta_hh_co_send_hid_info()
525 ev.type = UHID_CREATE; in bta_hh_co_send_hid_info()
526 strlcpy((char*)ev.u.create.name, dev_name, sizeof(ev.u.create.name)); in bta_hh_co_send_hid_info()
527 snprintf((char*)ev.u.create.uniq, sizeof(ev.u.create.uniq), "%s", in bta_hh_co_send_hid_info()
529 ev.u.create.rd_size = dscp_len; in bta_hh_co_send_hid_info()
530 ev.u.create.rd_data = p_dscp; in bta_hh_co_send_hid_info()
531 ev.u.create.bus = BUS_BLUETOOTH; in bta_hh_co_send_hid_info()
532 ev.u.create.vendor = vendor_id; in bta_hh_co_send_hid_info()
533 ev.u.create.product = product_id; in bta_hh_co_send_hid_info()
534 ev.u.create.version = version; in bta_hh_co_send_hid_info()
535 ev.u.create.country = ctry_code; in bta_hh_co_send_hid_info()
536 result = uhid_write(p_dev->fd, &ev); in bta_hh_co_send_hid_info()
578 struct uhid_event ev; in bta_hh_co_get_rpt_rsp() local
599 memset(&ev, 0, sizeof(ev)); in bta_hh_co_get_rpt_rsp()
600 ev.type = UHID_FEATURE_ANSWER; in bta_hh_co_get_rpt_rsp()
601 ev.u.feature_answer.id = *get_rpt_id; in bta_hh_co_get_rpt_rsp()
602 ev.u.feature_answer.err = status; in bta_hh_co_get_rpt_rsp()
603 ev.u.feature_answer.size = len; in bta_hh_co_get_rpt_rsp()
611 memcpy(ev.u.feature_answer.data, p_rpt + GET_RPT_RSP_OFFSET, len); in bta_hh_co_get_rpt_rsp()
612 uhid_write(p_dev->fd, &ev); in bta_hh_co_get_rpt_rsp()