Received my ez-link, is working and paired ok.
I can switch DTR high and low as expected, very nice feature on a bluetooth COM port.
1) However I would expect SETBREAK/CLRBREAK to toggle TX in exactly the same way that DTR is toggled, but they do not - is this supported?
It would be coded in a very similar way to DTR so I don't see why it should be missing from the firmware?
2) Can you send an AT command or similar to invert the polarity (ie TX idle low instead of high) like you can invert polarity on FTDI chips?
Many thanks.
Code: Select all
#include <stdio.h>
#include <windows.h>
HANDLE hSerialIn;
char *pcCommPort = "COM16";
int main (void)
{
hSerialIn = CreateFile(pcCommPort,
GENERIC_READ | GENERIC_WRITE,
0,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
LPDWORD dwErrorFlags = 0;
LPCOMSTAT ComStat = 0;
if(hSerialIn==INVALID_HANDLE_VALUE)
{
DWORD err = GetLastError();
printf("\nHandle creation error code: %x\n", err);
}
else
{
puts("SUCCESS!!!");
}
printf("Set break.\n");
EscapeCommFunction(hSerialIn , SETBREAK );
Sleep(5000);
printf("Clear break.\n");
EscapeCommFunction(hSerialIn , CLRBREAK );
Sleep(5000);
CloseHandle(hSerialIn);
return 1;
}