Lines Matching defs:fd
208 static int send_event (int fd, uint16_t type, uint16_t code, int32_t value);
209 static void send_key (int fd, uint16_t key, int pressed);
310 int send_event (int fd, uint16_t type, uint16_t code, int32_t value)
321 OSI_NO_INTR(ret = write(fd, &event, sizeof(event)));
325 void send_key (int fd, uint16_t key, int pressed)
327 BTIF_TRACE_DEBUG("%s fd:%d key:%u pressed:%d", __FUNCTION__,
328 fd, key, pressed);
330 if (fd < 0)
335 LOG_INFO(LOG_TAG, "AVRCP: Send key %s (%d) fd=%d", key_id_to_str(key), pressed, fd);
336 send_event(fd, EV_KEY, key, pressed);
337 send_event(fd, EV_SYN, SYN_REPORT, 0);
357 int fd, x = 0;
361 fd = open(uinput_dev_path[x], O_RDWR);
362 if (fd < 0)
380 OSI_NO_INTR(ret = write(fd, &dev, sizeof(dev)));
383 close(fd);
387 ioctl(fd, UI_SET_EVBIT, EV_KEY);
388 ioctl(fd, UI_SET_EVBIT, EV_REL);
389 ioctl(fd, UI_SET_EVBIT, EV_SYN);
392 ioctl(fd, UI_SET_KEYBIT, key_map[x].mapped_id);
394 if (ioctl(fd, UI_DEV_CREATE, NULL) < 0) {
396 close(fd);
399 return fd;
412 BTIF_TRACE_DEBUG("%s AVRCP: Initialized uinput for %s (fd=%d)",