Lines Matching refs:gComPortContext

70 static phDal4Nfc_ComPortContext_t gComPortContext;  variable
84 memset(&gComPortContext, 0, sizeof(phDal4Nfc_ComPortContext_t)); in phDal4Nfc_uart_initialize()
100 gComPortContext.nHandle = (int)(intptr_t) pDalHwContext->p_board_driver; in phDal4Nfc_uart_set_open_from_handle()
101 DAL_ASSERT_STR(gComPortContext.nHandle >= 0, "Bad passed com port handle"); in phDal4Nfc_uart_set_open_from_handle()
102 gComPortContext.nOpened = 1; in phDal4Nfc_uart_set_open_from_handle()
115 return gComPortContext.nOpened; in phDal4Nfc_uart_is_opened()
130 ret = tcflush(gComPortContext.nHandle, TCIFLUSH); in phDal4Nfc_uart_flush()
144 if (gComPortContext.nOpened == 1) in phDal4Nfc_uart_close()
146 close(gComPortContext.nHandle); in phDal4Nfc_uart_close()
147 gComPortContext.nHandle = 0; in phDal4Nfc_uart_close()
148 gComPortContext.nOpened = 0; in phDal4Nfc_uart_close()
166 DAL_ASSERT_STR(gComPortContext.nOpened==0, "Trying to open but already done!"); in phDal4Nfc_uart_open_and_configure()
171 gComPortContext.nHandle = open(pConfig->deviceNode, O_RDWR | O_NOCTTY); in phDal4Nfc_uart_open_and_configure()
172 if (gComPortContext.nHandle < 0) in phDal4Nfc_uart_open_and_configure()
178 gComPortContext.nOpened = 1; in phDal4Nfc_uart_open_and_configure()
179 *pLinkHandle = (void*)(intptr_t)gComPortContext.nHandle; in phDal4Nfc_uart_open_and_configure()
184 …ret = tcgetattr(gComPortContext.nHandle, &gComPortContext.nIoConfigBackup); /* save the old io con… in phDal4Nfc_uart_open_and_configure()
191 ret = fcntl(gComPortContext.nHandle, F_SETFL, 0); /* Makes the read blocking (default). */ in phDal4Nfc_uart_open_and_configure()
194 memset((void *)&gComPortContext.nIoConfig, (int)0, (size_t)sizeof(struct termios)); in phDal4Nfc_uart_open_and_configure()
203gComPortContext.nIoConfig.c_cflag = DAL_BAUD_RATE | CS8 | CLOCAL | CREAD; /* Control mode flags */ in phDal4Nfc_uart_open_and_configure()
204gComPortContext.nIoConfig.c_iflag = IGNPAR; /* Input mo… in phDal4Nfc_uart_open_and_configure()
205gComPortContext.nIoConfig.c_oflag = 0; /* Output mo… in phDal4Nfc_uart_open_and_configure()
206gComPortContext.nIoConfig.c_lflag = 0; /* Local mo… in phDal4Nfc_uart_open_and_configure()
207gComPortContext.nIoConfig.c_cc[VTIME] = 0; /* Control ch… in phDal4Nfc_uart_open_and_configure()
208gComPortContext.nIoConfig.c_cc[VMIN] = 1; /* Control ch… in phDal4Nfc_uart_open_and_configure()
215 ret = tcsetattr(gComPortContext.nHandle, TCSANOW, &gComPortContext.nIoConfig); in phDal4Nfc_uart_open_and_configure()
222 ret = ioctl(gComPortContext.nHandle, TIOCMGET, &nComStatus); in phDal4Nfc_uart_open_and_configure()
225 ret = ioctl(gComPortContext.nHandle, TIOCMSET, &nComStatus); in phDal4Nfc_uart_open_and_configure()
305 DAL_ASSERT_STR(gComPortContext.nOpened == 1, "read called but not opened!"); in phDal4Nfc_uart_read()
332 FD_SET(gComPortContext.nHandle, &rfds); in phDal4Nfc_uart_read()
339 ret = select(gComPortContext.nHandle + 1, &rfds, NULL, NULL, ptv); in phDal4Nfc_uart_read()
350 ret = read(gComPortContext.nHandle, pBuffer + numRead, nNbBytesToRead - numRead); in phDal4Nfc_uart_read()
385 DAL_ASSERT_STR(gComPortContext.nOpened == 1, "write called but not opened!"); in phDal4Nfc_uart_write()
389 ret = write(gComPortContext.nHandle, pBuffer + numWrote, nNbBytesToWrite - numWrote); in phDal4Nfc_uart_write()