MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / check_port_capabilities

Function check_port_capabilities

lib/termios.c:1296–1343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1294----------------------------------------------------------*/
1295
1296static int check_port_capabilities(struct termios_list *index)
1297{
1298 COMMPROP cp;
1299 DCB dcb;
1300 char message[80];
1301
1302 ENTER("check_port_capabilities");
1303 /* check for capabilities */
1304 GetCommProperties(index->hComm, &cp);
1305
1306 if (!(cp.dwProvCapabilities & PCF_DTRDSR))
1307 {
1308 SNPRINTF(message, sizeof(message),
1309 "%s: no DTR & DSR support\n", __func__);
1310 report(message);
1311 }
1312
1313 if (!(cp.dwProvCapabilities & PCF_RLSD))
1314 {
1315 SNPRINTF(message, sizeof(message), "%s: no carrier detect (RLSD) support\n",
1316 __func__);
1317 report(message);
1318 }
1319
1320 if (!(cp.dwProvCapabilities & PCF_RTSCTS))
1321 {
1322 SNPRINTF(message, sizeof(message),
1323 "%s: no RTS & CTS support\n", __func__);
1324 report(message);
1325 }
1326
1327 if (!(cp.dwProvCapabilities & PCF_TOTALTIMEOUTS))
1328 {
1329 SNPRINTF(message, sizeof(message), "%s: no timeout support\n", __func__);
1330 report(message);
1331 }
1332
1333 if (!GetCommState(index->hComm, &dcb))
1334 {
1335 YACK();
1336 report("GetCommState\n");
1337 return -1;
1338 }
1339
1340 LEAVE("check_port_capabilities");
1341 return 0;
1342
1343}
1344
1345/*----------------------------------------------------------
1346serial_open()

Callers 1

win32_serial_openFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected