private void OnTimedEvent(object sourcea) { CANFrame frame = new CANFrame(); try { // now config Block Requests frame.MailboxId = (uint)CNXMsgIds.BlockQuery + (uint)Block.RouteConfig; mCANClient.Send(frame); frame.MailboxId = (uint)CNXMsgIds.BlockQuery + (uint)Block.VehicleConfig; mCANClient.Send(frame); frame.MailboxId = (uint)CNXMsgIds.BlockQuery + (uint)Block.ServiceAlert; mCANClient.Send(frame); frame.MailboxId = (uint)CNXMsgIds.BlockQuery + (uint)Block.DriverConfig; mCANClient.Send(frame); // test the status every few cycles if (++mTestCatalogueCount > TestCatalogueCycles) { // age the device catalogue states if (mDeviceCatalogue.AgeCatalogue() == CANLib.DeviceCatalogue.CatalogueChangeType.STATUS) { EquipmentChangedEventArgs args = new EquipmentChangedEventArgs(mDeviceCatalogue.EquipmentMask, mDeviceCatalogue.EquipmentStatus); OnRaiseEquipmentChangedEvent(args); } mTestCatalogueCount = 0; } } catch (Exception e) { CNXLog.Error(e.ToString()); } }
/// <summary> /// Puts a BlockQueryResponce frame onto the CAN bus. /// </summary> public void SendBlockQueryResponce() { CANFrame resp = BuildQueryResponce(); mClient.Send(resp); }
/// <summary> /// Sends the catalogue frame. /// </summary> public void SendDeviceCatalogue() { mCANClient.Send(mCatalogueFrame); }