EZ-link break support?

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
scraxe
 
Posts: 2
Joined: Mon Mar 31, 2014 8:49 am

EZ-link break support?

Post by scraxe »

Hello

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;
}

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: EZ-link break support?

Post by adafruit »

1) we dont support set/clr break - its not part of RFCOMM
2) there is no configuration or AT command set. to invert TX, use any kind of 74 logic inverter

scraxe
 
Posts: 2
Joined: Mon Mar 31, 2014 8:49 am

Re: EZ-link break support?

Post by scraxe »

Ok, I accept if it' s not in the firmware then I simply can't use it!

However I think you will find break is the second field of MSC within RFCOMM and can be set to a predefined length, so it should be possible to add some type of break function.

Code: Select all

/*---------------------------------------------------------------------------
 * RF_SetModemStatus()
 *
 *     Sends a modem status command to the remote device.  This function
 *     allows the application to send flow control and V.24 signals to the
 *     remote device.
 *
 * Requires:
 *     RF_SEND_CONTROL enabled.
 *
 * Parameters:
 *     channel - Identifies the connected channel for this action.
 *
 *     modemStatus - The modem status structure.  The "signals" field should
 *         be initialized with the V.24 bits and/or flow control bit.
 *         The "breakLen" field should contain a value between 0 and 15,
 *         signifying the length of a break signal in 200 ms units.
 *         If "breakLen" is zero, no break signal is sent.
 *
 *         The "modemStatus" structure is owned by RFCOMM until either an
 *         RFEVENT_MODEM_STATUS_CNF or RFEVENT_CLOSED event is received.
 *
 *         The FC bit of the modem status is used for flow control of the
 *         channel.  Applications do not need to set this bit, however,
 *         because flow control is automatically managed using credits.
 *
 *         See RF_AdvanceCredit for a discussion of flow control.
 *
 * Returns:
 *     BT_STATUS_PENDING - The modem status will be sent to the remote
 *         device.  If the remote device receives the status, the
 *         channel's callback function will receive an RFEVENT_MODEM_STATUS_CNF
 *         event. If the operation times out, the callback function will
 *         receive an RFEVENT_CLOSED event.
 *
 *     BT_STATUS_FAILED - The channel is not open.
 *
 *     BT_STATUS_IN_PROGRESS -  An RFCOMM control channel request is already 
 *         outstanding for this channel.  Wait for the status event associated 
 *         with the request before sending a new request. The functions that 
 *         make control channel requests are:  RF_SetModemStatus, 
 *         RF_SetLineStatus, RF_RequestPortSettings, RF_RequestPortStatus, 
 *         and RF_SendTest.
 *
 *     BT_STATUS_INVALID_PARM - Invalid parameter (XA_ERROR_CHECK only).
 */

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”