• Home
  • Raw
  • Download

Lines Matching refs:ev

62 static int uhid_write(int fd, const struct uhid_event* ev) {  in uhid_write()  argument
64 OSI_NO_INTR(ret = write(fd, ev, sizeof(*ev))); in uhid_write()
70 } else if (ret != (ssize_t)sizeof(*ev)) { in uhid_write()
72 ret, sizeof(*ev)); in uhid_write()
83 struct uhid_event ev; in uhid_read_event() local
84 memset(&ev, 0, sizeof(ev)); in uhid_read_event()
87 OSI_NO_INTR(ret = read(p_dev->fd, &ev, sizeof(ev))); in uhid_read_event()
98 switch (ev.type) { in uhid_read_event()
116 if (ret < (ssize_t)(sizeof(ev.type) + sizeof(ev.u.output))) { in uhid_read_event()
118 __func__, ret, sizeof(ev.type) + sizeof(ev.u.output)); in uhid_read_event()
123 ev.u.output.rtype, ev.u.output.size); in uhid_read_event()
126 if (ev.u.output.rtype == UHID_FEATURE_REPORT) in uhid_read_event()
127 btif_hh_setreport(p_dev, BTHH_FEATURE_REPORT, ev.u.output.size, in uhid_read_event()
128 ev.u.output.data); in uhid_read_event()
129 else if (ev.u.output.rtype == UHID_OUTPUT_REPORT) in uhid_read_event()
130 btif_hh_senddata(p_dev, ev.u.output.size, ev.u.output.data); in uhid_read_event()
133 ev.u.output.rtype); in uhid_read_event()
136 if (ret < (ssize_t)(sizeof(ev.type) + sizeof(ev.u.output_ev))) { in uhid_read_event()
139 sizeof(ev.type) + sizeof(ev.u.output_ev)); in uhid_read_event()
145 if (ret < (ssize_t)(sizeof(ev.type) + sizeof(ev.u.feature))) { in uhid_read_event()
148 __func__, ret, sizeof(ev.type) + sizeof(ev.u.feature)); in uhid_read_event()
151 APPL_TRACE_DEBUG("UHID_FEATURE: Report type = %d", ev.u.feature.rtype); in uhid_read_event()
155 *get_rpt_id = ev.u.feature.id; in uhid_read_event()
158 if (ev.u.feature.rtype == UHID_FEATURE_REPORT) in uhid_read_event()
159 btif_hh_getreport(p_dev, BTHH_FEATURE_REPORT, ev.u.feature.rnum, 0); in uhid_read_event()
162 ev.u.feature.rtype); in uhid_read_event()
166 if (ret < (ssize_t)(sizeof(ev.type) + sizeof(ev.u.set_report))) { in uhid_read_event()
168 __func__, ret, sizeof(ev.type) + sizeof(ev.u.set_report)); in uhid_read_event()
173 , ev.u.set_report.rtype, ev.u.set_report.size); in uhid_read_event()
175 if (ev.u.set_report.rtype == UHID_FEATURE_REPORT) in uhid_read_event()
177 ev.u.set_report.size, ev.u.set_report.data); in uhid_read_event()
178 else if (ev.u.set_report.rtype == UHID_OUTPUT_REPORT) in uhid_read_event()
180 ev.u.set_report.size, ev.u.set_report.data); in uhid_read_event()
181 else if(ev.u.set_report.rtype == UHID_INPUT_REPORT) in uhid_read_event()
183 ev.u.set_report.size, ev.u.set_report.data); in uhid_read_event()
186 , __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()
284 struct uhid_event ev; in bta_hh_co_destroy() local
285 memset(&ev, 0, sizeof(ev)); in bta_hh_co_destroy()
286 ev.type = UHID_DESTROY; in bta_hh_co_destroy()
287 uhid_write(fd, &ev); in bta_hh_co_destroy()
295 struct uhid_event ev; in bta_hh_co_write() local
296 memset(&ev, 0, sizeof(ev)); in bta_hh_co_write()
297 ev.type = UHID_INPUT; in bta_hh_co_write()
298 ev.u.input.size = len; in bta_hh_co_write()
299 if (len > sizeof(ev.u.input.data)) { in bta_hh_co_write()
303 memcpy(ev.u.input.data, rpt, len); in bta_hh_co_write()
305 return uhid_write(fd, &ev); in bta_hh_co_write()
511 struct uhid_event ev; in bta_hh_co_send_hid_info() local
527 memset(&ev, 0, sizeof(ev)); in bta_hh_co_send_hid_info()
528 ev.type = UHID_CREATE; in bta_hh_co_send_hid_info()
529 strlcpy((char*)ev.u.create.name, dev_name, sizeof(ev.u.create.name)); in bta_hh_co_send_hid_info()
530 snprintf((char*)ev.u.create.uniq, sizeof(ev.u.create.uniq), "%s", in bta_hh_co_send_hid_info()
532 ev.u.create.rd_size = dscp_len; in bta_hh_co_send_hid_info()
533 ev.u.create.rd_data = p_dscp; in bta_hh_co_send_hid_info()
534 ev.u.create.bus = BUS_BLUETOOTH; in bta_hh_co_send_hid_info()
535 ev.u.create.vendor = vendor_id; in bta_hh_co_send_hid_info()
536 ev.u.create.product = product_id; in bta_hh_co_send_hid_info()
537 ev.u.create.version = version; in bta_hh_co_send_hid_info()
538 ev.u.create.country = ctry_code; in bta_hh_co_send_hid_info()
539 result = uhid_write(p_dev->fd, &ev); in bta_hh_co_send_hid_info()
581 struct uhid_event ev; in bta_hh_co_get_rpt_rsp() local
602 memset(&ev, 0, sizeof(ev)); in bta_hh_co_get_rpt_rsp()
603 ev.type = UHID_FEATURE_ANSWER; in bta_hh_co_get_rpt_rsp()
604 ev.u.feature_answer.id = *get_rpt_id; in bta_hh_co_get_rpt_rsp()
605 ev.u.feature_answer.err = status; in bta_hh_co_get_rpt_rsp()
606 ev.u.feature_answer.size = len; in bta_hh_co_get_rpt_rsp()
614 memcpy(ev.u.feature_answer.data, p_rpt + GET_RPT_RSP_OFFSET, len); in bta_hh_co_get_rpt_rsp()
615 uhid_write(p_dev->fd, &ev); in bta_hh_co_get_rpt_rsp()