Reputation: 21
I developped an user interface for simulating different types of failures on CAN signals contained in a frame (clock stuck, erroneous CRC). I need also to simulate unavailable values but in order to do so I have to use the input from the user which represents the signal name.
I don't know how to look in the database and retrieve the corresponding CAN signal in order to give it the unavailable value.
Upvotes: 2
Views: 2365
Reputation: 31
To get CAN signal from database use
signal * lookupSignal(char signalName[]);
For example:
signal * mySig = lookupSignal("MyNetwork::Node1::MyMessage::SignalName");
Then to get/set signal value
float value;
value = getSignal(mySig);
write("mySig value is %f", value);
setSignal(mySig, 0);
Upvotes: 1