-
Notifications
You must be signed in to change notification settings - Fork 19
Sending a message give timeout error and can't set different txaddress adnd rxaddress #34
Description
I'm trying to send a message using this library but I get an error on Channel.SendMessage()
even though I don't have a read command the library is waiting for a response and i'm getting an error
the second problem is how to set the txAddress and rxAddress because I need to specify a particular 29bit address
here is the message I got while sending the message
SAE.J2534.J2534Exception: The PassThru device was unable to read the specified number of messages from the vehicle network within the specified time.
à SAE.J2534.API.CheckResult(ResultCode Result) dans J2534-Sharp-master\src\API.cs:ligne 122
à SAE.J2534.Channel.SendMessages(HeapMessageArray hJ2534MessageArray_Local) dans J2534-Sharp-master\src\Channel.cs:ligne 150
à SAE.J2534.Channel.SendMessage(IEnumerable`1 Message) dans J2534-Sharp-master\src\Channel.cs:ligne 104
à J2534_Test.Form1.button1_Click(Object sender, EventArgs e) dans J2534 Test\Form1.cs:ligne 42
OK
here is the code I used
`
MessageFilter FlowControlFilter = new MessageFilter()
{
FilterType = Filter.FLOW_CONTROL_FILTER,
Mask = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF },
Pattern = new byte[] { 0x00, 0x00, 0x07, 0xE8 },
FlowControl = new byte[] { 0x00, 0x00, 0x07, 0xE0 }
};
if (comboBox1.Text == "")
return;
string DllFileName = APIFactory.GetAPIinfo().FirstOrDefault(x => x.Name == comboBox1.Text).Filename;
using (API API = APIFactory.GetAPI(DllFileName))
using (Device Device = API.GetDevice())
using (Channel Channel = Device.GetChannel(Protocol.ISO15765, Baud.ISO15765, ConnectFlag.NONE))
{
try
{
Channel.StartMsgFilter(FlowControlFilter);
textBox1.Text += $"Voltage is {Channel.MeasureBatteryVoltage() / 1000}" + Environment.NewLine;
Channel.SendMessage(new byte[] { 0x01, 0x02, 0x07, 0xE0, 0x01, 0x03 });
//GetMessageResults Response = Channel.GetMessage();
}
catch (Exception ex)
{
MessageBox.Show("" + ex);
}
}
`
Thank you for your help