mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Implement FlexRay transmit, configuration, and cold start
This commit is contained in:
@@ -5,6 +5,7 @@ namespace icsneo {
|
||||
|
||||
enum class Command : uint8_t {
|
||||
EnableNetworkCommunication = 0x07,
|
||||
EnableNetworkCommunicationEx = 0x08,
|
||||
RequestSerialNumber = 0xA1,
|
||||
SetSettings = 0xA4, // Previously known as RED_CMD_SET_BAUD_REQ, follow up with SaveSettings to write to EEPROM
|
||||
//GetSettings = 0xA5, // Previously known as RED_CMD_READ_BAUD_REQ, now unused
|
||||
|
||||
@@ -11,7 +11,7 @@ class MessageFilter {
|
||||
public:
|
||||
MessageFilter() {}
|
||||
MessageFilter(Network::Type type) : type(type) {}
|
||||
MessageFilter(Network::NetID netid) : netid(netid) {}
|
||||
MessageFilter(Network::NetID netid) : type(Network::GetTypeOfNetID(netid)), netid(netid) {}
|
||||
virtual ~MessageFilter() {}
|
||||
// When getting "all" types of messages, include the ones marked as "internal only"
|
||||
bool includeInternalInAny = false;
|
||||
|
||||
@@ -12,11 +12,13 @@ namespace icsneo {
|
||||
// Internal message which gives us the state of the FlexRay Controllers
|
||||
class FlexRayControlMessage : public Message {
|
||||
public:
|
||||
static std::vector<uint8_t> BuildBaseControlArgs(uint8_t controller, FlexRay::Opcode op, std::initializer_list<uint8_t> args);
|
||||
static std::vector<uint8_t> BuildBaseControlArgs(uint8_t controller, FlexRay::Opcode op, const std::vector<uint8_t>& args);
|
||||
static std::vector<uint8_t> BuildReadCCRegsArgs(uint8_t controller, uint16_t startAddress, uint8_t numRegisters = 1);
|
||||
static std::vector<uint8_t> BuildWriteCCRegArgs(uint8_t controller, uint16_t address, uint32_t value);
|
||||
static std::vector<uint8_t> BuildAddConfiguredTxMessageArgs(
|
||||
uint8_t controller, uint16_t descriptionId, uint16_t slotId, uint8_t baseCycle, uint8_t cycleReps, FlexRay::Channel channel);
|
||||
static std::vector<uint8_t> BuildWriteMessageBufferArgs(
|
||||
uint8_t controller, uint16_t bufferId, const std::vector<uint8_t>& data, uint16_t desiredSize);
|
||||
|
||||
FlexRayControlMessage(const Packet& packet);
|
||||
virtual ~FlexRayControlMessage() = default;
|
||||
|
||||
@@ -25,7 +25,8 @@ public:
|
||||
bool sync = false;
|
||||
bool startup = false;
|
||||
bool dynamic = false;
|
||||
uint8_t cycle = 0;
|
||||
uint8_t cycle = 0; // baseCycle when transmitting
|
||||
uint8_t cycleRepetition = 0; // only for transmit
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
#define __MAIN51MESSAGE_H_
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
#include "icsneo/communication/communication.h"
|
||||
#include "icsneo/communication/command.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class Main51Message : public Message {
|
||||
public:
|
||||
virtual ~Main51Message() = default;
|
||||
Command command;
|
||||
Command command = Command(0);
|
||||
bool forceShortFormat = false; // Necessary for EnableNetworkCom and EnableNetworkComEx
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -433,6 +433,7 @@ public:
|
||||
return os;
|
||||
}
|
||||
friend bool operator==(const Network& net1, const Network& net2) { return net1.getNetID() == net2.getNetID(); }
|
||||
friend bool operator!=(const Network& net1, const Network& net2) { return !(net1 == net2); }
|
||||
|
||||
private:
|
||||
NetID value; // Always use setValue so that value and type stay in sync
|
||||
|
||||
Reference in New Issue
Block a user